* {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans,
    sans-serif, "Apple Color Emoji", "Segoe UI Emoji", Segoe UI Symbol,
    "Noto Color Emoji";
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --text-primary: #374151;
  --text-secondary: #6b7280;
  --text-accent: #3b82f6;
  --bg-primary: #ffffff;
  --border: #e5e7eb;
  --shadow: rgba(0, 0, 0, 0.1);
  --gradient-from: #ec4899;
  --gradient-to: #8b5cf6;
  color-scheme: light;
  --logo-bg: "../images/initial-black.png";
}

@media (prefers-color-scheme: dark) {
  :root {
    --text-primary: #e5e7eb;
    --text-secondary: #9ca3af;
    --text-accent: #60a5fa;
    --bg-primary: #121212;
    --border: #374151;
    --shadow: rgba(0, 0, 0, 0.3);
    --gradient-from: #ec4899;
    --gradient-to: #8b5cf6;
    color-scheme: dark;
    --logo-bg: url("../images/initial-white.png");
  }
}

body.light-mode {
  color: var(--text-secondary);
  background: var(--bg-primary);
  transition: all 0.3s ease;
  position: relative;
  overflow-x: hidden;
  color-scheme: light;
}

body.dark-mode {
  color: var(--text-secondary);
  background: var(--bg-primary);
  transition: all 0.3s ease;
  position: relative;
  overflow-x: hidden;
  color-scheme: dark;
}

.background-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  opacity: 0.1;
}

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
}

.logo {
  display: inline-block;
  width: 48px;
  height: 48px;
  background-image: var(--logo-bg);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
@media (prefers-color-scheme: dark) {
  .logo {
    display: inline-block;
    width: 48px;
    height: 48px;
    background-image: var(--logo-bg);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
  }
}

.nav {
  display: flex;
  padding: 20px;
  max-height: 90px;
}

.nav-right {
  margin-left: auto;
  display: flex;
  gap: 20px;
  align-items: center;
}

.nav-left {
  margin-right: auto;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 4px;
  transition: all 0.3s ease;
  font-size: 18px;
  font-weight: 500;
}

.nav-link:hover {
  color: var(--text-primary);
}

.theme-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px 4px;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-size: 18px;
}

.theme-toggle:hover {
  color: var(--text-primary);
}

.main {
  padding: 40px 28px;
  max-width: 90ch;
  margin: 0 auto;
  margin-top: 70px;
}

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

.prose h1 {
  color: var(--text-primary);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0;
  animation: slideInFromBottom 0.8s ease-out;
}

@keyframes slideInFromBottom {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.prose p {
  animation: slideInContent 0.8s ease-out 0.2s both;
  font-size: 1.15rem;
  line-height: 1.65;
  margin-top: 1.25em;
  margin-bottom: 1.25em;
}

@keyframes slideInContent {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.prose a {
  color: var(--text-accent);
  text-decoration: none;
  transition: all 0.2s ease;
}

.prose a:hover {
  text-decoration: none;
}

/* Magic links with icons */
.magic-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  position: relative;
}

.magic-link-icon {
  width: 16px;
  height: 16px;
  border-radius: 2px;
  background-size: cover;
  background-position: center;
  display: inline-block;
}

/* Social links section */
.social-section {
  border-top: 1px solid var(--border);
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: -8px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
}

.social-link:hover {
  color: var(--text-primary);
}

.social-icon {
  display: flex;
  align-items: center;
  opacity: 0.75;
  font-size: 16px;
}

.social-text {
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  font-size: 1.03rem;
}
/* Experience and Project sections */
.section {
  margin: 3rem 0;
  animation: fadeInUp 0.6s ease-out both;
}

.section:nth-child(3) {
  animation-delay: 0.4s;
}
.section:nth-child(4) {
  animation-delay: 0.6s;
}
.section:nth-child(5) {
  animation-delay: 0.8s;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.item-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
}

.item-company {
  color: var(--text-accent);
  font-weight: 500;
}

.item-date {
  color: var(--text-secondary);
  font-size: 0.9rem;
  opacity: 0.8;
}

.item-description {
  color: var(--text-secondary);
  line-height: 1.6;
}

.footer {
  text-align: center;
  color: var(--text-secondary);
  opacity: 0.5;
  font-size: 14px;
  animation: slideInFromBottom 0.8s ease-out 1.2s both;
}

.image-realign {
  padding-bottom: 0px;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .nav {
    gap: 12px;
    padding: 15px;
  }

  .nav-link {
    padding: 6px 8px;
    font-size: 12px;
  }

  .main {
    padding: 20px 16px;
    margin-top: 70px;
  }

  .prose h1 {
    font-size: 2.5rem;
  }

  .item-header {
    flex-direction: column;
    gap: 5px;
  }

  .social-links {
    gap: 8px;
  }

  .sponsor-buttons {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Hide certain nav items on mobile */
@media (max-width: 768px) {
  .nav-link.hide-mobile {
    display: none;
  }
}
