/* 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: white;
  position: relative;
  overflow: hidden;
}

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

.deck-thumb::before {
  width: 180px;
  height: 180px;
  right: -58px;
  top: -72px;
  background: rgba(255,255,255,0.34);
}

.deck-thumb::after {
  width: 120px;
  height: 120px;
  right: 26px;
  bottom: -62px;
  background: rgba(255,255,255,0.18);
}

.thumb-irt {
  background: linear-gradient(135deg, #183c88 0%, #5879cf 58%, #9bb3ea 100%);
}

.thumb-practicum {
  background: linear-gradient(135deg, #31586a 0%, #3d8c85 56%, #91d3be 100%);
}

.thumb-cog {
  background: linear-gradient(135deg, #5a2f7a 0%, #8a4dc2 55%, #d3b5f5 100%);
}

.thumb-mlm {
  background: linear-gradient(135deg, #7a3b2f 0%, #b66c45 56%, #f0c38e 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(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.22);
}

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

.deck-thumb-sub {
  font-size: 0.92rem;
  opacity: 0.92;
}

.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: 176px;
  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:last-child {
  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;
  }
}
