/* ── Tokens ── */
:root {
  --bg: #ffffff;
  --text: #111111;
  --muted: #6b7280;
  --subtle: #9ca3af;
  --border: rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f0f;
    --text: #f0f0f0;
    --muted: #9ca3af;
    --subtle: #6b7280;
    --border: rgba(255, 255, 255, 0.1);
  }
}

html.dark {
  --bg: #0f0f0f;
  --text: #f0f0f0;
  --muted: #9ca3af;
  --subtle: #6b7280;
  --border: rgba(255, 255, 255, 0.1);
}

html.light {
  --bg: #ffffff;
  --text: #111111;
  --muted: #6b7280;
  --subtle: #9ca3af;
  --border: rgba(0, 0, 0, 0.1);
}

html.a11y {
  --muted: #1f2937;
  --subtle: #374151;
  --border: rgba(0, 0, 0, 0.25);
}

html.a11y.dark {
  --muted: #e5e7eb;
  --subtle: #d1d5db;
  --border: rgba(255, 255, 255, 0.25);
}

html.no-motion * {
  animation-duration: 0ms !important;
  animation-delay: 0ms !important;
  transition-duration: 0ms !important;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

/* ── Splash ── */
#splash {
  position: fixed;
  inset: 0;
  background: Canvas;
  z-index: 999;
  pointer-events: none;
  animation: splashOut 0.7s ease 0.05s forwards;
}

@keyframes splashOut {
  to { opacity: 0; visibility: hidden; }
}

/* ── Body ── */
body {
  background-color: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: background-color 0.4s ease, color 0.3s ease;
}

/* Aura — centered on theme toggle button (top:35px right:35px from viewport) */
body::before {
  content: '';
  position: fixed;
  top: calc(35px - 40vw);
  right: calc(35px - 40vw);
  width: 80vw;
  height: 80vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.10) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  transition: background 0.8s ease;
}

html.dark body::before {
  background: radial-gradient(circle, rgba(96, 130, 220, 0.14) 0%, transparent 70%);
}

/* ── Layout ── */
main {
  max-width: 560px;
  margin: 0 auto;
  padding: 80px 24px 48px;
  position: relative;
  z-index: 1;
}

/* ── Theme toggle ── */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--subtle);
  line-height: 0;
  border-radius: 50%;
  transition: color 0.15s ease, background-color 0.15s ease;
  z-index: 100;
}

.theme-toggle:hover { color: var(--text); background: var(--border); }
.theme-toggle svg { width: 18px; height: 18px; display: block; }

html.light .theme-toggle #iconSun { color: #f59e0b; }
html.dark  .theme-toggle #iconMoon { color: #93a8d4; }

.theme-toggle.spin {
  animation: toggleSpin 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes toggleSpin {
  0%   { transform: rotate(0deg) scale(1); }
  40%  { transform: rotate(200deg) scale(0.75); }
  100% { transform: rotate(360deg) scale(1); }
}

/* ── Fade-in cascade ── */
.fade {
  opacity: 0;
  transform: translateY(10px);
  animation: fadeUp 0.5s ease forwards;
}

@keyframes fadeUp {
  to { opacity: 1; transform: none; }
}

.d1 { animation-delay: 0ms; }
.d2 { animation-delay: 80ms; }
.d3 { animation-delay: 180ms; }
.d4 { animation-delay: 280ms; }
.d5 { animation-delay: 400ms; }

/* ── Typography ── */
.name {
  font-size: 22px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

.role {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 28px;
}

.bio {
  font-size: 15px;
  line-height: 1.75;
  color: var(--muted);
  margin-bottom: 32px;
}

.bio strong {
  color: var(--text);
  font-weight: 500;
}

/* ── Links ── */
.links {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}

.links a {
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s ease;
}

.links a:hover { color: var(--text); }
.links a svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ── Divider ── */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 44px 0;
}

/* ── Projects ── */
.section-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--subtle);
  margin-bottom: 16px;
}

.project {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.project:last-child { border-bottom: none; }

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 5px;
}

.project-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.project-year {
  font-size: 13px;
  color: var(--subtle);
  white-space: nowrap;
  margin-left: 12px;
}

.project-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

/* ── Accessibility button ── */
.a11y-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  line-height: 0;
  color: var(--text);
  opacity: 0.3;
  transition: opacity 0.2s ease;
  border-radius: 50%;
  z-index: 100;
}

.a11y-btn:hover { opacity: 0.6; }
.a11y-btn.active { opacity: 1; }
.a11y-btn svg { width: 22px; height: 22px; display: block; }

.a11y-btn .strike { transition: opacity 0.2s ease; }
.a11y-btn.active .strike { opacity: 0; }
