/* ══════════════════════════════════════════
   HOME PAGE ONLY (index.html)
   Shared components (cards, buttons, tags, pub rows, news, people list,
   CTA, social links) live in site.css; this file holds the hero, the
   about/stats grid, card grids and inner card layouts, the course
   highlight + terminal, and the contact grid.
   ══════════════════════════════════════════ */

/* ── HERO ── */
.hero {
  position: relative;
  overflow: hidden;
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
  display: flex; flex-direction: column; justify-content: center;
  padding: 4rem var(--gutter) 5rem;
}
.hero-grid {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  grid-template-rows: auto 1fr;
  grid-template-areas: "main card" "main aside";
  column-gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}
.hero-main { grid-area: main; min-width: 0; align-self: center; }
.hero-card { grid-area: card; }
.hero-aside { grid-area: aside; }

.hero-eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 1.25rem;
}
.hero-name {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 6vw, 5.2rem);
  font-weight: 400;
  line-height: 1.05;
  color: var(--text);
  margin-bottom: 1rem;
}
.hero-name em { font-style: italic; color: var(--gold); }
.hero-role {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  line-height: 1.4;
  color: var(--text);
  margin-bottom: 0.6rem;
}
.hero-affil {
  display: flex; flex-wrap: wrap; gap: 0.35rem 1.25rem;
  font-size: 0.88rem; color: var(--muted);
  margin-bottom: 1.75rem;
}
.hero-affil-line { display: inline-flex; align-items: flex-start; gap: 0.55rem; }
.hero-affil-line .dot { margin-top: 0.6em; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); flex-shrink: 0; }
.dot.teal { background: var(--teal); }
.hero-desc {
  font-size: 1rem;
  color: var(--muted);
  max-width: 34rem;
  line-height: 1.8;
  margin-bottom: 1.75rem;
}
.hero-tags { margin-bottom: 2rem; }
.hero-social { margin-bottom: 1.75rem; }

/* Photo card (desktop: right column, joined with .hero-aside into one card) */
.hero-card, .hero-aside {
  border: 1px solid var(--line);
  background: var(--bg3);
  box-shadow: var(--card-shadow);
  padding: 2rem;
  position: relative;
}
.hero-card { border-bottom: none; padding-bottom: 1.25rem; }
.hero-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--teal));
}
.hero-aside { border-top: none; padding-top: 0; }
.hero-photo {
  width: 168px; height: 168px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 22%;
  border: 3px solid var(--gold-line);
  background: var(--bg2);
  margin-bottom: 1.25rem;
}
.hc-name { font-family: var(--serif); font-size: 1.15rem; line-height: 1.3; margin-bottom: 0.3rem; color: var(--text); }
.hc-pos { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); letter-spacing: 0.06em; }
.hc-focus { border-top: 1px solid var(--line); padding-top: 1.1rem; }
.hc-focus-label, .prospective-label {
  font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 0.4rem;
}
.hc-focus-text { font-size: 0.85rem; color: var(--text); line-height: 1.6; }
.prospective {
  margin-top: 1.25rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--gold-line);
  border-left: 3px solid var(--gold);
  background: var(--gold-dim);
}
.prospective-label { color: var(--gold); }
.prospective-text { font-size: 0.84rem; color: var(--text); line-height: 1.6; margin-bottom: 0.6rem; }
.prospective-link { font-size: 0.78rem; color: var(--gold); }

/* Background decoration (faint; even fainter in the light theme) */
.hero-deco, .hero-deco2 { position: absolute; border-radius: 50%; pointer-events: none; }
.hero-deco {
  width: 600px; height: 600px; top: -100px; right: -200px;
  background: radial-gradient(circle, rgba(212,168,83,0.05) 0%, transparent 70%);
}
.hero-deco2 {
  width: 400px; height: 400px; bottom: 0; left: -100px;
  background: radial-gradient(circle, rgba(75,168,154,0.05) 0%, transparent 70%);
}
.hero-grid-lines {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 80px 80px;
  -webkit-mask-image: radial-gradient(ellipse at 70% 50%, black 20%, transparent 70%);
  mask-image: radial-gradient(ellipse at 70% 50%, black 20%, transparent 70%);
}
:root[data-theme="light"] .hero-grid-lines { opacity: 0.6; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .hero-grid-lines { opacity: 0.6; }
}

/* ── ABOUT ── */
.about-grid {
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: clamp(2.5rem, 6vw, 5rem);
  max-width: 1100px;
}
.about-body { font-size: 1rem; color: var(--muted); line-height: 1.85; }
.about-body p { margin-bottom: 1.25rem; }
.about-cta { margin-top: 2rem; }
.about-stats { list-style: none; display: flex; flex-direction: column; gap: 1.25rem; }
.about-stats .stat-number, .about-stats .stat-label { display: block; }
.stat-link { display: block; color: inherit; text-decoration: none; }
.stat-link:hover .stat-label { color: var(--gold); }
.stat-card:has(.stat-link:hover) { border-color: var(--gold-line); }
.about-side .stat-note { margin-top: 0.9rem; }

/* ── CARD GRIDS ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 1.5rem;
  max-width: 1100px;
}
.interests-grid { margin-bottom: 4rem; }

/* Inner layout of .project-card (outer card in site.css) */
.project-header {
  padding: 1.5rem 1.75rem 1.25rem;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
}
.project-icon {
  width: 42px; height: 42px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  background: var(--gold-dim);
  border: 1px solid var(--gold-line);
}
.project-status {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.65rem;
  border: 1px solid;
  border-radius: 2px;
  white-space: nowrap;
}
.status-active   { border-color: var(--teal-line); color: var(--teal); background: var(--teal-dim); }
.status-ongoing  { border-color: var(--gold-line); color: var(--gold); background: var(--gold-dim); }
.status-complete { border-color: var(--line-strong); color: var(--muted); background: transparent; }
.project-body { padding: 1.5rem 1.75rem; flex: 1; display: flex; flex-direction: column; gap: 0.75rem; }
.project-title { font-family: var(--serif); font-size: 1.05rem; font-weight: 400; line-height: 1.35; color: var(--text); }
.project-desc  { font-size: 0.84rem; color: var(--muted); line-height: 1.7; flex: 1; }
.project-tags  { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.project-tags .tag { font-size: 0.75rem; padding: 0.15rem 0.6rem; }
.project-footer {
  padding: 1rem 1.75rem;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem 1rem;
}
.project-collab { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.06em; color: var(--muted); }
.project-links { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* ── RESEARCH: selected publications ── */
#research .sub-label { max-width: 1100px; }
.pub-more {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem;
  margin-top: 2rem; max-width: 1100px;
}
.pub-more .text-link { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.06em; }

/* ── TEACHING ── */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 1.5rem;
  max-width: 1100px;
}
.course-card { display: flex; flex-direction: column; }
.course-body { flex: 1; display: flex; flex-direction: column; }
.course-desc { flex: 1; }
.course-links { margin-top: 1.25rem; }
.course-info-item {
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--line-strong);
}
.also-taught {
  max-width: 1100px;
  margin-top: 1.75rem;
  font-size: 0.85rem; color: var(--muted); line-height: 1.8;
}
.also-taught-label {
  font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--teal);
  margin-right: 0.75rem;
}
.also-taught-item { color: var(--text); }
.also-taught-years { color: var(--muted); }

/* Course highlight (site-v1 .llm-card) */
.highlight-card {
  margin-top: 4rem; max-width: 1100px;
  border: 1px solid var(--gold-line);
  background-color: var(--bg3);
  background-image: linear-gradient(135deg, color-mix(in srgb, var(--gold) 4%, var(--bg3)), color-mix(in srgb, var(--teal) 4%, var(--bg3)));
  box-shadow: var(--card-shadow);
  padding: clamp(1.5rem, 4vw, 3rem);
  position: relative;
  overflow: hidden;
}
.highlight-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--teal));
}
.highlight-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3rem; align-items: center; }
.highlight-title { font-family: var(--serif); font-size: clamp(1.4rem, 3vw, 1.8rem); font-weight: 400; line-height: 1.3; margin-bottom: 1rem; color: var(--text); }
.highlight-title em { color: var(--gold); }
.highlight-desc { font-size: 0.9rem; color: var(--muted); line-height: 1.75; margin-bottom: 1.25rem; }
.highlight-topics { list-style: none; margin-bottom: 1.25rem; }
.highlight-topics li {
  display: flex; align-items: baseline; gap: 0.6rem;
  font-size: 0.84rem; color: var(--muted);
  padding: 0.4rem 0; border-bottom: 1px solid var(--line);
}
.highlight-topics li::before { content: '→'; color: var(--gold); font-family: var(--mono); flex-shrink: 0; }
.highlight-topics li:last-child { border-bottom: none; }
.highlight-link { font-size: 0.85rem; }

.terminal {
  background: var(--code-bg);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.8;
  overflow: hidden;
  min-width: 0;
}
.terminal-bar {
  background: var(--bg2);
  padding: 0.5rem 1rem;
  display: flex; align-items: center; gap: 0.5rem;
  border-bottom: 1px solid var(--line);
}
.terminal-dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-red { background: var(--red); }
.dot-gold { background: var(--gold); }
.dot-teal { background: var(--teal); }
.terminal-file { font-size: 0.75rem; color: var(--muted); margin-left: 0.5rem; }
.terminal-body { padding: 1.25rem; overflow-x: auto; }
.t-line { display: flex; white-space: pre-wrap; }
.t-prompt { color: var(--teal); margin-right: 0.5rem; flex-shrink: 0; }
.t-cmd { color: var(--text); }
.t-teal { color: var(--teal); }
.t-out { color: var(--muted); padding-left: 1.2rem; }
.t-gold { color: var(--gold); }
.t-answer { color: var(--text); font-style: italic; }
.t-blank { height: 0.4rem; }

/* ── PEOPLE ── */
.people-group-count { color: var(--muted); letter-spacing: 0.06em; }
.person-id { min-width: 0; }
.person-work { min-width: 0; }
.person-paper {
  font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.06em;
  color: var(--gold); text-decoration: none;
  margin-left: 0.35rem;
}
.person-paper:hover { text-decoration: underline; }
.people-cta { margin-top: 1rem; }

/* Old-link aliases (#courses, #mentees) sit directly above their section */
.anchor-alias { display: block; height: 0; overflow: hidden; }

/* ── CONTACT ── */
.contact-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2.5rem, 6vw, 5rem);
  max-width: 1000px; align-items: start;
}
.contact-intro { font-size: 1rem; color: var(--muted); line-height: 1.8; margin-bottom: 2rem; }
.contact-items { list-style: none; display: flex; flex-direction: column; gap: 1rem; }
.contact-item-text { display: flex; flex-direction: column; min-width: 0; }
.contact-item-icon--teal { color: var(--teal); background: var(--teal-dim); border-color: var(--teal-line); }
.contact-note {
  font-size: 0.85rem; color: var(--muted); line-height: 1.7;
  padding: 1.5rem;
  border: 1px solid var(--line);
  background: var(--bg3);
  box-shadow: var(--card-shadow);
}
.contact-note-title { font-family: var(--serif); font-size: 1.1rem; font-weight: 400; color: var(--text); margin-bottom: 1rem; }
.contact-note p { margin-bottom: 0.75rem; }
.contact-note-list { list-style: none; font-size: 0.85rem; line-height: 2; }
.contact-note-list li { display: flex; gap: 0.5rem; }
.contact-note-list li::before { content: '→'; color: var(--gold); flex-shrink: 0; }
.contact-note-cta { margin-top: 1.5rem; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .hero {
    min-height: 0;
    padding-top: 2.5rem; padding-bottom: 4rem;
  }
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    grid-template-areas: "card" "main" "aside";
  }
  /* Phone/tablet: the photo sits above the name; the name/position repeat is dropped. */
  .hero-card {
    border: none; background: none; box-shadow: none; padding: 0;
    margin-bottom: 1.5rem;
  }
  .hero-card::before, .hero-card .hc-text { display: none; }
  .hero-photo { width: 144px; height: 144px; margin-bottom: 0; }
  .hero-aside { border-top: 1px solid var(--line); padding-top: 1.5rem; margin-top: 2.5rem; }
  .hc-focus { border-top: none; padding-top: 0; }
  .hero-deco { width: 380px; height: 380px; right: -180px; }

  .about-grid, .contact-grid, .highlight-inner { grid-template-columns: minmax(0, 1fr); }
  .highlight-inner { gap: 2rem; }
  .about-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
}
@media (max-width: 700px) {
  /* Phone: keep the social links and CTAs within the first screen; the
     interest tags move below the CTAs (visual order only; DOM order unchanged). */
  .hero-main { display: flex; flex-direction: column; }
  .hero-tags { order: 2; margin-top: 1.75rem; margin-bottom: 0; }
  .hero-photo { width: 112px; height: 112px; }
  .project-header, .project-body, .project-footer { padding-left: 1.4rem; padding-right: 1.4rem; }
  .interests-grid { margin-bottom: 3rem; }
}
@media (max-width: 380px) {
  .about-stats { grid-template-columns: minmax(0, 1fr); }
  .stat-card { padding: 1rem 1.25rem; }
  .terminal { font-size: 0.75rem; }
  .terminal-body { padding: 1rem; }
  .t-out { padding-left: 0.6rem; }
}
@media print {
  .hero { min-height: 0; }
  .hero-deco, .hero-deco2, .hero-grid-lines, .terminal { display: none; }
}
