:root {
  --bg: #0b0f17;
  --panel: #121a26;
  --text: #e8eefc;
  --muted: #a8b3cf;
  --line: #22304a;
  --accent: #7aa2ff;
  --accent2: #59d1b6;
  --shadow: 0 12px 30px rgba(0,0,0,.35);
  --radius: 16px;
  --max: 980px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;

  /* NEW: fluid spacing scale */
  --space-1: clamp(8px, 1.2vw, 12px);
  --space-2: clamp(12px, 1.8vw, 18px);
  --space-3: clamp(16px, 2.4vw, 26px);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

html { font-size: 16px; }

body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(circle at top center, rgba(122,162,255,.18), transparent 60%),
    linear-gradient(180deg, #0b0f17, #0b0f17);
  color: var(--text);
  /* improved readable line-height for long content */
  line-height: 1.65;

  /* NEW: prevent accidental horizontal scroll on small screens */
  overflow-x: hidden;

  /* NEW: better text rendering + mobile text sizing */
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* UPDATED: container padding becomes fluid */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--space-2);
}

/* Constrain measure for long passages to improve readability */
.container > * {
  max-width: 72ch;
  margin-left: auto;
  margin-right: auto;
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(11,15,23,.72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(34,48,74,.6);
}

/* UPDATED: gap so items don’t squeeze */
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: var(--space-1);
}

.brand {
  font-weight: 800;
  letter-spacing: .4px;
  text-decoration: none;
}

/* NEW: nav uses flex + wraps (prevents overflow) */
.nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav a {
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--muted);
  white-space: nowrap;
}
.nav a[aria-current="page"] { color: var(--text); background: rgba(34,48,74,.35); }
.nav a:hover { color: var(--text); background: rgba(34,48,74,.35); }

/* Hero */
.hero { padding: clamp(40px, 6vw, 64px) 0 clamp(18px, 3vw, 28px); }

.hero h1 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.12;
  margin: 0 0 12px;
}

/* NEW: fluid type for subtext */
.lead {
  color: var(--muted);
  font-size: clamp(1rem, 1.2vw, 1.05rem);
  max-width: 64ch;
  margin-bottom: var(--space-2);
}

/* NEW: global heading scaling (helps other pages) */
h1 { font-size: clamp(26px, 3.4vw, 40px); margin: 0 0 12px; font-weight: 700; }
h2 { font-size: clamp(20px, 2.4vw, 28px); margin: 0 0 12px; font-weight: 700; }
h3 { font-size: clamp(18px, 2vw, 22px); margin: 0 0 10px; font-weight: 600; }
p, li { font-size: clamp(15px, 1.2vw, 16.5px); line-height: 1.65; }

/* Ensure paragraphs have breathing room */
p { margin-bottom: 1rem; }

/* Sections */
.section { padding: var(--space-3) 0 clamp(10px, 1.6vw, 14px); }

/* Card */
.card {
  background: linear-gradient(180deg, rgba(18,26,38,.92), rgba(18,26,38,.72));
  border: 1px solid rgba(34,48,74,.65);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-body { padding: var(--space-3); }
.card-title { margin: 6px 0 10px; }

/* Avatar inside roster cards */
.card-body .avatar {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
  margin-bottom: 12px;
  border: 1px solid rgba(34,48,74,.7);
}

/* Amor photo gallery */
/*.photo-gallery {
  /* horizontal, scrollable gallery for each person 
  display: flex;
  gap: auto;
  margin-top: 20px;
  overflow-x: 15px;;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
}
/*.photo-gallery a {
  width: 100%;
  height: auto;
}

.photo-gallery img {
  width: 100%;
  height: auto;
  object-fit: contain;
  background: #0b1220; /* optional: fills empty space nicely 
  
}
.photo-gallery a {
  flex: 0 0 auto;
  scroll-snap-align: center;
  display: block;
  width: 100%;
  height: auto;
}
.photo-gallery img {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  display: block;
  border: 1px solid rgba(34,48,74,.65);
  cursor: pointer;
} */
.photo-gallery {
  display: flex;
  gap: 16px;
  margin-top: 20px;
  overflow-x: auto;
  padding-bottom: 10px;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
}

.photo-gallery a {
  flex: 0 0 auto;
  width: 260px;
  height: 200px;
  scroll-snap-align: center;
  display: block;
}

.photo-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  border-radius: 14px;
  display: block;
}

@media (max-width: 960px) {
  .photo-gallery a { width: 220px; height: 140px; }
}
@media (max-width: 760px) {
  .photo-gallery a { width: 180px; height: 120px; }
}
@media (max-width: 420px) {
  .photo-gallery a { width: 160px; height: 110px; }
}

/* Homepage logo sizing inside the hero card */
.logo-card .card-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  width: min(320px, 48vw);
}

@media (max-width: 760px) {
  .logo-card .card-body img { width: min(220px, 60vw); }
}

/* Site header logo */
.site-logo { height: 34px; width: auto; vertical-align: middle; margin-right: 8px; }

/* Footer social links */
.footer-social {
  display: flex; gap: 12px; align-items: center;
}
.footer-social a { color: var(--muted); text-decoration: none; }
.footer-social a:hover { color: var(--text); }

.eyebrow {
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .78rem;
}

.muted { color: var(--muted); }
.stack { display: grid; gap: 14px; }

/* Grid */
.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(12, 1fr);
}
.grid > .card { grid-column: span 6; }

@media (max-width: 760px) {
  .grid > .card { grid-column: span 12; }
}

/* Buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(34,48,74,.9);
  background: rgba(122,162,255,.18);
  text-decoration: none;
  color: var(--text);

  /* NEW: mobile tap target */
  min-height: 44px;
}

.button:hover { transform: translateY(-1px); }
.button-ghost { background: rgba(34,48,74,.18); }
.button-small { padding: 8px 10px; border-radius: 10px; font-size: .92rem; }

.cta-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.card-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

/* Link grid */
.link-grid {
  list-style: none; padding: 0; margin: 12px 0 0;
  display: grid; gap: 10px;
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 760px) { .link-grid { grid-template-columns: repeat(2, 1fr); } }

/* NEW: single-column fallback for very small screens */
@media (max-width: 420px) {
  .link-grid { grid-template-columns: 1fr; }
}

.link-card {
  display: block;
  padding: 14px;
  border-radius: 14px;
  background: rgba(34,48,74,.20);
  border: 1px solid rgba(34,48,74,.65);
  text-decoration: none;
  text-align: center;
  color: var(--text);
}
.link-card:hover { background: rgba(34,48,74,.32); }

/* Pills */
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.pill {
  font-size: .82rem;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(34,48,74,.8);
  background: rgba(89,209,182,.10);
  color: var(--text);
}

/* Details/List */
.details { margin-top: 12px; }
.details summary { cursor: pointer; color: var(--accent); }
.list { margin: 10px 0 0; padding-left: 18px; }

/* More readable list spacing */
.list li { margin-bottom: 0.5rem; }
.list ul { margin-top: 0.5rem; }

/* Improve link contrast inside content and make links more discoverable */
.card-body a, .lead a, p a {
  color: var(--accent);
  text-decoration: underline;
}

/* Focus outlines for keyboard users */
.nav a:focus, .button:focus, .card-body a:focus, .photo-gallery a:focus {
  outline: 3px solid rgba(89,209,182,0.18);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px rgba(122,162,255,0.06);
}

/* Page head + inputs */
.page-head { display: grid; gap: 10px; margin-bottom: 14px; }

.input {
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(34,48,74,.8);
  background: rgba(18,26,38,.65);
  color: var(--text);
  outline: none;
}
.input::placeholder { color: rgba(168,179,207,.75); }

/* Footer */
.site-footer {
  margin-top: 36px;
  border-top: 1px solid rgba(34,48,74,.6);
  padding: 22px 0;
  background: rgba(11,15,23,.55);
}
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* In-page TOC styles */
.inpage-toc { margin: 12px 0 18px; padding: 10px 12px; border-radius: 10px; background: rgba(34,48,74,.18); border: 1px solid rgba(34,48,74,.35); }
.inpage-toc ul { margin: 8px 0 0; padding-left: 18px; }
.inpage-toc a { color: var(--accent); text-decoration: none; }
.inpage-toc a:hover, .inpage-toc a:focus { text-decoration: underline; }

/* Print / PDF friendly styles */
@media print {
  :root { color-scheme: light; }
  body { background: #fff; color: #000; }
  .site-header, .site-footer, .nav, .cta-row, .button { display: none !important; }
  .container { max-width: 720px; padding: 0; }
  .card { border: none; box-shadow: none; background: transparent; }
  .inpage-toc { page-break-after: avoid; }
  img { max-width: 100%; height: auto; }
  a::after { content: " (" attr(href) ")"; font-size: 0.9em; }
}

/* =========================
   NEW: Mobile layout polish
   ========================= */
@media (max-width: 520px) {
  /* stack header nicely */
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav {
    width: 100%;
    justify-content: flex-start;
  }

  /* buttons fill available width when grouped */
  .cta-row, .card-actions { width: 100%; }
  .cta-row a, .card-actions a { flex: 1 1 auto; }

  /* tighter spacing */
  .hero { padding: 44px 0 18px; }
  .section { padding: 18px 0; }
}
