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

:root {
  --bg: #f5f5f7;
  --card-bg: #ffffff;
  --text: #111111;
  --muted: #555555;
  --primary: #111111;
  --primary-hover: #000000;
  --chip-bg: #f0f0f2;
  --chip-bg-hover: #e5e5e7;
  --shadow-soft: 0 8px 24px rgba(0,0,0,0.06);
}

/* Vertically centered, responsive page */
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.page {
  min-height: 100vh;
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 16px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  justify-content: center; /* vertically centers the main content */
}

/* -------- Profile / Links -------- */

.profile-section {
  display: flex;
  justify-content: center;
}

.profile-card {
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  padding: 32px 28px;
  text-align: center;
  max-width: 460px;
  width: 100%;
  margin: 0 auto;
}

.avatar {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 16px;
  border: 3px solid rgba(0,0,0,0.06);
}

.name {
  font-size: 1.6rem;
  margin-bottom: 6px;
}

.bio {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 24px;
}

.links {
  display: grid;
  gap: 10px;
}

/* link buttons (link in bio) */
.link {
  display: block;
  background: var(--primary);
  color: #ffffff;
  text-decoration: none;
  padding: 12px 16px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: opacity 0.35s ease, transform 0.35s ease, background 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.link:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
}

/* -------- Projects -------- */

.projects-section {
  background: transparent;
}

.section-title {
  font-size: 1.3rem;
  margin-bottom: 18px;
  text-align: center;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.project-card {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project-title {
  font-size: 1.05rem;
  font-weight: 600;
}

.project-description {
  font-size: 0.9rem;
  color: #444444;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.project-link {
  display: inline-block;
  background: var(--chip-bg);
  color: var(--text);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  transition: background 0.15s ease, transform 0.15s ease, opacity 0.4s ease;
}

.project-link:hover {
  background: var(--chip-bg-hover);
  transform: translateY(-1px);
}

/* -------- Footer -------- */

.footer {
  text-align: center;
  font-size: 0.8rem;
  color: #888888;
}

.footer-links {
  margin-top: 4px;
}

.footer-links a {
  color: inherit;
  text-decoration: underline;
}

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

/* -------- Language switch -------- */

.lang-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  z-index: 10;
  transition: background 0.15s ease, transform 0.15s ease;
}

.lang-toggle:hover {
  background: var(--chip-bg);
  transform: translateY(-1px);
}

/* -------- Fade-up entrance animations -------- */

/* Initial state: invisible + slightly offset downward */
.fade-up {
  opacity: 0;
  transform: translateY(16px);
}

/* Visible state */
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Default transition for elements with fade-up */
.profile-section.fade-up,
.projects-section.fade-up,
.footer.fade-up,
.profile-card.fade-up,
.name.fade-up,
.bio.fade-up,
.links .link,
.projects-grid .project-card {
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* -------- Responsive -------- */

@media (max-width: 600px) {
  .page {
    padding: 24px 12px;
    gap: 24px;
    justify-content: flex-start; /* natural scroll on mobile */
  }

  .profile-card {
    padding: 24px 18px;
  }

  .name {
    font-size: 1.4rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }
}

/* -------- Dark mode -------- */

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121214;
    --card-bg: #1c1c1f;
    --text: #f2f2f3;
    --muted: #a0a0a6;
    --primary: #f2f2f3;
    --primary-hover: #ffffff;
    --chip-bg: #2a2a2e;
    --chip-bg-hover: #35353a;
    --shadow-soft: 0 8px 24px rgba(0,0,0,0.35);
  }

  .link {
    color: #111111;
  }

  .project-description {
    color: var(--muted);
  }

  .avatar {
    border-color: rgba(255,255,255,0.1);
  }

  .lang-toggle {
    border-color: rgba(255,255,255,0.08);
  }
}
