/* Scoped personal homepage theme. Remove the body class to disable it. */
body.modern-personal-theme {
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg-page: #fafafa;
  --bg-glow: rgba(37, 99, 235, 0.06);
  --bg-header: rgba(250, 250, 250, 0.86);
  --bg-card: #ffffff;
  --text-primary: #111111;
  --text-secondary: #5f6368;
  --text-muted: #8a8f98;
  --accent-color: #2563eb;
  --accent-hover: #1d4ed8;
  --border-subtle: #e8e8e8;
  --radius-personal: 10px;
  --shadow-subtle: 0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-hover: 0 10px 24px rgba(15, 23, 42, 0.08);
  --transition-smooth: 180ms ease;

  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  background:
    radial-gradient(circle at top left, var(--bg-glow), transparent 28rem),
    var(--bg-page);
  color: var(--text-primary);
  line-height: 1.65;
  letter-spacing: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-padding-top: 4.5rem;
  scroll-behavior: smooth;
}

@media (prefers-color-scheme: dark) {
  body.modern-personal-theme {
    --bg-page: #0b0d12;
    --bg-glow: rgba(96, 165, 250, 0.04);
    --bg-header: rgba(11, 13, 18, 0.82);
    --bg-card: #151821;
    --text-primary: #f5f7fb;
    --text-secondary: #b7beca;
    --text-muted: #858e9f;
    --accent-color: #60a5fa;
    --accent-hover: #93c5fd;
    --border-subtle: #2a3040;
    --shadow-subtle: 0 2px 8px rgba(0, 0, 0, 0.26), 0 1px 2px rgba(0, 0, 0, 0.18);
    --shadow-hover: 0 12px 28px rgba(0, 0, 0, 0.34);
  }
}

body.modern-personal-theme *,
body.modern-personal-theme *::before,
body.modern-personal-theme *::after {
  box-sizing: border-box;
}

body.modern-personal-theme a {
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

body.modern-personal-theme a:focus,
body.modern-personal-theme button:focus {
  outline: none;
}

body.modern-personal-theme a:focus-visible,
body.modern-personal-theme button:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 4px;
  border-radius: 4px;
}

body.modern-personal-theme .site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: calc(100% - 2rem);
  max-width: 1040px;
  margin: 0 auto;
  padding: 1rem 0;
  background: var(--bg-header);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

body.modern-personal-theme .brand {
  font-size: 0.98rem;
  font-weight: 700;
  text-decoration: none;
}

body.modern-personal-theme .nav-links,
body.modern-personal-theme .hero-actions,
body.modern-personal-theme .social-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

body.modern-personal-theme .nav-links a {
  color: var(--text-secondary);
  font-size: 0.92rem;
  text-decoration: none;
  transition: color var(--transition-smooth);
}

body.modern-personal-theme .nav-links a:hover {
  color: var(--text-primary);
}

body.modern-personal-theme main {
  width: calc(100% - 2rem);
  max-width: 1040px;
  margin: 0 auto;
}

body.modern-personal-theme .hero-section {
  max-width: 720px;
  padding: 5rem 0 4rem;
}

body.modern-personal-theme .eyebrow {
  margin: 0 0 0.75rem;
  color: var(--accent-color);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.modern-personal-theme .hero-section h1 {
  margin: 0;
  max-width: 100%;
  font-size: clamp(2.2rem, 7vw, 3.5rem);
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

body.modern-personal-theme .hero-copy {
  max-width: 620px;
  margin: 1.35rem 0 0;
  color: var(--text-secondary);
  font-size: 1.06rem;
  overflow-wrap: anywhere;
}

body.modern-personal-theme .hero-actions {
  margin-top: 2rem;
}

body.modern-personal-theme .btn-personal,
body.modern-personal-theme .social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.58rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-personal);
  background: var(--bg-card);
  box-shadow: var(--shadow-subtle);
  transition:
    color var(--transition-smooth),
    border-color var(--transition-smooth),
    box-shadow var(--transition-smooth),
    transform var(--transition-smooth);
}

body.modern-personal-theme .btn-primary {
  color: #ffffff;
  border-color: var(--accent-color);
  background: var(--accent-color);
}

body.modern-personal-theme .btn-personal:hover,
body.modern-personal-theme .social-links a:hover {
  color: var(--text-primary);
  border-color: var(--accent-color);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

body.modern-personal-theme .btn-primary:hover {
  color: #ffffff;
  background: var(--accent-hover);
}

body.modern-personal-theme .content-section {
  padding: 3.5rem 0 4.5rem;
}

body.modern-personal-theme .section-heading {
  margin-bottom: 1.25rem;
}

body.modern-personal-theme .section-heading h2 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
}

body.modern-personal-theme .card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  content-visibility: auto;
  contain-intrinsic-size: 0 500px;
}

body.modern-personal-theme .project-card,
body.modern-personal-theme .post-item {
  min-width: 0;
  max-width: 100%;
  padding: 1.35rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-personal);
  box-shadow: var(--shadow-subtle);
  transition:
    border-color var(--transition-smooth),
    box-shadow var(--transition-smooth),
    transform var(--transition-smooth);
}

body.modern-personal-theme .project-card:hover,
body.modern-personal-theme .post-item:hover {
  border-color: var(--accent-color);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

body.modern-personal-theme .project-card h3,
body.modern-personal-theme .post-item h3 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
}

body.modern-personal-theme .project-card p,
body.modern-personal-theme .post-item p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

body.modern-personal-theme .note-list {
  display: grid;
  gap: 1rem;
}

body.modern-personal-theme .date-label {
  display: inline-block;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

body.modern-personal-theme .contact-section {
  padding-bottom: 4rem;
}

body.modern-personal-theme .site-footer {
  width: calc(100% - 2rem);
  max-width: 1040px;
  margin: 0 auto;
  padding: 1.5rem 0 2rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  font-size: 0.88rem;
}

body.modern-personal-theme .site-footer p {
  margin: 0;
}

@media (max-width: 760px) {
  body.modern-personal-theme main,
  body.modern-personal-theme .site-header,
  body.modern-personal-theme .site-footer {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  body.modern-personal-theme .site-header {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
  }

  body.modern-personal-theme .hero-section {
    width: 100%;
    max-width: calc(100vw - 2.5rem);
    padding: 3rem 0 2.25rem;
  }

  body.modern-personal-theme .content-section,
  body.modern-personal-theme .project-card,
  body.modern-personal-theme .post-item {
    max-width: calc(100vw - 2.5rem);
  }

  body.modern-personal-theme .hero-section h1 {
    max-width: 100%;
    font-size: clamp(2rem, 9vw, 2.35rem);
    line-height: 1.18;
    word-break: break-all;
  }

  body.modern-personal-theme .hero-copy {
    font-size: 1rem;
    max-width: 100%;
  }

  body.modern-personal-theme .project-card,
  body.modern-personal-theme .post-item {
    width: 100%;
  }
}

@media (max-width: 420px) {
  body.modern-personal-theme main,
  body.modern-personal-theme .site-header,
  body.modern-personal-theme .site-footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  body.modern-personal-theme .hero-section,
  body.modern-personal-theme .content-section,
  body.modern-personal-theme .project-card,
  body.modern-personal-theme .post-item {
    max-width: calc(100vw - 2rem);
  }

  body.modern-personal-theme .nav-links,
  body.modern-personal-theme .hero-actions,
  body.modern-personal-theme .social-links {
    gap: 0.6rem;
  }

  body.modern-personal-theme .btn-personal {
    width: 100%;
  }

  body.modern-personal-theme .social-links a {
    width: auto;
    flex-grow: 1;
    text-align: center;
    font-size: 0.88rem;
    padding: 0.5rem 0.75rem;
  }
}

@media print {
  body.modern-personal-theme {
    background: #ffffff;
    color: #000000;
    font-size: 12pt;
  }

  body.modern-personal-theme .site-header,
  body.modern-personal-theme .site-footer,
  body.modern-personal-theme .hero-actions,
  body.modern-personal-theme .social-links {
    display: none;
  }

  body.modern-personal-theme main {
    width: 100%;
    max-width: none;
    margin: 0;
  }

  body.modern-personal-theme .hero-section,
  body.modern-personal-theme .content-section {
    padding: 0 0 18pt;
  }

  body.modern-personal-theme .hero-section h1 {
    font-size: 24pt;
    line-height: 1.25;
  }

  body.modern-personal-theme .card-grid {
    display: block;
    content-visibility: visible;
    contain-intrinsic-size: auto;
  }

  body.modern-personal-theme .project-card,
  body.modern-personal-theme .post-item {
    margin-bottom: 12pt;
    border: 1px solid #cccccc;
    box-shadow: none;
    break-inside: avoid;
    page-break-inside: avoid;
  }
}
