/* ═══════════════════════════════════════
   AI Vision Assistant — Vision-Aid design system
   (matched to aitutor.visionaid.org/academy)
   ═══════════════════════════════════════ */

:root {
  /* Brand */
  --va-navy:       #0D2137;
  --va-navy-mid:   #152D45;
  --va-blue:       #1A6FB5;
  --va-blue-light: #2B8FD4;
  --va-teal:       #17A2B8;
  --va-gold:       #E8A838;
  --va-gold-light: #F5C563;
  --va-green:      #16A34A;
  --va-red:        #DC2626;
  --va-orange:     #D97706;

  /* Surfaces */
  --bg:            #F7F9FC;
  --bg-warm:       #FAFBFE;
  --surface:       #FFFFFF;
  --surface-hover: #F0F4FA;
  --surface-alt:   #EDF2F7;

  /* Text */
  --text:          #1A202C;
  --text-secondary:#4A5568;
  --text-muted:    #64748B;
  --text-on-dark:  #F7FAFC;
  --text-on-brand: #FFFFFF;

  /* Borders */
  --border:        #E2E8F0;
  --border-strong: #CBD5E0;

  /* Focus — high visibility gold */
  --focus-ring:    #D69E2E;
  --focus-bg:      rgba(214,158,46,0.12);

  /* Radii */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(13,33,55,0.06), 0 1px 2px rgba(13,33,55,0.04);
  --shadow-md: 0 4px 12px rgba(13,33,55,0.08), 0 2px 4px rgba(13,33,55,0.04);
  --shadow-lg: 0 12px 32px rgba(13,33,55,0.12), 0 4px 8px rgba(13,33,55,0.06);

  /* Fonts */
  --font-body:    'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'DM Serif Display', Georgia, 'Times New Roman', serif;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 150ms;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--va-blue); }
a:hover { color: var(--va-blue-light); }

/* ── Accessibility ── */

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--focus-bg);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  background: var(--va-gold);
  color: var(--va-navy);
  padding: 12px 20px;
  border-radius: var(--r-md);
  font-weight: 700;
  font-size: 16px;
  z-index: 10000;
  text-decoration: none;
  box-shadow: var(--shadow-lg);
}
.skip-link:focus { left: 12px; }

/* ── Header ── */

.site-header {
  background: var(--va-navy);
  color: var(--text-on-dark);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  min-height: 72px;
  padding-top: 8px;
  padding-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}
.brand:hover { opacity: 0.92; color: inherit; }

.brand-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  padding: 3px;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.brand-name {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.3px;
  color: #fff;
}
.brand-sub {
  font-size: 14px;
  font-weight: 500;
  color: var(--va-gold-light);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}
.header-nav ul {
  display: flex;
  align-items: center;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav-link {
  white-space: nowrap;
  color: var(--text-on-dark);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  transition: background var(--t-fast) var(--ease);
}
.nav-link:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

/* ── Hero ── */

.hero {
  background: radial-gradient(circle at 20% 20%, var(--va-navy-mid), var(--va-navy) 70%);
  color: var(--text-on-dark);
  padding: 64px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  width: 340px; height: 340px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.06);
  top: -100px; right: -80px;
}
.hero::after {
  content: '';
  position: absolute;
  width: 260px; height: 260px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.04);
  bottom: -60px; left: -40px;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
}

.hero-logo {
  width: 100px;
  height: 100px;
  object-fit: contain;
  margin: 0 auto 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  padding: 8px;
  display: block;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 400;
  color: #fff;
  margin: 0 0 6px;
  line-height: 1.2;
}

.hero-tagline {
  color: var(--va-gold-light);
  font-size: 18px;
  margin: 20px 0 10px;
  line-height: 1.5;
  font-weight: 500;
}

/* ── Main content ── */

.page-main {
  flex: 1;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

.content-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 32px;
  margin-bottom: 28px;
}

.content-card h2,
.content-card h3 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--va-navy);
  margin-top: 0;
}
.content-card h2 { font-size: 28px; }
.content-card h3 { font-size: 22px; }

.content-card p {
  color: var(--text-secondary);
}

/* ── Keyboard shortcuts ── */

.shortcut-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.shortcut-list li {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  flex-wrap: wrap;
}
.shortcut-list li:last-child { border-bottom: none; }

.keys {
  font-weight: 700;
  color: var(--va-navy);
  background: var(--surface-alt);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  padding: 4px 10px;
  font-size: 14px;
  white-space: nowrap;
}

/* ── Buttons ── */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--va-blue);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  padding: 16px 28px;
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--t-fast) var(--ease);
  box-shadow: 0 2px 8px rgba(26,111,181,0.25);
}
.btn-primary:hover {
  background: #1862A0;
  box-shadow: 0 4px 16px rgba(26,111,181,0.35);
  transform: translateY(-1px);
  color: #fff;
}
.btn-primary:active { transform: translateY(0); }

.btn-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--va-gold);
  color: var(--va-navy);
  border: none;
  border-radius: var(--r-md);
  padding: 16px 28px;
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--t-fast) var(--ease);
  box-shadow: 0 2px 8px rgba(232,168,56,0.35);
}
.btn-gold:hover {
  background: var(--va-gold-light);
  box-shadow: 0 4px 16px rgba(232,168,56,0.45);
  transform: translateY(-1px);
  color: var(--va-navy);
}
.btn-gold:active { transform: translateY(0); }

.btn-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.note {
  background: var(--focus-bg);
  border-left: 4px solid var(--va-gold);
  border-radius: var(--r-sm);
  padding: 12px 16px;
  color: var(--text-secondary);
  font-size: 15px;
}

/* ── Footer ── */

.site-footer {
  background: var(--va-navy);
  color: rgba(255,255,255,0.7);
  padding: 28px 24px;
  margin-top: auto;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-brand {
  font-size: 13px;
  margin: 0;
  line-height: 1.6;
}
.footer-brand strong { color: #fff; }
.footer-links { margin: 0; }
.footer-links a {
  color: var(--va-gold-light);
  font-size: 13px;
  text-decoration: none;
  font-weight: 600;
}
.footer-links a:hover { color: var(--va-gold); text-decoration: underline; }

/* ── Responsive ── */

@media (max-width: 768px) {
  .header-inner {
    height: auto;
    flex-direction: column;
    padding: 12px 16px;
    gap: 8px;
  }
  .header-nav ul { flex-wrap: wrap; justify-content: center; gap: 8px; }
  .hero { padding: 40px 20px; }
  .hero-title { font-size: 28px; }
  .hero-logo { width: 72px; height: 72px; }
  .page-main { padding: 32px 16px 48px; }
  .content-card { padding: 22px 18px; }
  .btn-row { flex-direction: column; align-items: stretch; }
  .footer-inner { flex-direction: column; text-align: center; }
}

/* ── Multi-page additions ── */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.nav-link[aria-current="page"] {
  background: rgba(255,255,255,0.14);
  color: var(--va-gold-light);
}

.hero-compact { padding: 40px 24px; }
.hero-compact .hero-title { font-size: 34px; }

.section-intro {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--va-navy);
  font-size: 26px;
  margin: 0 0 24px;
}
p.section-intro {
  font-family: var(--font-body);
  font-size: 17px;
  color: var(--text-secondary);
}

.stories-section {
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--border-strong);
}
.section-lead {
  color: var(--text-secondary);
  margin: -12px 0 24px;
}

.card-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}
.page-card {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}
.page-card h3 { font-size: 24px; margin-bottom: 8px; }
.page-card p { flex: 1; }
.page-card .btn-row { margin-top: 16px; flex: 0; }

.back-row { margin: 8px 0 0; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  text-decoration: none;
  padding: 8px 4px;
}
.back-link::before { content: "\2190"; }
.back-link:hover { text-decoration: underline; }

.refs {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px 20px;
}
.refs ul { margin: 0; padding-left: 20px; }
.refs li { margin-bottom: 6px; color: var(--text-secondary); }
.refs li:last-child { margin-bottom: 0; }

@media (max-width: 768px) {
  .hero-compact { padding: 28px 16px; }
  .hero-compact .hero-title { font-size: 26px; }
  .card-grid { grid-template-columns: 1fr; }
}

/* Keep anchored story headings clear of the sticky header. */
.content-card h2[id^="story-"] { scroll-margin-top: 150px; }

.video-card { margin-bottom: 40px; }
.intro-video {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 560px;
  margin: 8px auto 0;
  border-radius: var(--r-md);
  background: #000;
}
