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

:root {
  --bg: #f5f2ee;
  --bg-card: #ece8e3;
  --text: #2c2c2c;
  --text-muted: #7a756f;
  --accent: #a69080;
  --border: #ddd7d0;
  --radius: 12px;
  --font: 'Segoe UI', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

[data-theme="dark"] {
  --bg: #1a1a1a;
  --bg-card: #242424;
  --text: #e4e0db;
  --text-muted: #9a958f;
  --accent: #c4a98c;
  --border: #333;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  transition: background 0.4s ease, color 0.4s ease;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent);
  color: #fff;
}

/* ── Theme Toggle ── */
.theme-toggle {
  position: fixed;
  top: 28px;
  left: 32px;
  z-index: 100;
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--accent);
  transform: scale(1.1);
}

.icon-moon { display: none; }

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

/* ── Layout ── */
.section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
}

.container {
  max-width: 680px;
  width: 100%;
}

/* ── Side Nav ── */
.side-nav {
  position: fixed;
  right: 32px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 24px;
  z-index: 100;
  align-items: flex-end;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav-label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color 0.3s ease;
}

.nav-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.4s ease, transform 0.3s ease;
  flex-shrink: 0;
}

.nav-item:hover .nav-dot {
  background: var(--accent);
  transform: scale(1.3);
}

.nav-item:hover .nav-label {
  color: var(--accent);
}

.nav-item.active .nav-dot {
  background: var(--text);
  transform: scale(1.3);
}

.nav-item.active .nav-label {
  color: var(--text);
  font-weight: 600;
}

/* ── Intro ── */
.intro-container {
  text-align: center;
}

.avatar-wrapper {
  margin-bottom: 32px;
  position: relative;
  width: 120px;
  height: 120px;
  margin-left: auto;
  margin-right: auto;
  cursor: pointer;
}

.avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
  position: absolute;
  top: 0;
  left: 0;
  transition: opacity 0.4s ease;
}

.avatar-ghibli {
  opacity: 0;
}

.avatar-wrapper:hover .avatar-default,
.avatar-wrapper.touched .avatar-default {
  opacity: 0;
}

.avatar-wrapper:hover .avatar-ghibli,
.avatar-wrapper.touched .avatar-ghibli {
  opacity: 1;
}

h1 {
  font-size: 2.4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.tagline {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  letter-spacing: 0.02em;
}

.intro-text {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.8;
}

.intro-email {
  margin-top: 20px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.intro-email a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}

.intro-email a:hover {
  border-bottom-color: var(--accent);
}

/* ── Social Icons ── */
.social-icons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 28px;
}

.social-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  transition: border-color 0.3s ease, transform 0.3s ease;
}

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

.social-icons svg {
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.social-icons a:hover svg {
  color: var(--text);
}

/* ── Projects ── */
.section-title {
  font-size: 1.1rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 40px;
}

.projects-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.project-card {
  display: block;
  text-decoration: none;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, background 0.4s ease;
}

.project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
  border-color: var(--accent);
}

[data-theme="dark"] .project-card:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.project-number {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 8px;
}

.project-card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.project-card p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 12px;
}

.project-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.02em;
  transition: letter-spacing 0.3s ease;
}

.project-card:hover .project-link {
  letter-spacing: 0.06em;
}


/* ── Footer ── */
footer {
  text-align: center;
  padding: 40px 24px;
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

/* ── Fade-in Animations ── */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.delay-1 { transition-delay: 0.15s; }
.delay-2 { transition-delay: 0.3s; }
.delay-3 { transition-delay: 0.45s; }

/* ── Responsive ── */
@media (max-width: 768px) {
  h1 {
    font-size: 1.8rem;
  }

  .section {
    padding: 60px 20px;
  }

  .project-card {
    padding: 22px 24px;
  }

  .side-nav {
    right: 16px;
  }

  .theme-toggle {
    left: 20px;
    top: 20px;
  }
}

@media (max-width: 480px) {
  .side-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    transform: none;
    flex-direction: row;
    justify-content: center;
    gap: 0;
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding: 12px 0;
    transition: background 0.4s ease;
  }

  .nav-item {
    flex-direction: column-reverse;
    gap: 6px;
    flex: 1;
    justify-content: center;
  }

  .nav-dot {
    width: 6px;
    height: 6px;
  }

  .nav-label {
    font-size: 0.6rem;
  }

  .theme-toggle {
    left: 16px;
    top: 16px;
  }

  .section {
    min-height: auto;
    padding: 60px 16px 80px;
  }

  .section:first-of-type {
    min-height: 100vh;
  }

  footer {
    padding-bottom: 80px;
  }
}
