:root {
  --bg: #fafafa;
  --bg-elevated: #ffffff;
  --text: #18181b;
  --text-muted: #71717a;
  --border: #e4e4e7;
  --accent: #2563eb;
  --glow: rgba(37, 99, 235, 0.07);
  --placeholder-bg: #f0f0f1;
}

html[data-theme="dark"] {
  --bg: #0a0a0b;
  --bg-elevated: #141416;
  --text: #e4e4e7;
  --text-muted: #8b8b93;
  --border: #26262b;
  --accent: #60a5fa;
  --glow: rgba(96, 165, 250, 0.08);
  --placeholder-bg: #17171a;
}

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

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
}

.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px;
}

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(600px 300px at 70% -5%, var(--glow), transparent),
    radial-gradient(500px 260px at 15% 15%, var(--glow), transparent);
}

.accent {
  color: var(--accent);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  border-bottom: 1px solid transparent;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo {
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  color: var(--text);
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.nav-links a:hover {
  color: var(--text);
}

#theme-toggle {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

#theme-toggle:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.moon { display: none; }
.sun { display: block; }
html[data-theme="dark"] .moon { display: block; }
html[data-theme="dark"] .sun { display: none; }

.hero {
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 88px 0 72px;
}

.hero-text {
  flex: 1;
}

.hero-eyebrow {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.hero-sub {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.02rem;
}

.socials {
  display: flex;
  gap: 18px;
  margin-top: 28px;
}

.socials a {
  color: var(--text-muted);
  transition: color 0.15s ease, transform 0.15s ease;
}

.socials a:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

.hero-photo {
  flex-shrink: 0;
}

.hero-photo img,
.hero-photo.no-img::before {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.hero-photo img {
  border: 3px solid var(--border);
}

.hero-photo.no-img::before {
  content: "MY";
  display: grid;
  place-items: center;
  background: var(--placeholder-bg);
  border: 3px solid var(--border);
  color: var(--text-muted);
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section {
  padding: 56px 0;
  border-top: 1px solid var(--border);
}

.section h2 {
  margin: 0 0 20px;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  font-weight: 650;
}

.section-sub {
  margin: -14px 0 20px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.prose p {
  margin: 0 0 16px;
  color: var(--text-muted);
}

.prose p:last-child {
  margin-bottom: 0;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline li {
  position: relative;
  padding: 0 0 36px 24px;
  border-left: 1px solid var(--border);
}

.timeline li:last-child {
  padding-bottom: 4px;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}

.role {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.role h3 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 600;
}

.dates {
  color: var(--text-muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.org {
  margin: 2px 0 6px;
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 500;
}

.desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.gallery figure {
  margin: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--placeholder-bg);
}

.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.gallery figure:not(.empty) img:hover {
  transform: scale(1.04);
}

.gallery figure.empty {
  display: none;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px 0 48px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.palette-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: none;
  background: none;
  color: var(--text-muted);
  font: inherit;
  cursor: pointer;
}

.palette-hint kbd {
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.78rem;
  background: var(--bg-elevated);
}

#palette {
  width: min(480px, calc(100vw - 48px));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  margin: auto;
}

#palette::backdrop {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
}

#palette-input {
  width: 100%;
  padding: 16px 18px;
  border: none;
  border-bottom: 1px solid var(--border);
  outline: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.95rem;
}

#palette-list {
  list-style: none;
  margin: 0;
  padding: 8px;
  max-height: 320px;
  overflow-y: auto;
}

#palette-list li button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
}

#palette-list li button .hint {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 0.75rem;
}

#palette-list li button:hover,
#palette-list li.selected button {
  background: var(--placeholder-bg);
}

@media (max-width: 560px) {
  .hero {
    flex-direction: column-reverse;
    text-align: center;
    padding: 56px 0 48px;
  }

  .hero-photo {
    order: -1;
  }

  .hero-photo img,
  .hero-photo.no-img::before {
    width: 110px;
    height: 110px;
  }

  .socials {
    justify-content: center;
  }

  .role {
    flex-direction: column;
    gap: 2px;
  }
}
