/* Catppuccin-inspired palette */
:root[data-theme="dark"] {
  --bg: #1e1e2e;
  --surface: #313244;
  --text: #cdd6f4;
  --subtext: #a6adc8;
  --accent: #b4befe;
  --accent-hover: #cba6f7;
  --border: #45475a;
  --faint: #585b70;
  --ghost: #313244;
  --ambient-1: rgba(180, 190, 254, 0.045);
  --ambient-2: rgba(203, 166, 247, 0.035);
  --card-bg: rgba(49, 50, 68, 0.25);
  --card-bg-hover: rgba(49, 50, 68, 0.45);
  --card-border: rgba(69, 71, 90, 0.4);
  --accent-glow: rgba(180, 190, 254, 0.06);
  --sponsor-glow: rgba(203, 166, 247, 0.08);
}

:root[data-theme="light"] {
  --bg: #eff1f5;
  --surface: #ccd0da;
  --text: #4c4f69;
  --subtext: #6c6f85;
  --accent: #7287fd;
  --accent-hover: #8839ef;
  --border: #bcc0cc;
  --faint: #9ca0b0;
  --ghost: #bcc0cc;
  --ambient-1: rgba(114, 135, 253, 0.04);
  --ambient-2: rgba(136, 57, 239, 0.03);
  --card-bg: rgba(204, 208, 218, 0.3);
  --card-bg-hover: rgba(204, 208, 218, 0.5);
  --card-border: rgba(188, 192, 204, 0.6);
  --accent-glow: rgba(114, 135, 253, 0.06);
  --sponsor-glow: rgba(136, 57, 239, 0.08);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: clamp(1rem, 0.5rem + 0.5vw, 1.35rem);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background 0.3s, color 0.3s;
  position: relative;
  overflow-x: hidden;
}

/* Ambient radial light */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(ellipse at 30% 20%, var(--ambient-1), transparent 50%),
    radial-gradient(ellipse at 70% 80%, var(--ambient-2), transparent 50%);
  pointer-events: none;
  transition: background 0.3s;
}

.container {
  max-width: 560px;
  width: 100%;
  padding: 2rem;
  position: relative;
  z-index: 1;
}

/* --- Staggered fade-in --- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  opacity: 0;
  animation: fadeUp 0.5s ease forwards;
}

.fade-in:nth-child(1) { animation-delay: 0ms; }
.fade-in:nth-child(2) { animation-delay: 80ms; }
.fade-in:nth-child(3) { animation-delay: 160ms; }
.fade-in:nth-child(4) { animation-delay: 240ms; }
.fade-in:nth-child(5) { animation-delay: 320ms; }
.fade-in:nth-child(6) { animation-delay: 400ms; }
.fade-in:nth-child(7) { animation-delay: 480ms; }
.fade-in:nth-child(8) { animation-delay: 560ms; }
.fade-in:nth-child(9) { animation-delay: 640ms; }
.fade-in:nth-child(10) { animation-delay: 720ms; }
.fade-in:nth-child(11) { animation-delay: 800ms; }
.fade-in:nth-child(12) { animation-delay: 880ms; }

/* --- Header --- */
header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 2rem;
}

.theme-toggle {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}

.theme-toggle:hover {
  border-color: var(--accent);
}

[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: inline; }
[data-theme="light"] .icon-sun { display: inline; }
[data-theme="light"] .icon-moon { display: none; }

/* --- Identity --- */
.top {
  text-align: center;
  margin-bottom: 1rem;
}

.headshot {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1.25rem;
  display: block;
  border: 2px solid transparent;
  background-clip: padding-box;
  position: relative;
  transition: box-shadow 0.4s;
}

/* Gradient ring */
.top {
  position: relative;
}

.headshot {
  outline: 3px solid var(--border);
  outline-offset: 1px;
  transition: outline-color 0.4s, box-shadow 0.4s;
}

.headshot:hover {
  outline-color: var(--accent);
  box-shadow: 0 0 32px var(--accent-glow);
}

h1 {
  font-size: clamp(1.75rem, 1.3rem + 0.6vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.2rem;
}

.tagline {
  color: var(--subtext);
  font-size: 0.95rem;
}

/* --- Journey --- */
.journey {
  text-align: center;
  color: var(--border);
  font-size: 0.72rem;
  margin-bottom: 2.5rem;
  letter-spacing: 0.02em;
}

.jplane {
  display: inline-block;
  margin: 0 0.4rem;
  font-size: 0.6rem;
  color: var(--faint);
  opacity: 0.6;
  vertical-align: middle;
  font-style: normal;
}

/* --- Section dividers --- */
.section-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
}

.section-divider::before {
  background: linear-gradient(to right, transparent, var(--card-border));
}

.section-divider::after {
  background: linear-gradient(to left, transparent, var(--card-border));
}

.section-divider span {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--faint);
  font-weight: 600;
  white-space: nowrap;
}

/* --- Bio sections --- */
.bio-section {
  text-align: center;
  color: var(--subtext);
  font-size: 0.88rem;
  line-height: 1.8;
  max-width: 440px;
  margin: 0 auto 2.5rem;
}

/* --- Featured projects --- */
.projects-featured {
  display: flex;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.project-card {
  flex: 1;
  text-align: center;
  padding: 1.35rem 1.1rem;
  border-radius: 12px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  display: block;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  opacity: 0;
  transition: opacity 0.3s;
}

.project-card:hover {
  background: var(--card-bg-hover);
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2), 0 0 16px var(--accent-glow);
}

.project-card:hover::before {
  opacity: 1;
}

.pname {
  color: var(--accent);
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
  transition: text-shadow 0.3s;
}

.project-card:hover .pname {
  text-shadow: 0 0 12px var(--accent-glow);
}

.pdesc {
  color: var(--faint);
  font-size: 0.78rem;
  line-height: 1.5;
}

/* --- Also building --- */
.also-building {
  margin-bottom: 2.5rem;
}

.also-building-label {
  text-align: center;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--border);
  margin-bottom: 0.75rem;
}

.also-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 400px;
  margin: 0 auto;
}

.also-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.4rem 0;
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.also-item:hover .also-name {
  color: var(--accent);
}

.also-name {
  color: var(--subtext);
  font-size: 0.82rem;
  font-weight: 500;
  transition: color 0.2s;
}

.also-tag {
  font-size: 0.65rem;
  color: var(--border);
  font-style: italic;
}

.also-desc {
  color: var(--faint);
  font-size: 0.72rem;
}

.also-item-content {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

/* --- Companies --- */
.companies {
  text-align: center;
  color: var(--border);
  font-size: 0.72rem;
  margin-top: -1.5rem;
  margin-bottom: 2.5rem;
  letter-spacing: 0.02em;
}

/* --- Links --- */
.links {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 2.5rem;
}

.links a {
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 0.45rem 1.1rem;
  font-size: 0.85rem;
  color: var(--subtext);
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s;
}

.links a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--card-bg);
  box-shadow: 0 0 12px var(--accent-glow);
}

.links a.sponsor {
  color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.links a.sponsor:hover {
  background: var(--card-bg);
  box-shadow: 0 0 16px var(--sponsor-glow);
  text-shadow: 0 0 8px var(--sponsor-glow);
}

/* --- Closing --- */
.closing {
  text-align: center;
  color: var(--ghost);
  font-size: 0.75rem;
  font-style: italic;
}

/* --- Responsive --- */
@media (max-width: 480px) {
  .container {
    padding: 1.5rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  .projects-featured {
    flex-direction: column;
  }

  .links {
    gap: 0.5rem;
  }
}
