/* Professional visual polish */

:root {
  --bg: #fafaf9;
  --surface: rgba(255,255,255,0.9);
  --text: #1f2430;
  --muted: #60697a;
  --line: rgba(25, 32, 45, 0.09);
  --accent: #1f3c88;
  --accent-soft: rgba(31,60,136,0.12);
  --shadow-soft: 0 10px 30px rgba(22, 28, 45, 0.05);
  --shadow-card: 0 18px 40px rgba(22, 28, 45, 0.08);
  --radius-xl: 24px;
  --radius-lg: 20px;
  --radius-md: 16px;
}

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(circle at top left, rgba(53,88,184,0.05), transparent 24%),
    radial-gradient(circle at top right, rgba(31,60,136,0.04), transparent 22%),
    linear-gradient(180deg, #fcfcfb 0%, #f8f8f7 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.72;
  letter-spacing: -0.01em;
}

#title-block-header { display: none; }

main.content {
  max-width: 1180px;
  margin: 0 auto;
  padding-top: 0.8rem;
  padding-bottom: 2.8rem;
}

.site-shell {
  max-width: 1120px;
  margin: 0 auto;
}

h1, h2, h3, h4 {
  color: #171b24;
  letter-spacing: -0.03em;
}

h2 {
  font-size: 1.55rem;
  font-weight: 700;
  margin-top: 2.8rem;
  margin-bottom: 0.9rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line);
}

h3 {
  font-size: 1.08rem;
  font-weight: 700;
  margin-bottom: 0.55rem;
}

a { color: var(--accent); }
a:hover { color: #3558b8; }

.nav-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.2rem 0 1.8rem 0;
  padding: 0.25rem 0 1.35rem 0;
  border-bottom: 1px solid var(--line);
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  background: rgba(255,255,255,0.78);
  border: 1px solid var(--line);
  box-shadow: 0 4px 14px rgba(18, 24, 39, 0.03);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.nav-pill:hover {
  transform: translateY(-1px);
  border-color: var(--accent-soft);
  box-shadow: 0 10px 18px rgba(18, 24, 39, 0.05);
  background: #fff;
  text-decoration: none;
}

.section-grid,
.funding-grid,
.apps-grid {
  display: grid;
  gap: 1.15rem;
  margin-top: 1.1rem;
}

.section-grid,
.funding-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}


.apps-grid {
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
}

.panel-card,
.funding-card,
.app-card {
  background: var(--surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  box-shadow: var(--shadow-soft);
}

.panel-card,
.funding-card {
  position: relative;
  overflow: hidden;
}

.panel-card::before,
.funding-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, rgba(31,60,136,0.9), rgba(53,88,184,0.28), transparent 72%);
}

.funding-card,
.app-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.funding-card:hover,
.app-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
  border-color: var(--accent-soft);
}

.funding-card a:first-child,
.app-card h4 a {
  text-decoration: none;
  color: #171b24;
}

.funding-card a:first-child:hover,
.app-card h4 a:hover {
  color: var(--accent);
  text-decoration: none;
}

.deck-link {
  display: block;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  margin-bottom: 0.85rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.94) 0%, rgba(250,250,250,0.92) 100%);
  box-shadow: 0 6px 16px rgba(18, 24, 39, 0.03);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.deck-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(18, 24, 39, 0.06);
  border-color: var(--accent-soft);
  text-decoration: none;
}


.deck-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.9rem;
  margin-top: 0.5rem;
}

.deck-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 250px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(248,250,253,0.96) 100%);
  box-shadow: 0 12px 30px rgba(18, 24, 39, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.deck-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 38px rgba(18, 24, 39, 0.09);
  border-color: var(--accent-soft);
  text-decoration: none;
}

.deck-thumb {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.35rem;
  min-height: 132px;
  padding: 1rem 1rem 0.95rem 1rem;
  color: var(--accent);
  position: relative;
  overflow: hidden;
}

.deck-thumb::before,
.deck-thumb::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  opacity: 0.5;
  pointer-events: none;
}

.deck-thumb::before {
  width: 180px;
  height: 180px;
  right: -58px;
  top: -72px;
  background: rgba(31,60,136,0.05);
}

.deck-thumb::after {
  width: 120px;
  height: 120px;
  right: 26px;
  bottom: -62px;
  background: rgba(31,60,136,0.04);
}

.thumb-irt {
  background: linear-gradient(135deg, #e9eef8 0%, #f3f6fb 100%);
}

.thumb-practicum {
  background: linear-gradient(135deg, #e8eff2 0%, #f2f6f8 100%);
}

.thumb-cog {
  background: linear-gradient(135deg, #ecebf5 0%, #f5f4fa 100%);
}

.thumb-mlm {
  background: linear-gradient(135deg, #f0edf1 0%, #f7f5f8 100%);
}

.deck-badge,
.deck-thumb-title,
.deck-thumb-sub,
.deck-title,
.deck-meta,
.deck-cta,
.deck-body {
  position: relative;
  z-index: 1;
}

.deck-badge {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: rgba(31,60,136,0.07);
  border: 1px solid rgba(31,60,136,0.14);
  color: var(--accent);
}

.deck-thumb-title {
  font-size: 1.22rem;
  font-weight: 800;
  line-height: 1.1;
}

.deck-thumb-sub {
  font-size: 0.92rem;
  color: var(--muted);
}

.deck-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1rem 1rem 1.05rem 1rem;
}

.deck-title {
  font-weight: 700;
  line-height: 1.35;
  color: #171b24;
}

.deck-meta {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.deck-cta {
  margin-top: auto;
  font-weight: 700;
  color: var(--accent);
}

.app-card p:first-child {
  margin-bottom: 0.9rem;
}

.app-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 720 / 353;
  object-fit: cover;
  border-radius: 14px;
  display: block;
  background: linear-gradient(180deg, #eceff5 0%, #f7f8fb 100%);
  box-shadow: inset 0 0 0 1px rgba(25, 32, 45, 0.06);
}

.app-card h4 {
  margin: 0.95rem 0 0.45rem 0;
  font-size: 1.05rem;
  line-height: 1.35;
}

.app-card p:last-child,
.funding-card p:last-child,
.panel-card p:only-of-type {
  color: var(--muted);
  margin-bottom: 0;
}

.contact-card a {
  text-decoration: none;
}

@media (max-width: 850px) {
  
  .deck-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.9rem;
  margin-top: 0.5rem;
}
}



/* --- Safer mobile Safari fixes --- */
@media (max-width: 700px) {
  .deck-gallery {
    grid-template-columns: 1fr;
  }

  .deck-card {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }

  .panel-card {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* footer: small, quiet, centered legal links */
.nav-footer {
  background: transparent;
  border-top: none;
  padding: 1.2rem 0 1.6rem 0;
}
.nav-footer .nav-footer-center {
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
}
.nav-footer a { color: var(--muted); text-decoration: none; }
.nav-footer a:hover { color: var(--accent); text-decoration: underline; }

/* contact card: only as wide as the address, not a mostly empty full-width block */
.panel-card.contact-card {
  width: fit-content;
  max-width: 100%;
  min-width: 260px;
  padding-right: 2.6rem;
}
.contact-card p { margin: 0; }

/* teaching deck cards: equal heights per row */
.deck-gallery > p { display: contents; }
.deck-gallery { align-items: stretch; }

/* accessibility: visible keyboard focus, skip link */
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
.app-card:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-card);
}
.deck-card:focus-visible { outline-offset: 2px; border-radius: 18px; }
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.5rem;
  z-index: 3000;
  padding: 0.6rem 1rem;
  background: #fff;
  color: var(--accent);
  border: 2px solid var(--accent);
  border-radius: 8px;
  font-weight: 600;
}
.skip-link:focus { left: 1rem; }

/* hero: name, role and the few most-used links at the top of the page */
.hero {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin: 0.4rem 0 1.6rem 0;
}
.hero-photo {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 4px #fff, 0 10px 26px rgba(22, 28, 45, 0.12);
}
.hero-title {
  margin: 0;
  font-size: clamp(1.3rem, 1.8vw, 1.6rem);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.hero-role { margin: 0.2rem 0 0.5rem 0; color: var(--muted); font-size: 0.95rem; }
.hero-links { margin: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.3rem; }
.hero-links a { text-decoration: none; font-weight: 500; padding: 0.2rem 0; }
.hero-links a:hover { text-decoration: underline; }

/* comfortable touch / click targets for the card titles (WCAG 2.2: 24 px) */
.app-card h4 a { display: inline-block; padding: 0.2rem 0; min-height: 24px; }
