/* =============================================
   Personal Website — Royal Blue & Light Blue
   ============================================= */

:root {
  --royal-blue: #4169e1;
  --royal-blue-dark: #2f4eb8;
  --light-blue: #b8d4f0;
  --light-blue-pale: #e8f2fb;
  --white: #ffffff;
  --text-dark: #1a1a2e;
  --text-muted: #4a5568;
  --shadow: 0 4px 16px rgba(65, 105, 225, 0.12);
  --radius: 12px;
  --radius-pill: 999px;
  --max-width: 1100px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: Helvetica, "Helvetica Neue", Arial, sans-serif;
  color: var(--text-dark);
  background-color: var(--white);
  line-height: 1.6;
  text-align: left;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--royal-blue);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--royal-blue-dark);
}

/* ---- Layout ---- */

.container {
  width: min(100% - 2.5rem, var(--max-width));
  margin-inline: auto;
}

/* ---- Navigation ---- */

.site-nav {
  background-color: var(--light-blue-pale);
  border-bottom: 2px solid var(--light-blue);
  padding: 1.25rem 0;
  margin-bottom: 2rem;
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
}

.nav-brand {
  font-family: "Gloria Hallelujah", cursive;
  font-size: clamp(2.25rem, 5vw, 3rem);
  font-weight: 400;
  color: var(--royal-blue);
  line-height: 1.2;
  white-space: nowrap;
}

.nav-brand:hover {
  color: var(--royal-blue-dark);
}

.nav-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-left: auto;
}

.nav-list a {
  display: inline-block;
  padding: 0.55rem 1.35rem;
  background-color: var(--royal-blue);
  color: var(--white);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.nav-list a:hover {
  background-color: var(--royal-blue-dark);
  color: var(--white);
  transform: translateY(-1px);
}

.nav-list a.active {
  background-color: #1e90ff;
  color: var(--white);
  box-shadow: none;
}

.nav-list a.active:hover {
  background-color: #1e90ff;
  color: var(--white);
  transform: none;
}

/* ---- Site Header (Name) ---- */

.site-header {
  padding: 2.5rem 0 1.5rem;
}

.site-header h1 {
  font-family: "Gloria Hallelujah", cursive;
  font-size: clamp(2.75rem, 6vw, 3.75rem);
  font-weight: 400;
  color: var(--royal-blue);
  letter-spacing: 0.01em;
  line-height: 1.25;
}

/* ---- Hero (About + Portrait) ---- */

.hero {
  padding: 2rem 0 3rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.about-block h2 {
  font-family: "Gloria Hallelujah", cursive;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 400;
  color: var(--text-dark);
  margin-bottom: 1.15rem;
  letter-spacing: 0.01em;
  line-height: 1.25;
}

.about-block p {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.75;
}

.portrait {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid #000;
  border-radius: var(--radius);
  overflow: hidden;
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 55% 25%;
}

/* ---- Category Grid (Index) ---- */

.categories {
  padding: 2rem 0 3.5rem;
  background-color: var(--light-blue-pale);
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

.category-card {
  text-align: left;
}

.category-card a.card-link {
  display: block;
  color: inherit;
}

.category-card a.card-link:hover h3 {
  color: var(--royal-blue-dark);
}

.category-card h3 {
  font-family: "Gloria Hallelujah", cursive;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--royal-blue);
  margin-bottom: 0.6rem;
  transition: color 0.2s ease;
}

.category-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ---- Inner Page Layout ---- */

.page-hero {
  padding: 2rem 0 1.5rem;
  border-bottom: 2px solid var(--light-blue);
  margin-bottom: 2.5rem;
}

.page-hero h2 {
  font-family: "Gloria Hallelujah", cursive;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 400;
  color: var(--text-dark);
  margin-bottom: 1.15rem;
  letter-spacing: 0.01em;
  line-height: 1.25;
}

.page-hero p {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: min(100%, 48rem);
}

.page-hero p + p {
  margin-top: 1rem;
}

.page-content {
  padding-bottom: 3.5rem;
  flex: 1;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

.content-stack {
  width: min(100%, 48rem);
}

.content-stack .course + .course {
  margin-top: 1.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--light-blue);
}

.content-stack h3 {
  font-size: 1rem;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.content-stack h3 a {
  color: var(--text-dark);
}

.content-stack h3 a:hover {
  color: var(--text-muted);
}

.content-stack h3 a.article-link,
a.article-link {
  color: var(--royal-blue);
}

.content-stack h3 a.article-link:hover,
a.article-link:hover {
  color: var(--royal-blue-dark);
}

.content-stack .meta {
  font-size: 0.9rem;
  color: var(--text-dark);
  opacity: 0.75;
  margin-bottom: 0.75rem;
}

.content-stack p {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.content-item {
  background-color: var(--light-blue-pale);
  border-radius: var(--radius);
  padding: 1.5rem;
  border-left: 4px solid var(--royal-blue);
}

.content-item h3 {
  font-size: 1rem;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.content-item h3 a {
  color: var(--text-dark);
}

.content-item h3 a:hover {
  color: var(--text-muted);
}

.content-item .meta {
  font-size: 0.9rem;
  color: var(--text-dark);
  opacity: 0.75;
  margin-bottom: 0.75rem;
}

.content-item p {
  font-size: 0.95rem;
  color: var(--text-muted);
}

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

.site-footer {
  margin-top: auto;
  background-color: var(--royal-blue);
  color: var(--white);
  padding: 1rem;
  font-size: 0.95rem;
  text-align: center;
}

.site-footer a {
  color: var(--light-blue);
}

.site-footer a:hover {
  color: var(--white);
}

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

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .portrait {
    order: -1;
  }

  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .nav-list {
    gap: 0.5rem;
  }

  .nav-list a {
    padding: 0.45rem 1rem;
    font-size: 0.85rem;
  }

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