/* =========================================================
   LANDING — polished, accessible, bugfixed (scoped cards)
   ========================================================= */

/* Brand tokens */
:root {
  --primary-color: #2c3e50;
  --accent-color: #3498db;
  --secondary-color: #95a5a6;

  --bg: #ffffff;
  --bg-soft: #f8f9fa;
  --belt: #ecf0f1;

  --text: #2c3e50;
  --text-muted: #7f8c8d;

  --radius-lg: 16px;
  --radius-xl: 30px;

  --shadow-sm: 0 2px 10px rgba(0,0,0,.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,.08);
  --shadow-lg: 0 12px 40px rgba(52,152,219,.15);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0f12;
    --bg-soft: #14161a;
    --belt: #1a1d22;

    --text: #e8eaed;
    --text-muted: #a0a6ad;

    --secondary-color: #9fb3c8;
    --shadow-sm: 0 2px 10px rgba(0,0,0,.35);
    --shadow-md: 0 6px 24px rgba(0,0,0,.45);
    --shadow-lg: 0 18px 50px rgba(0,0,0,.55);
  }
}

/* Page backdrop */
body {
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-soft) 100%);
  color: var(--text);
  min-height: 100vh;
}

/* =============== HERO =============== */
.hero-section {
  text-align: center;
  padding: 6rem 2rem 4rem;
  margin-bottom: 3rem;
  background: linear-gradient(135deg, var(--belt) 0%, var(--bg) 100%);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  position: relative;
  overflow: hidden;
  isolation: isolate; /* keeps pseudo behind content */
  box-shadow: var(--shadow-sm);
}

.hero-section::before {
  content: "";
  position: absolute;
  inset: -50%;
  background: radial-gradient(circle, rgba(52,152,219,.06) 0%, transparent 70%);
  animation: gentle-pulse 12s ease-in-out infinite;
  z-index: 0;
}

@keyframes gentle-pulse {
  0%, 100% { transform: scale(1); opacity: .5; }
  50% { transform: scale(1.08); opacity: .85; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-section::before { animation: none; opacity: .4; }
}

.hero-avatar {
  width: 190px;
  height: 190px;
  border-radius: 50%;
  margin: 0 auto 2rem;
  display: block;
  box-shadow: var(--shadow-md);
  border: 4px solid var(--bg);
  position: relative;
  z-index: 2;
  transition: transform .35s ease, box-shadow .35s ease;
  will-change: transform;
}
.hero-avatar:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
}

.hero-section h1 {
  font-weight: 300;
  margin-bottom: 1rem;
  color: var(--primary-color);
  position: relative;
  z-index: 2;
  letter-spacing: -0.02em;
}
.hero-section h1::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: var(--accent-color);
  margin: 1rem auto 0;
  border-radius: 2px;
}

.hero-section p {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 700px;
  margin: 1.25rem auto 0;
  position: relative;
  z-index: 2;
}

/* Optional divider after hero */
.section-divider {
  max-width: 1100px; height: 1px; margin: 1.5rem auto 2rem;
  background: color-mix(in oklab, var(--belt) 85%, transparent);
}

/* =============== LANDING CARDS (SCOPED) =============== */
.main-nav { max-width: 1100px; margin: 0 auto; padding: 0 2rem; }

.main-nav .nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px,1fr));
  gap: 2rem;
}

.main-nav .nav-item {
  display: block;                         /* works if it's an <a> */
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 2.2rem 1.5rem;
  text-align: center;
  border: 1px solid color-mix(in oklab, var(--belt) 80%, transparent);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  transition: transform .35s cubic-bezier(.25,.8,.25,1), box-shadow .35s ease, border-color .35s ease;
  will-change: transform;
}

/* top accent bar */
.main-nav .nav-item::before {
  content: "";
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 4px;
  background: linear-gradient(90deg, var(--accent-color), var(--secondary-color));
  transition: left .35s ease, background-color .35s ease;
}

/* per-card hover colors */
.main-nav .nav-item:nth-child(1) { --hover-color: #e74c3c; }
.main-nav .nav-item:nth-child(2) { --hover-color: #f39c12; }
.main-nav .nav-item:nth-child(3) { --hover-color: #2ecc71; }
.main-nav .nav-item:nth-child(4) { --hover-color: #9b59b6; }
.main-nav .nav-item:nth-child(5) { --hover-color: #1abc9c; }

/* hover */
.main-nav .nav-item:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in oklab, var(--accent-color) 30%, transparent);
}
.main-nav .nav-item:hover::before {
  left: 0;
  background: var(--hover-color);
}

/* title + link */
.main-nav .nav-item h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 .6rem 0;
  color: var(--text);
  line-height: 1.3;
}
.main-nav .nav-item h2 a {
  color: inherit;
  text-decoration: none;
  transition: color .25s ease;
}
.main-nav .nav-item:hover h2 a { color: var(--accent-color); }

/* copy */
.main-nav .nav-item p {
  color: var(--text-muted);
  font-size: .98rem;
  margin: 0;
  line-height: 1.6;
}

/* keyboard focus */
.main-nav .nav-item:focus-visible,
.main-nav .nav-item a:focus-visible {
  outline: 3px solid color-mix(in oklab, var(--accent-color) 70%, transparent);
  outline-offset: 3px;
  border-radius: 12px;
}

/* =============== RESPONSIVE =============== */
@media (max-width: 768px) {
  .hero-section { padding: 4rem 1rem 3rem; border-radius: 0 0 22px 22px; }
  .hero-section h1 { font-size: 2.2rem; }
  .main-nav .nav-grid { grid-template-columns: 1fr; gap: 1.4rem; }
  .main-nav .nav-item { padding: 1.8rem 1.25rem; }
}

/* If your pages use Quarto’s full layout, widen content a touch */
.page-layout-full .content { max-width: 1100px; }

/* =============== SAFETY RESET FOR TOP NAVBAR (optional) =============== */
/* If anything still sneaks into the top bar, these rules neutralize it. */
.navbar .nav-item {
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  position: static !important;
  overflow: visible !important;
}
.navbar .nav-item::before { display: none !important; }
