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

:root {
  --color-bg: #ffffff;
  --color-text: #3a3a3a;
  --color-text-secondary: #6b7280;
  --color-accent: #2563eb;
  --color-accent-hover: #1d4ed8;
  --color-border: #e5e7eb;
  --color-footer: #9ca3af;
  --color-toggle-bg: #f3f4f6;
  --color-toggle-icon: #6b7280;
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color-scheme: light;
}

[data-theme="dark"] {
  --color-bg: #0f1419;
  --color-text: #e7e9ea;
  --color-text-secondary: #8b98a5;
  --color-accent: #60a5fa;
  --color-accent-hover: #93bbfd;
  --color-border: #2f3336;
  --color-footer: #6b7280;
  --color-toggle-bg: #1e2732;
  --color-toggle-icon: #8b98a5;
  color-scheme: dark;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-main);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  transition: background 0.4s ease, color 0.4s ease;
}

/* Split layout */
.split {
  display: flex;
  min-height: 100vh;
}

.split-image {
  flex: 0 0 50%;
  background-size: cover;
  background-position: center;
  position: sticky;
  top: 0;
  height: 100vh;
}

.split-content {
  flex: 0 0 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem 3.5rem;
  min-height: 100vh;
  position: relative;
}

main {
  max-width: 480px;
}

/* Theme toggle */
.split {
  position: relative;
}

.theme-toggle {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 10;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 50%;
  background: var(--color-toggle-bg);
  color: var(--color-toggle-icon);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.theme-toggle:hover {
  transform: scale(1.1);
}

.theme-toggle svg {
  width: 1.125rem;
  height: 1.125rem;
}

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

/* Entrance animations */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(1.25rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.split-image {
  opacity: 0;
  animation: fadeIn 1s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.intro,
.bio,
.links,
footer {
  opacity: 0;
  animation: fadeSlideUp 0.6s ease forwards;
}

.intro { animation-delay: 0.1s; }
.bio { animation-delay: 0.25s; }
.links { animation-delay: 0.4s; }
footer { animation-delay: 0.55s; }

/* Intro */
.intro h1 {
  font-size: 2.25rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--color-text);
}

.tagline {
  margin-top: 0.5rem;
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  font-weight: 400;
}

/* Bio */
.bio {
  margin-top: 1.75rem;
}

.bio p {
  color: var(--color-text-secondary);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

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

.bio a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

.bio a:hover {
  text-decoration: underline;
}

/* Links */
.links {
  margin-top: 2rem;
  display: flex;
  gap: 2.5rem;
}

.link-group h3 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-secondary);
  margin-bottom: 0.5rem;
}

.link-group ul {
  list-style: none;
}

.link-group li {
  margin-bottom: 0.25rem;
}

.link-group a {
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.link-group a:hover {
  color: var(--color-accent);
}

/* Footer */
footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  transition: border-color 0.4s ease;
}

footer p {
  font-size: 0.8125rem;
  color: var(--color-footer);
}

footer a {
  color: var(--color-footer);
  text-decoration: none;
  transition: color 0.15s ease;
}

footer a:hover {
  color: var(--color-text);
}

/* Single pages */
.page h1 {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

.page-content {
  color: var(--color-text-secondary);
  line-height: 1.7;
}

.page-content p {
  margin-bottom: 1rem;
}

.page-content a {
  color: var(--color-accent);
  text-decoration: none;
}

.page-content a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 1024px) {
  .split-content {
    padding: 3rem 2.5rem;
  }

  .intro h1 {
    font-size: 1.875rem;
  }
}

@media (max-width: 768px) {
  .theme-toggle {
    background: rgba(0, 0, 0, 0.3);
    color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .split {
    flex-direction: column;
  }

  .split-image {
    flex: none;
    position: relative;
    width: 100%;
    min-height: 75vw;
    max-height: 50vh;
  }

  .split-content {
    flex: none;
    min-height: auto;
    padding: 2.5rem 1.75rem;
  }

  .intro h1 {
    font-size: 1.75rem;
  }

  .links {
    flex-direction: column;
    gap: 1.5rem;
  }
}

@media (max-width: 480px) {
  .split-image {
    min-height: 60vw;
    max-height: 45vh;
  }

  .split-content {
    padding: 2rem 1.25rem;
  }

  .intro h1 {
    font-size: 1.5rem;
  }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .split-image,
  .intro,
  .bio,
  .links,
  footer {
    animation: none;
    opacity: 1;
  }

  body {
    transition: none;
  }
}
