/* ═══════════════════════════════════════════════
   ANDY S. DING — PERSONAL WEBSITE
   Design: "Soundings" — sea-glass / abyss, sonar teal + buoy amber
═══════════════════════════════════════════════ */

/* ── Tokens — "Soundings" design system (research instrument / nautical chart)
   Token NAMES are kept stable so the whole site re-skins via these values:
   --green = sonar teal (primary), --clay = buoy amber (signal accent). ── */
:root {
  /* Warm editorial palette — premium, neutral, ONE restrained accent */
  --paper:      #f5f2ec;   /* warm paper */
  --paper-2:    #efe9df;
  --paper-3:    #e7dfd2;
  --ink:        #16181a;   /* near-black, warm */
  --ink-2:      #4a4f4c;
  --ink-3:      #6b716c;   /* muted — AA on paper */
  --green:      #3f5b50;   /* muted evergreen — the single accent (links/actions) */
  --green-deep: #2c4339;
  --green-soft: rgba(63, 91, 80, 0.10);
  --clay:       #8a6f53;   /* quiet warm secondary — used sparingly */
  --clay-soft:  rgba(138, 111, 83, 0.12);
  --card:       #fbf9f4;
  --border:     rgba(22, 24, 26, 0.12);
  --border-strong: rgba(22, 24, 26, 0.22);
  --nav-h:      66px;
  --radius:     10px;
  --radius-sm:  6px;
  --transition: 0.25s ease;
  --shadow:     0 1px 2px rgba(22, 24, 26, 0.04), 0 8px 24px rgba(22, 24, 26, 0.05);
  --shadow-lg:  0 18px 48px rgba(22, 24, 26, 0.10);
  --font-body:  'Inter', system-ui, sans-serif;
  --font-display: 'Inter', system-ui, sans-serif;   /* light grotesque for upright headlines */
  --font-accent: 'Fraunces', Georgia, 'Times New Roman', serif; /* serif italic for emphasis words */
  --font-mono:  'IBM Plex Mono', ui-monospace, 'SFMono-Regular', monospace;
  --nav-bg:     rgba(245, 242, 236, 0.80);
  /* Spacing scale (4/8px base) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 128px;
  /* Modular type scale */
  --text-xs: 0.75rem; --text-sm: 0.875rem; --text-base: 1rem;
  --text-lg: 1.125rem; --text-xl: 1.375rem; --text-2xl: 1.85rem;
  --text-3xl: 2.6rem; --text-4xl: 3.6rem; --text-hero: clamp(2.6rem, 7vw, 5.5rem);
  --measure: 68ch;
  color-scheme: light;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; }
button { font-family: inherit; }

/* Soft natural background wash */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 60% 50% at 8% 0%,   rgba(63, 91, 80, 0.045), transparent 70%),
    radial-gradient(ellipse 46% 42% at 100% 92%, rgba(138, 111, 83, 0.03), transparent 70%),
    var(--paper);
}

/* ═══════════════════════════════════════════════
   NAVIGATION
════════════════════════════════════════════════ */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 5vw, 60px);
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-leaf { font-size: 1rem; }

.nav-links { display: flex; gap: 2px; align-items: center; }
.nav-link {
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-2);
  transition: var(--transition);
  position: relative;
}
.nav-link:hover { color: var(--ink); background: var(--green-soft); }
.nav-link.active { color: var(--green-deep); font-weight: 600; }
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 50%;
  transform: translateX(-50%);
  width: 18px; height: 2px;
  background: var(--green);
  border-radius: 2px;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 24px; height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: var(--transition);
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-drawer {
  position: fixed;
  top: var(--nav-h); right: 0; bottom: 0;
  width: min(280px, 80vw);
  background: var(--paper);
  border-left: 1px solid var(--border);
  z-index: 999;
  transform: translateX(100%);
  transition: transform var(--transition);
  padding: 24px 20px;
}
.mobile-drawer.open { transform: translateX(0); }
.mobile-drawer ul { display: flex; flex-direction: column; gap: 4px; }
.drawer-link {
  display: block;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink-2);
  transition: var(--transition);
}
.drawer-link:hover, .drawer-link.active {
  color: var(--green-deep);
  background: var(--green-soft);
}
.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 998;
  background: rgba(22, 24, 26, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.drawer-overlay.visible { opacity: 1; pointer-events: all; }

/* ═══════════════════════════════════════════════
   SECTIONS
════════════════════════════════════════════════ */
#main { position: relative; z-index: 1; }

.section {
  min-height: calc(100vh - var(--nav-h));
  padding-top: var(--nav-h);
  display: none;
  animation: fadeUp 0.45s ease both;
}
.section.active { display: block; }

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

.section-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 60px clamp(20px, 5vw, 60px) 90px;
}

.section-header {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  column-gap: 22px;
  row-gap: 6px;
  margin-bottom: var(--s-7);
}
.section-number {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--ink-3);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  grid-column: 1 / -1;
}
.section-title {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: clamp(2.1rem, 5.2vw, 3.4rem);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.section-title em {
  font-style: italic;
  font-weight: 500;
  color: var(--green-deep);
}
.section-line {
  align-self: center;
  height: 1px;
  background: linear-gradient(to right, var(--border-strong), transparent);
}
.section-subtitle {
  color: var(--ink-2);
  font-size: 1.05rem;
  margin-top: var(--s-4);
  margin-bottom: var(--s-7);
  max-width: var(--measure);
  line-height: 1.7;
}

/* ═══════════════════════════════════════════════
   BUTTONS
════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}
/* arrow nudge on hover for any button whose label ends with an arrow */
.btn { --arrow-shift: 0; }
.btn:hover { --arrow-shift: 3px; }
.btn-small { padding: 9px 18px; font-size: 0.85rem; }

.btn-primary {
  background: var(--ink);
  color: var(--paper);
}
.btn-primary:hover {
  background: var(--green-deep);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover {
  border-color: var(--ink);
  background: transparent;
}

.link-btn {
  background: none;
  border: none;
  color: var(--green-deep);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: var(--transition);
}
.link-btn:hover { background: var(--green-soft); }
.link-btn.danger { color: var(--clay); }
.link-btn.danger:hover { background: var(--clay-soft); }

/* ═══════════════════════════════════════════════
   HOME — HERO
════════════════════════════════════════════════ */
#home.active {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
}
.hero-container {
  max-width: 1060px;
  width: 100%;
  margin: 0 auto;
  padding: 0 clamp(24px, 6vw, 60px);
}

.hero-eyebrow {
  font-size: 1rem;
  font-weight: 600;
  color: var(--clay);
  margin-bottom: 20px;
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 8vw, 5.5rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.015em;
  margin-bottom: 26px;
  color: var(--ink);
}
.hero-name em {
  font-style: italic;
  font-weight: 500;
  color: var(--green);
}

.hero-tagline {
  font-size: clamp(1rem, 2.2vw, 1.18rem);
  color: var(--ink-2);
  line-height: 1.75;
  max-width: 580px;
  margin-bottom: 36px;
}

.hero-cta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.hero-topics { display: flex; gap: 10px; flex-wrap: wrap; }
.topic-chip {
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--ink-2);
  font-size: 0.84rem;
  font-weight: 500;
  box-shadow: var(--shadow);
}

/* ═══════════════════════════════════════════════
   ABOUT
════════════════════════════════════════════════ */
.about-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 64px;
  align-items: start;
}

/* ── Photo column — professional portrait treatment ── */
.about-photo-col {
  position: relative;
}

.photo-frame {
  position: relative;
  width: 100%;
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--paper-2);
}

/* Soft vignette overlay */
.photo-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  pointer-events: none;
  box-shadow: inset 0 0 80px rgba(22, 24, 26, 0.05);
}

.about-photo-img {
  display: block;
  width: 100%;
  height: auto;
  /* No forced aspect-ratio — let the image breathe naturally */
  border-radius: 16px;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Gentle zoom on hover — feels alive, not static */
.photo-frame:hover .about-photo-img {
  transform: scale(1.03);
}
.social-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  color: var(--ink-2);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  background: var(--card);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.social-link:hover {
  border-color: var(--green);
  color: var(--green-deep);
  background: var(--green-soft);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(63, 91, 80, 0.15);
}

.about-bio {
  color: var(--ink-2);
  font-size: 1.04rem;
  line-height: 1.85;
  margin-bottom: 18px;
}
.about-bio strong { color: var(--ink); }

.skills-section { margin: 30px 0; }
.skills-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  margin-bottom: 16px;
}
.skills-grid { display: flex; flex-direction: column; gap: 14px; }
.skill-category { display: flex; align-items: flex-start; gap: 12px; }
.skill-cat-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-3);
  min-width: 92px;
  padding-top: 6px;
}
.skill-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  padding: 5px 13px;
  border-radius: 999px;
  background: var(--green-soft);
  border: 1px solid rgba(63, 91, 80, 0.2);
  color: var(--green-deep);
  font-size: 0.82rem;
  font-weight: 500;
}

.about-quick-facts {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 26px;
  padding-top: 24px;
  border-top: 1px dashed var(--border-strong);
}
.fact {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-2);
  font-size: 0.92rem;
}
.fact-icon { font-size: 1.1rem; }

/* ═══════════════════════════════════════════════
   BLOG — single card
════════════════════════════════════════════════ */
.blog-card {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(28px, 4vw, 44px);
  box-shadow: none;
  transition: var(--transition);
  max-width: 760px;
}
.blog-card:hover {
  box-shadow: none;
  transform: none;
  border-color: var(--border-strong);
  background: var(--green-soft);
}

.blog-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.blog-tag {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--clay-soft);
  color: var(--clay);
}
.blog-date { color: var(--ink-3); font-size: 0.82rem; }

.blog-card-title {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: clamp(1.8rem, 3.4vw, 2.4rem);
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 14px;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.blog-card-excerpt {
  color: var(--ink-2);
  font-size: 0.96rem;
  line-height: 1.75;
  margin-bottom: 26px;
}
.blog-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.blog-read-time { color: var(--ink-3); font-size: 0.84rem; }
.blog-view-count { color: var(--ink-3); font-size: 0.84rem; }

.blog-hint {
  margin-top: 22px;
  color: var(--ink-3);
  font-size: 0.88rem;
  max-width: 760px;
}
.blog-hint strong { color: var(--ink-2); }

/* ═══════════════════════════════════════════════
   POST — article view
════════════════════════════════════════════════ */
.post-inner { max-width: 780px; }

.post-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

/* Title + meta */
.post-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 5vw, 2.8rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 14px;
  outline: none;
}
.post-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-3);
  font-size: 0.86rem;
  margin-bottom: 36px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.meta-dot { opacity: 0.6; }

/* Article body typography */
.post-body {
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--ink);
  outline: none;
  min-height: 200px;
}
.post-body p { margin-bottom: 18px; }
.post-body h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  margin: 34px 0 14px;
}
.post-body h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 28px 0 12px;
}
.post-body ul, .post-body ol { margin: 0 0 18px 26px; }
.post-body ul { list-style: disc; }
.post-body ol { list-style: decimal; }
.post-body li { margin-bottom: 6px; }
.post-body blockquote {
  border-left: 3px solid var(--green);
  background: var(--green-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 20px;
  margin: 0 0 18px;
  color: var(--ink-2);
  font-style: italic;
}
.post-body a {
  color: var(--green-deep);
  text-decoration: underline;
  text-decoration-color: rgba(63, 91, 80, 0.4);
  text-underline-offset: 3px;
}
.post-body a:hover { text-decoration-color: var(--green); }

/* ═══════════════════════════════════════════════
   COMMENTS — Reddit-style threading
════════════════════════════════════════════════ */
.comments-section {
  margin-top: 56px;
  padding-top: 36px;
  border-top: 2px solid var(--border);
}

.comments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}
.comments-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
}
.comments-title-count {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-deep);
}
.comments-sort {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--ink-3);
}
.comments-sort-label { font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.sort-btn {
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--ink-3);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.sort-btn.active,
.sort-btn:hover { background: var(--green-soft); color: var(--green-deep); border-color: var(--green); }

/* ── comment list ── */
.comments-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 32px;
}
.comments-empty {
  color: var(--ink-3);
  font-style: italic;
  text-align: center;
  padding: 32px 0;
  font-size: 0.95rem;
}

/* ── individual comment ── */
.comment {
  display: flex;
  gap: 0;
  padding: 14px 0 4px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.comment:last-child { border-bottom: none; }

/* vote column */
.comment-vote-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 32px;
  padding-top: 2px;
  flex-shrink: 0;
}
.vote-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  transition: var(--transition);
  padding: 0;
}
.vote-btn svg { width: 14px; height: 14px; }
.vote-btn:hover { background: var(--green-soft); }
.vote-up:hover   { color: var(--green-deep); }
.vote-down:hover { color: var(--clay); }
.vote-up.active   { color: var(--green-deep); background: var(--green-soft); }
.vote-down.active { color: var(--clay);       background: var(--clay-soft); }
.vote-score {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-3);
  line-height: 1;
  min-width: 16px;
  text-align: center;
}
.vote-score.pos { color: var(--green-deep); }
.vote-score.neg { color: var(--clay); }

/* comment body column */
.comment-body-col {
  flex: 1;
  min-width: 0;
  padding-left: 10px;
}
.comment-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}
.comment-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  text-transform: uppercase;
}
.comment-name {
  font-weight: 700;
  color: var(--green-deep);
  font-size: 0.85rem;
}
.comment-flair {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--clay-soft);
  color: var(--clay);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.comment-time {
  color: var(--ink-3);
  font-size: 0.75rem;
}
.comment-text {
  color: var(--ink-2);
  font-size: 0.93rem;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin-bottom: 8px;
}

/* action bar */
.comment-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.action-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--ink-3);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.action-btn svg { width: 13px; height: 13px; flex-shrink: 0; }
.action-btn:hover { background: var(--green-soft); color: var(--green-deep); }
.action-btn.reply-btn:hover { background: var(--green-soft); color: var(--green-deep); }

/* thread line for replies */
.comment-children {
  position: relative;
  padding-left: 16px;
  margin-top: 6px;
}
.comment-children::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 12px;
  width: 2px;
  background: var(--border);
  border-radius: 2px;
  transition: background 0.2s;
}
.comment-children:hover::before { background: var(--green); }

/* collapse toggle */
.collapse-btn {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--ink-3);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.collapse-btn:hover { background: var(--border); color: var(--ink); }
.collapse-btn svg { width: 10px; height: 10px; transition: transform 0.2s; }
.comment.collapsed > .comment-body-col > .comment-children { display: none; }
.comment.collapsed .collapse-btn svg { transform: rotate(-90deg); }
.comment.collapsed .comment-text,
.comment.collapsed .comment-actions { display: none; }
.comment.collapsed .comment-head { opacity: 0.6; }

/* reply form */
.reply-form-wrap { margin-top: 10px; margin-bottom: 8px; }
.reply-form-wrap.hidden { display: none; }

/* ── new comment / reply form ── */
.comment-form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.comment-form-reply {
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: none;
  background: var(--paper);
  border: 1px solid var(--border);
  margin-top: 8px;
}
.comment-form.hidden { display: none; }
.comment-form-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.comment-form input[type="text"],
.comment-form textarea,
.reply-form-wrap input,
.reply-form-wrap textarea {
  font-family: inherit;
  font-size: 0.93rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  outline: none;
  transition: var(--transition);
  width: 100%;
  box-sizing: border-box;
}
.comment-form input[type="text"]:focus,
.comment-form textarea:focus,
.reply-form-wrap input:focus,
.reply-form-wrap textarea:focus {
  border-color: var(--green);
  background: var(--card);
  box-shadow: 0 0 0 3px rgba(63, 91, 80,0.08);
}
.comment-form textarea,
.reply-form-wrap textarea { min-height: 80px; resize: vertical; }
.comment-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.comment-form-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.char-count { color: var(--ink-3); font-size: 0.76rem; }
.comment-status { margin-top: 8px; font-size: 0.85rem; color: var(--ink-3); }
.comment-status.ok  { color: var(--green); font-weight: 600; }
.comment-status.err { color: var(--clay);  font-weight: 600; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover { background: transparent; border-color: var(--ink); color: var(--ink); }

/* dark mode overrides */
[data-theme="dark"] .comment-form,
[data-theme="dark"] .comment-form-reply,
[data-theme="dark"] .comment-form input,
[data-theme="dark"] .comment-form textarea,
[data-theme="dark"] .reply-form-wrap input,
[data-theme="dark"] .reply-form-wrap textarea {
  background: var(--paper-2);
  border-color: var(--border);
}

/* ═══════════════════════════════════════════════
   PROJECTS
════════════════════════════════════════════════ */
.projects-grid {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}
.project-card {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: var(--s-6) clamp(0px, 1.5vw, 16px);
  box-shadow: none;
  transition: background var(--transition), padding var(--transition);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.project-card:hover {
  transform: none;
  box-shadow: none;
  background: var(--green-soft);
  padding-left: clamp(8px, 2.5vw, 26px);
}
.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.project-badge {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--green-soft);
  color: var(--green-deep);
}
.project-badge.ongoing {
  background: var(--clay-soft);
  color: var(--clay);
}
.project-year { color: var(--ink-3); font-size: 0.8rem; }

/* Papers in progress */
.papers-block {
  margin-top: 32px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px;
  box-shadow: var(--shadow);
}
.papers-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--green-deep);
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.papers-list { display: flex; flex-direction: column; gap: 16px; }
.papers-list li { display: flex; flex-direction: column; gap: 3px; }
.papers-list strong {
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.45;
}
.paper-meta { font-size: 0.82rem; color: var(--ink-3); }
.project-card-title {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: clamp(1.6rem, 3.2vw, 2.2rem);
  font-weight: 500;
  color: var(--ink);
  line-height: 1.08;
  letter-spacing: -0.01em;
  transition: color var(--transition);
}
.project-card:hover .project-card-title { color: var(--green-deep); }
.project-card-desc {
  color: var(--ink-2);
  font-size: 0.92rem;
  line-height: 1.7;
}
.project-card-meta {
  color: var(--ink-3);
  font-size: 0.8rem;
  font-style: italic;
}
.project-card-link { cursor: pointer; }
.project-more {
  color: var(--green-deep);
  font-size: 0.86rem;
  font-weight: 600;
}
.project-card-link:hover .project-more { text-decoration: underline; }

/* ═══════════════════════════════════════════════
   RESUME
════════════════════════════════════════════════ */
.resume-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 38px;
  flex-wrap: wrap;
}
.resume-updated { color: var(--ink-3); font-size: 0.84rem; }

.resume-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 26px;
  align-items: start;
}

.resume-block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}
.resume-block-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--green-deep);
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.resume-entry { margin-bottom: 20px; }
.resume-entry:last-child { margin-bottom: 0; }
.resume-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 2px;
}
.resume-entry-header strong { font-size: 0.95rem; color: var(--ink); }
.resume-date {
  font-size: 0.76rem;
  color: var(--ink-3);
  white-space: nowrap;
}
.resume-entry-sub {
  font-size: 0.85rem;
  color: var(--clay);
  margin-bottom: 8px;
}
.resume-bullets { display: flex; flex-direction: column; gap: 5px; }
.resume-bullets li {
  font-size: 0.87rem;
  color: var(--ink-2);
  line-height: 1.6;
  padding-left: 14px;
  position: relative;
}
.resume-bullets li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--green);
}

.achievements-list { display: flex; flex-direction: column; gap: 12px; }
.achievement-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.89rem;
  color: var(--ink-2);
  line-height: 1.55;
}
.achievement-icon { flex-shrink: 0; }
.resume-skill-tags { gap: 8px; }

/* ═══════════════════════════════════════════════
   INTERESTS
════════════════════════════════════════════════ */
.interests-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.interest-card {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: none;
  transition: var(--transition);
}
.interest-card:hover {
  transform: none;
  box-shadow: none;
  background: var(--green-soft);
  border-color: var(--border-strong);
}
.interest-card.large { grid-column: span 2; }
.interest-icon { font-size: 1.7rem; line-height: 1; }
.interest-title {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.interest-desc {
  font-size: 0.86rem;
  color: var(--ink-2);
  line-height: 1.65;
}

/* ═══════════════════════════════════════════════
   FOOTER
════════════════════════════════════════════════ */
#site-footer {
  border-top: 1px solid var(--border);
  background: var(--paper-2);
}
.footer-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 26px clamp(20px, 5vw, 60px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.footer-logo {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  font-size: 0.95rem;
}
.footer-copy { color: var(--ink-3); font-size: 0.82rem; }
.footer-links { display: flex; gap: 18px; }
.footer-links a {
  color: var(--green-deep);
  font-size: 0.84rem;
  font-weight: 500;
}
.footer-links a:hover { text-decoration: underline; }

/* ── Floating résumé download button ── */
.fab-resume {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 900;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
}
.fab-resume:hover {
  background: var(--green-deep);
  transform: translateY(-2px);
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════ */
@media (max-width: 960px) {
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .about-photo-col {
    max-width: 280px;
    margin: 0 auto;
  }
  .resume-layout { grid-template-columns: 1fr; }
  .interests-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .blog-card { padding: 26px 24px; }
}

@media (max-width: 520px) {
  .interests-grid { grid-template-columns: 1fr; }
  .interest-card.large { grid-column: span 1; }
  .hero-cta { flex-direction: column; align-items: flex-start; }
  .projects-grid { grid-template-columns: 1fr; }
  .post-topbar { flex-direction: column; align-items: flex-start; }
}

/* Scrollbar + selection */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--paper-3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--green); }
::selection { background: rgba(63, 91, 80, 0.2); }


/* -----------------------------------------------
   EDITOR STYLES (restored from main)
---------------------------------------------- */

.post-actions { display: flex; align-items: center; gap: 12px; }

.save-status {
  font-size: 0.8rem;
  color: var(--ink-3);
  transition: color 0.2s;
}
.save-status.saved { color: var(--green); font-weight: 600; }

/* Toolbar */
.editor-toolbar {
  position: sticky;
  top: calc(var(--nav-h) + 10px);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px 8px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-lg);
}
.editor-toolbar.hidden { display: none; }

.tb-btn {
  min-width: 34px;
  height: 32px;
  padding: 0 8px;
  border: none;
  background: none;
  border-radius: 7px;
  color: var(--ink-2);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.tb-btn:hover { background: var(--green-soft); color: var(--green-deep); }
.tb-btn.active { background: var(--green); color: #fff; }
.tb-sep {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 5px;
}

/* Title + meta */
.post-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 5vw, 2.8rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 14px;
  outline: none;
}
.post-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-3);
  font-size: 0.86rem;
  margin-bottom: 36px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.meta-dot { opacity: 0.6; }

/* Article body typography */
.post-body {
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--ink);
  outline: none;
  min-height: 200px;
}
.post-body p { margin-bottom: 18px; }
.post-body h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  margin: 34px 0 14px;
}
.post-body h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 28px 0 12px;
}
.post-body ul, .post-body ol { margin: 0 0 18px 26px; }
.post-body ul { list-style: disc; }
.post-body ol { list-style: decimal; }
.post-body li { margin-bottom: 6px; }
.post-body blockquote {
  border-left: 3px solid var(--green);
  background: var(--green-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 20px;
  margin: 0 0 18px;
  color: var(--ink-2);
  font-style: italic;
}
.post-body a {
  color: var(--green-deep);
  text-decoration: underline;
  text-decoration-color: rgba(63, 91, 80, 0.4);
  text-underline-offset: 3px;
}
.post-body a:hover { text-decoration-color: var(--green); }

/* Editing state */
.editing .post-title,
.editing .post-body {
  border-radius: var(--radius-sm);
  transition: background var(--transition), box-shadow var(--transition);
}
.editing .post-title { padding: 4px 8px; margin-left: -8px; }
.editing .post-body  { padding: 8px 12px; margin-left: -12px; }
.editing .post-title:hover, .editing .post-body:hover { background: var(--paper-2); }
.editing .post-title:focus, .editing .post-body:focus {
  background: var(--card);
  box-shadow: 0 0 0 1.5px rgba(63, 91, 80, 0.35);
}

/* Placeholders for empty editable areas */
.post-title:empty::before,
.post-body:empty::before {
  content: attr(data-placeholder);
  color: var(--ink-3);
  pointer-events: none;
  display: block;
}

/* Editor footer */
.editor-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.editor-footer.hidden { display: none; }
.word-count { color: var(--ink-3); font-size: 0.84rem; }
.editor-footer-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.restore-label { display: inline-flex; align-items: center; }

@media (max-width: 768px) {
  .editor-toolbar { top: calc(var(--nav-h) + 6px); }
}

/* ═══════════════════════════════════════════════
   DARK MODE
═══════════════════════════════════════════════ */
[data-theme="dark"] {
  --paper:      #0b0b0c;   /* moody near-black (dashcreative-style) */
  --paper-2:    #131315;
  --paper-3:    #070708;
  --ink:        #f4f1ea;   /* warm off-white */
  --ink-2:      #aeaaa2;
  --ink-3:      #87837b;   /* muted — AA on near-black */
  --green:      #9ec2b1;   /* evergreen, lightened for AA on dark */
  --green-deep: #bcd6c9;
  --green-soft: rgba(158, 194, 177, 0.12);
  --clay:       #c8a884;   /* quiet warm secondary */
  --clay-soft:  rgba(200, 168, 132, 0.14);
  --card:       #161618;   /* elevated surface */
  --nav-bg:     rgba(11, 11, 12, 0.78);
  --border:     rgba(230, 224, 212, 0.12);
  --border-strong: rgba(230, 224, 212, 0.22);
  --shadow:     0 2px 12px rgba(0, 0, 0, 0.40);
  --shadow-lg:  0 18px 48px rgba(0, 0, 0, 0.55);
}

[data-theme="dark"] body::before {
  background:
    radial-gradient(ellipse 50% 40% at 12% 4%, rgba(158, 194, 177, 0.05), transparent 70%),
    radial-gradient(ellipse 46% 40% at 96% 96%, rgba(200, 140, 70, 0.045), transparent 70%),
    var(--paper);
}
/* Hero ambient glow on dark — echoes dashcreative's warm light blob (CSS only) */
[data-theme="dark"] #home::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(38% 46% at var(--mx, 70%) var(--my, 42%), rgba(214, 120, 52, 0.18), rgba(158,194,177,0.05) 45%, transparent 72%);
  filter: blur(6px);
}

[data-theme="dark"] .nav-logo,
[data-theme="dark"] .section-title,
[data-theme="dark"] .project-card-title,
[data-theme="dark"] .interest-title,
[data-theme="dark"] .post-title { color: var(--ink); }

[data-theme="dark"] .hero-name em { color: var(--green); }

[data-theme="dark"] .blog-card,
[data-theme="dark"] .project-card,
[data-theme="dark"] .resume-entry,
[data-theme="dark"] .interest-card,
[data-theme="dark"] .spec-table,
[data-theme="dark"] .status-note,
[data-theme="dark"] .meta-bar,
[data-theme="dark"] .comments-section,
[data-theme="dark"] .comment,
[data-theme="dark"] .comment-form,
[data-theme="dark"] .comment-form input,
[data-theme="dark"] .comment-form textarea,
[data-theme="dark"] .reply-form-wrap input,
[data-theme="dark"] .reply-form-wrap textarea {
  background: var(--paper-2);
  border-color: var(--border);
}

[data-theme="dark"] .tag { background: var(--green-soft); color: var(--green); }

[data-theme="dark"] .fab-resume { background: var(--green); color: #111; }

/* Dark mode: green is a bright mint, so white text on it fails contrast.
   Use near-black text on every green-filled surface instead. */
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-primary:hover,
[data-theme="dark"] .chat-header,
[data-theme="dark"] .chat-send,
[data-theme="dark"] .chat-fab,
[data-theme="dark"] .fab-resume,
[data-theme="dark"] .skip-link,
[data-theme="dark"] .chat-msg.user,
[data-theme="dark"] .chat-chip:hover,
[data-theme="dark"] .tb-btn.active { color: #0f1210; }
[data-theme="dark"] .chat-icon-btn { color: rgba(15, 18, 16, 0.7); }
[data-theme="dark"] .chat-icon-btn:hover { color: #0f1210; }

[data-theme="dark"] ::-webkit-scrollbar-track { background: var(--paper); }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: var(--paper-3); }
[data-theme="dark"] ::selection { background: rgba(54, 197, 214, 0.25); }

[data-theme="dark"] .editing .post-title:focus,
[data-theme="dark"] .editing .post-body:focus {
  background: var(--paper-2);
  box-shadow: 0 0 0 1.5px rgba(54, 197, 214, 0.35);
}

[data-theme="dark"] .editor-toolbar {
  background: var(--paper-2);
  border-color: var(--border);
}

[data-theme="dark"] .tb-btn:hover { background: var(--green-soft); color: var(--green); }
[data-theme="dark"] .tb-btn.active { background: var(--green); color: #111; }

[data-theme="dark"] .about-photo-img { filter: brightness(0.95) contrast(1.05); }

/* ═══════════════════════════════════════════════
   THEME TOGGLE BUTTON
═══════════════════════════════════════════════ */
.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--paper);
  font-size: 1.05rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.theme-toggle:hover {
  border-color: var(--green);
  transform: rotate(15deg) scale(1.08);
  box-shadow: 0 2px 10px rgba(63, 91, 80, 0.15);
}

/* ═══════════════════════════════════════════════
   SKIP LINK (accessibility)
═══════════════════════════════════════════════ */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  padding: 8px 16px;
  background: var(--green);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 8px;
  z-index: 9999;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 8px;
  outline: 3px solid var(--clay);
  outline-offset: 2px;
}

/* ═══════════════════════════════════════════════
   HERO WAVES
═══════════════════════════════════════════════ */
.hero-waves {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  overflow: hidden;
  pointer-events: none;
}
.hero-waves svg {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 120px;
}
.wave-front { fill: var(--green-soft); z-index: 2; }
.wave-back  { fill: var(--paper-2); opacity: 0.5; z-index: 1; }

[data-theme="dark"] .wave-front { fill: rgba(54, 197, 214, 0.06); }
[data-theme="dark"] .wave-back  { fill: rgba(255, 255, 255, 0.02); }

/* ═══════════════════════════════════════════════
   LIKE / SHARE BUTTONS
═══════════════════════════════════════════════ */
.post-engage {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
}
.engage-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--ink-2);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
}
.engage-btn:hover {
  border-color: var(--green);
  color: var(--green-deep);
  background: var(--green-soft);
  transform: translateY(-1px);
}
.engage-btn.liked {
  border-color: #e85d75;
  color: #e85d75;
  background: rgba(232, 93, 117, 0.08);
}

/* ═══════════════════════════════════════════════
   CHAT WIDGET
═══════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════
   CHAT WIDGET — matches chat.js class names
═══════════════════════════════════════════════ */

.chat-widget { position: fixed; bottom: 0; right: 0; z-index: 9999; pointer-events: none; }

/* FAB button — floating, always visible */
.chat-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--green-deep));
  color: #fff;
  font-size: 1.45rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(63, 91, 80, 0.38);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: all;
}
.chat-fab:hover {
  transform: scale(1.1) rotate(-6deg);
  box-shadow: 0 6px 28px rgba(63, 91, 80, 0.5);
}
.chat-fab.bounce {
  animation: fabBounce 0.5s ease;
}
@keyframes fabBounce {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.2) rotate(-8deg); }
  70%  { transform: scale(0.95); }
  100% { transform: scale(1); }
}

/* Chat panel — slides up from bottom-right */
.chat-panel {
  position: fixed;
  bottom: 92px;
  right: 24px;
  width: 380px;
  max-height: 540px;
  background: var(--paper);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: all;
}
.chat-panel.hidden { display: none; }
.chat-panel.open   { display: flex; animation: chatSlideUp 0.28s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes chatSlideUp {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header bar */
.chat-header {
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--green), var(--green-deep));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}
.chat-title    { font-weight: 700; font-size: 0.95rem; }
.chat-sub      { font-size: 0.74rem; opacity: 0.8; font-weight: 400; }
.chat-header-btns { display: flex; gap: 4px; }
.chat-icon-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.75);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  line-height: 1;
  transition: all 0.15s;
}
.chat-icon-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }

/* Messages area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 180px;
  max-height: 340px;
  scroll-behavior: smooth;
}
.chat-msg {
  max-width: 82%;
  padding: 9px 13px;
  border-radius: 16px;
  font-size: 0.875rem;
  line-height: 1.6;
  word-wrap: break-word;
}
.chat-msg.bot {
  background: var(--paper-2);
  color: var(--ink);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}
.chat-msg.user {
  background: var(--green);
  color: #fff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}
.chat-foot {
  padding: 8px 14px;
  font-size: 0.72rem;
  color: var(--ink-3);
  text-align: center;
  border-top: 1px solid var(--border);
  background: var(--paper-2);
  flex-shrink: 0;
}
.chat-foot a { color: var(--green-deep); }

/* Typing indicator */
.chat-typing { display: flex; gap: 4px; padding: 10px 14px; }
.chat-typing span {
  width: 7px; height: 7px;
  background: var(--ink-3);
  border-radius: 50%;
  display: block;
  animation: typingDot 1.2s infinite ease-in-out;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30%            { transform: translateY(-6px); opacity: 1; }
}

/* Suggestion chips */
.chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 14px 4px;
  flex-shrink: 0;
}
.chat-chip {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--green);
  background: transparent;
  color: var(--green-deep);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.chat-chip:hover {
  background: var(--green);
  color: #fff;
  transform: translateY(-1px);
}

/* Input row */
.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--paper-2);
  flex-shrink: 0;
}
.chat-input-row input {
  flex: 1;
  padding: 9px 14px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.86rem;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}
.chat-input-row input:focus { border-color: var(--green); }
.chat-input-row input::placeholder { color: var(--ink-3); }
.chat-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--green);
  color: #fff;
  cursor: pointer;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.chat-send:hover { background: var(--green-deep); transform: scale(1.07); }

/* Mobile */
@media (max-width: 480px) {
  .chat-panel { right: 10px; left: 10px; width: auto; bottom: 82px; }
  .chat-fab   { bottom: 16px; right: 16px; }
}
/* ── Partner badge link — prominent inline link ── */
.partner-badge-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--green-deep);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid var(--green);
  padding-bottom: 1px;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.partner-badge-link:hover {
  color: var(--green);
  border-bottom-color: transparent;
  background: var(--green-soft);
  padding: 3px 8px;
  border-radius: 6px;
  border-bottom: none;
  transform: translateX(2px);
}

/* ── Project meta bar (kymarion page) ── */
.project-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  background: var(--paper-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 36px;
}
.meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-right: 1px solid var(--border);
}
.meta-item:last-child { border-right: none; }
.meta-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  white-space: nowrap;
}
.meta-value {
  font-size: 0.9rem;
  color: var(--ink);
  font-weight: 500;
}
.meta-value a { color: var(--green-deep); font-weight: 600; }
.meta-value a:hover { color: var(--green); }

@media (max-width: 600px) {
  .project-meta-bar { flex-direction: column; }
  .meta-item { border-right: none; border-bottom: 1px solid var(--border); }
  .meta-item:last-child { border-bottom: none; }
}
[data-theme="dark"] .project-meta-bar {
  background: var(--paper-2);
  border-color: var(--border);
}
[data-theme="dark"] .meta-label { color: var(--ink-3); }
[data-theme="dark"] .meta-value { color: var(--ink); }
[data-theme="dark"] .partner-badge-link:hover {
  background: var(--green-soft);
}
/* ═══════════════════════════════════════════════
   SOUNDINGS — hero signature (overrides)
════════════════════════════════════════════════ */
#home { position: relative; overflow: hidden; }
.hero-sonar {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  background: transparent;       /* insurance: never paint a solid fill */
  pointer-events: none;          /* clicks pass through to buttons */
  opacity: 0.85;                 /* the rotating globe is the hero focal model */
}
.hero-frame { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.hero-coord {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  opacity: 0.85;
}
.hero-coord.tl { top: calc(var(--nav-h) + 18px); left: clamp(20px, 6vw, 64px); }
.hero-coord.tr { top: calc(var(--nav-h) + 18px); right: clamp(20px, 6vw, 64px); }
.hero-coord.bl { bottom: 26px; left: clamp(20px, 6vw, 64px); }
.hero-coord.br { bottom: 26px; right: clamp(20px, 6vw, 64px); }

.hero-container { position: relative; z-index: 2; }

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-3);
  margin-bottom: 26px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.hero-eyebrow::before {
  content: '';
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 var(--green);
  animation: heroPing 2.6s ease-out infinite;
}
@keyframes heroPing {
  0%   { box-shadow: 0 0 0 0 rgba(63,91,80,0.45); }
  70%  { box-shadow: 0 0 0 7px rgba(63,91,80,0); }
  100% { box-shadow: 0 0 0 0 rgba(63,91,80,0); }
}
[data-theme="dark"] .hero-eyebrow::before { background: var(--green); }

.hero-name {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: var(--text-hero);
  font-weight: 450;
  line-height: 1.0;
  letter-spacing: -0.025em;
  margin-bottom: 26px;
  color: var(--ink);
}
.hero-name em {
  font-style: italic;
  font-weight: 450;
  color: var(--green-deep);                 /* italic accent on the key word */
}

.hero-readout {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ink-2);
  letter-spacing: 0.02em;
}
.hero-readout b { color: var(--green-deep); font-weight: 600; margin-right: 4px; }
.hero-readout-sep { width: 1px; height: 14px; background: var(--border-strong); }

@media (max-width: 720px) {
  .hero-coord.tr, .hero-coord.br { display: none; }
  .hero-sonar { opacity: 0.7; }
}
/* Small phones: keep the hero headline + mono eyebrow from overflowing
   (the page clips horizontal overflow, so oversized text gets cut at the edge). */
@media (max-width: 480px) {
  .hero-name { font-size: clamp(1.7rem, 8.2vw, 2.35rem); }
  .hero-eyebrow {
    font-size: 0.64rem;
    letter-spacing: 0.07em;
    flex-wrap: wrap;
    max-width: 100%;
  }
  .hero-readout { font-size: 0.68rem; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-eyebrow::before { animation: none; }
}

/* ═══════════════════════════════════════════════
   SOUNDINGS — pass 3: instrument framing + scannable research
════════════════════════════════════════════════ */
/* Section eyebrows are now meaningful mono labels, not decorative numbers */
.section-number { font-family: var(--font-mono); text-transform: uppercase; }

/* Mono for all data-ish labels (dates, years, citations) — instrument feel */
.project-year, .paper-meta, .resume-date, .resume-updated, .blog-date { font-family: var(--font-mono); }

/* Research case-study preview cards */
.project-summary {
  font-size: 1.06rem;
  line-height: 1.55;
  color: var(--ink);
  font-weight: 500;
  margin: 6px 0 14px;
}
.project-specs {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px;
  padding: 0;
}
.project-specs li {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-2);
  background: var(--green-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 9px;
}
.project-more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--green-deep);
  transition: gap var(--transition);
}
.project-card-link:hover .project-more { gap: 10px; }

/* Restraint: the hero status dot stays lit but doesn't ping —
   the canvas sonar ping is the single signature motion. */
.hero-eyebrow::before { animation: none; }

/* ═══════════════════════════════════════════════
   SOUNDINGS — pass 4: hero load-reveal cascade
════════════════════════════════════════════════ */
@keyframes heroRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
#home.active .hero-eyebrow { animation: heroRise 0.6s ease both 0.05s; }
#home.active .hero-name    { animation: heroRise 0.7s ease both 0.16s; }
#home.active .hero-tagline { animation: heroRise 0.7s ease both 0.30s; }
#home.active .hero-cta     { animation: heroRise 0.7s ease both 0.42s; }
#home.active .hero-readout { animation: heroRise 0.7s ease both 0.52s; }
#home.active .hero-frame   { animation: heroRise 1s ease both 0.7s; }
@media (prefers-reduced-motion: reduce) {
  #home.active .hero-eyebrow, #home.active .hero-name, #home.active .hero-tagline,
  #home.active .hero-cta, #home.active .hero-readout, #home.active .hero-frame { animation: none; }
}

/* ═══════════════════════════════════════════════
   EDITORIAL MOTION — scroll reveal + magnetic nav (added v17)
   All gated on prefers-reduced-motion.
════════════════════════════════════════════════ */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s cubic-bezier(.22,.61,.36,1), transform 0.7s cubic-bezier(.22,.61,.36,1); will-change: opacity, transform; }
  .reveal.reveal-in { opacity: 1; transform: none; }
}

/* Magnetic nav label: a clipped window with the label + a duplicate that slide on hover */
.nav-magnetic {
  position: relative;
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}
.nav-magnetic > span { display: block; transition: transform 0.42s cubic-bezier(.6,.05,.1,1); }
.nav-magnetic::after {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0;
  transform: translateY(110%);
  transition: transform 0.42s cubic-bezier(.6,.05,.1,1);
}
.nav-link:hover .nav-magnetic > span,
.drawer-link:hover .nav-magnetic > span { transform: translateY(-110%); }
.nav-link:hover .nav-magnetic::after,
.drawer-link:hover .nav-magnetic::after { transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .nav-magnetic { overflow: visible; }
  .nav-magnetic > span { transition: none; }
  .nav-magnetic::after { display: none; }
}

/* ═══════════════════════════════════════════════
   DASHCREATIVE-STYLE TYPE PAIRING (v18)
   Upright headlines = light grotesque (Inter 300);
   emphasis words = high-contrast serif italic (Fraunces).
════════════════════════════════════════════════ */
.hero-name { font-weight: 300; letter-spacing: -0.03em; }
.section-title { font-weight: 300; letter-spacing: -0.025em; }
.project-card-title, .blog-card-title { font-weight: 350; letter-spacing: -0.02em; }
.interest-title { font-weight: 400; letter-spacing: -0.01em; }
.sa-dash-title, .sa-panel-head h4, .db-title, .db-section { font-weight: 400; }
.section-heading, .project-title { font-weight: 350 !important; letter-spacing: -0.02em; }

.hero-name em,
.section-title em,
.project-card-title em,
.blog-card-title em,
h1 em, h2 em, h3 em {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
}
