:root {
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, 'Noto Sans', 'Liberation Sans', sans-serif;
  --color-text: #222;
  --color-muted: #555;
  --accent: #c5050c;
  --border: #dcdcdc;
  --bg: #fafafa;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--bg);
  line-height: 1.6;
}

/* Font family overrides via body classes */
body.font-serif {
  --font-body: Georgia, 'Times New Roman', Times, serif;
}

body.font-mono {
  --font-body: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}

html {
  scroll-behavior: smooth;
}

.page {
  max-width: 980px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  background: #fff;
  transition: opacity 180ms ease, filter 180ms ease;
}

/* Smooth visual easing during font swap */
body.font-swap .page {
  opacity: 0.6;
  filter: saturate(0.95);
}

.top-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0 0 2rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0));
  border: 1px solid var(--border);
  border-radius: 10px;
}

.top-tabs a {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--color-muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.top-tabs a:hover,
.top-tabs a:focus {
  color: var(--accent);
  border-color: rgba(197, 5, 12, 0.25);
  background: rgba(197, 5, 12, 0.08);
  outline: none;
}

.top-tabs a:focus-visible {
  box-shadow: 0 0 0 3px rgba(197, 5, 12, 0.25);
}

.intro {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2rem;
  margin-bottom: 2.5rem;
}

.intro-left {
  flex: 0 0 240px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.profile-photo {
  width: 220px;
  height: 220px;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.intro-right {
  flex: 1 1 320px;
  min-width: 280px;
}

.intro-right h1 {
  margin: 0;
  font-size: clamp(2rem, 3.5vw, 2.6rem);
}

.pronounce {
  margin: 0.4rem 0 1rem;
  color: var(--color-muted);
  font-style: italic;
}

.role {
  margin: 0 0 1.5rem;
}

.role a {
  color: var(--color-text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.role a:hover,
.role a:focus {
  border-color: var(--accent);
}

.contact-block {
  margin: 0 0 1rem;
}

.contact-block a {
  color: var(--accent);
  text-decoration: none;
}

.contact-block a:hover,
.contact-block a:focus {
  text-decoration: underline;
}

.updated {
  margin-top: 1.5rem;
  color: var(--color-muted);
  font-size: 0.9rem;
}

/* Font picker (top-right) */
.font-picker {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 1000;
  display: flex;
  gap: 6px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(0,0,0,0.06);
}

.font-picker .fp-option { display: none; }
.font-picker .fp-option.active { display: inline-flex; }
.font-picker:hover .fp-option,
.font-picker:focus-within .fp-option { display: inline-flex; }

.fp-option {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid transparent;
  background: transparent;
  padding: 8px 10px;
  border-radius: 10px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
}

.fp-option:hover,
.fp-option:focus-visible {
  border-color: rgba(0,0,0,0.08);
  outline: none;
}

.fp-option.active {
  background: rgba(0,0,0,0.05);
  border-color: rgba(0,0,0,0.08);
}

.fp-sample {
  font-size: 22px;
  line-height: 1;
  color: var(--color-text);
}

.fp-label {
  font-size: 12px;
  color: var(--color-muted);
}

.fp-option.active .fp-sample {
  color: #1976d2; /* subtle blue accent for active sample */
}

/* Ensure the sample previews stay true regardless of current page font */
.fp-sample.sans { font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, 'Noto Sans', 'Liberation Sans', sans-serif; }
.fp-sample.serif { font-family: Georgia, 'Times New Roman', Times, serif; }
.fp-sample.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace; }

@media (max-width: 720px) {
  .font-picker {
    top: 8px;
    right: 8px;
    padding: 4px;
    gap: 4px;
  }
  .fp-option { padding: 6px 8px; }
  .fp-sample { font-size: 18px; }
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .page { transition: none !important; }
}

.main h2 {
  margin: 0 0 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 1.6rem;
}

.main section:first-of-type h2 {
  border-top: none;
  padding-top: 0;
}

.main p {
  margin: 0 0 1rem;
}

.note {
  font-size: 0.9rem;
  color: var(--color-muted);
  margin-top: -0.25rem;
}

strong {
  font-weight: 600;
}

/* (removed talks-specific box styling for minimalist list) */

/* Ensure italic and bold semantics render consistently */
em,
i {
  font-style: italic;
}

b {
  font-weight: 600;
}

/* Subtle meta text can be italic */
.updated,
.note {
  font-style: italic;
}

@media (max-width: 720px) {
  .page {
    padding: 1.75rem 1.1rem 3rem;
  }

  .top-tabs {
    gap: 0.5rem;
    padding: 0.6rem 0.7rem;
  }

  .intro {
    justify-content: center;
  }

  .intro-left {
    flex: 1 1 180px;
  }

  .profile-photo {
    width: 180px;
    height: 180px;
  }
}
