@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@400;500;600;700&family=Cormorant+Garamond:ital,wght@0,500;0,600;0,700;1,500;1,600&family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Lora:ital,wght@0,400;0,500;0,600;1,400;1,500&display=swap');

:root {
  --bg: #ffffff;
  --bg-subtle: #f9fafb;
  --text: #282828;
  --text-secondary: #676767;
  --text-soft: #888888;
  --border: #e5e5e5;
  --border-strong: #d1d1d1;
  --accent: #282828;
  --font-body: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-display: 'Chakra Petch', 'DM Sans', system-ui, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  transition: background-color 0.45s ease, color 0.35s ease;
}

.mode-swap {
  transition: opacity 0.32s ease, transform 0.32s ease;
}

body.mode-fading .mode-swap {
  opacity: 0;
  transform: translateY(6px);
}

@media (prefers-reduced-motion: reduce) {
  body,
  .mode-swap {
    transition: none;
  }
}

body.alt-mode {
  background: #f2f0ea;
  font-family: 'Lora', Georgia, 'Times New Roman', serif;
}

body.alt-mode .hero h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(2.75rem, 5vw + 1rem, 3.85rem);
  font-weight: 600;
  letter-spacing: 0.01em;
}

body.alt-mode .hero .subtitle {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.35rem;
  font-style: italic;
  font-weight: 500;
  letter-spacing: 0.04em;
}

body.alt-mode .hero .lead,
body.alt-mode #hero-bio .lead {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.85;
  letter-spacing: 0.015em;
}

body.alt-mode .experience-body p,
body.alt-mode .project-card .desc,
body.alt-mode .footer-note {
  font-family: 'Lora', Georgia, serif;
  line-height: 1.8;
}

body.alt-mode .section-title,
body.alt-mode .experience-body h3,
body.alt-mode .experience-meta,
body.alt-mode .project-card h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
}

body.alt-mode .section-title {
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

body.alt-mode .experience-body h3 {
  font-size: 1.25rem;
  font-weight: 600;
}

.page {
  position: relative;
}

.container {
  width: 100%;
  max-width: 48rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Hero */
.hero {
  position: relative;
  padding: 5rem 0 4rem;
}

.hero-inner {
  max-width: 42rem;
}

.hero-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 0;
}

.hero-title-row h1 {
  margin: 0;
}

.name-toggle {
  flex-shrink: 0;
  width: 3.25rem;
  height: 3.25rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #16a34a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s, transform 0.2s;
}

.name-toggle-icon {
  width: 2.35rem;
  height: 2.35rem;
}

.name-toggle:hover {
  color: #15803d;
  transform: rotate(180deg);
}

.name-toggle[aria-pressed='true'] {
  color: #15803d;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw + 1rem, 3.5rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
}

.hero .subtitle {
  margin: 1.5rem 0 1.5rem;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.hero .lead {
  margin: 0 0 1.25rem;
  max-width: 40rem;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

.hero .lead:last-of-type {
  margin-bottom: 2rem;
}

#hero-bio .lead:last-child {
  margin-bottom: 2rem;
}

#hero-bio [hidden] {
  display: none;
}

.experience-list [hidden],
#books-panel[hidden],
#experience-panel[hidden] {
  display: none;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.scroll-hint {
  display: none;
}

/* Buttons */
.glass-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.glass-button:hover {
  background: var(--bg-subtle);
  border-color: var(--text-soft);
  color: var(--text);
}

.glass-button svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

/* Cards */
.glass-card {
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: var(--bg);
  padding: 1.5rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.glass-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.glass-card.project-card:hover {
  transform: none;
}

.glass {
  border: 1px solid var(--border);
  background: var(--bg-subtle);
}

/* Sections */
.section {
  padding: 4rem 0;
}

.section-narrow,
.section-wide {
  max-width: 48rem;
  margin: 0 auto;
}

.section-title {
  margin: 0 0 2rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* Experience */
.experience-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.experience-row {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .experience-row {
    flex-direction: row;
    align-items: flex-start;
    gap: 1.5rem;
  }
}

.logo-circle {
  flex-shrink: 0;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
}

.logo-circle--fill {
  padding: 0;
}

.logo-circle--fill img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.logo-circle--contain {
  padding: 0.5rem;
}

.logo-circle--contain img {
  width: 100%;
  height: auto;
  max-height: 2rem;
  object-fit: contain;
  display: block;
}

.logo-circle--dark {
  background: #000;
  border-color: #000;
}

.experience-body h3 {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
}

.experience-meta {
  margin: 0 0 0.15rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.experience-date {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--text-soft);
}

.experience-body p {
  margin: 0;
  line-height: 1.65;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.experience-body p + p {
  margin-top: 0.65rem;
}

/* Projects */
.project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.project-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.85rem;
  color: var(--text-secondary);
}

.project-card h3 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.project-card:hover h3 {
  color: var(--text);
}

.project-card .desc {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.tag {
  font-size: 0.72rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

.project-footer {
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.project-footer .glass-button {
  width: 100%;
  font-size: 0.85rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding: 2rem 0 3rem;
  margin-top: 2rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}

.footer-social {
  display: flex;
  gap: 0.25rem;
}

.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border-radius: 0.375rem;
  color: var(--text-secondary);
  transition: color 0.2s, background 0.2s;
}

.footer-social a:hover {
  color: var(--text);
  background: var(--bg-subtle);
}

.footer-social svg {
  width: 1.25rem;
  height: 1.25rem;
}

.footer-note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-soft);
}
