/* ═══════════════════════════════════════════════
   LISSD — main.css
   Custom classes that supplement Tailwind CDN.
   Tailwind handles layout/spacing/color utilities
   in HTML; this file handles what Tailwind can't:
   pseudo-elements, transitions, animations, and
   components with no Tailwind classes in the HTML.
═══════════════════════════════════════════════ */

/* ── Custom Properties ──────────────────────── */
:root {
  --forest:      #14274E;
  --forest-dark: #0A1930;
  --forest-light:#2E4C7A;
  --gold:        #2563EB;
  --gold-light:  #3B82F6;
  --ivory:       #FFFFFF;
  --sage:        #EEF2F8;
  --transition-reveal: 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Global Typography ──────────────────────── */
p {
  font-size: 1rem;
  line-height: 1.75;
}

li {
  font-size: 1rem;
}

/* ── Navigation ─────────────────────────────── */
.nav-link {
  position: relative;
  font-size: 1rem;
  font-weight: 500;
  color: var(--forest);
  padding-bottom: 2px;
  transition: color 200ms ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--gold);
  transition: width 200ms ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link.active {
  font-weight: 600;
  color: var(--forest);
}

.nav-link:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
  border-radius: 2px;
}

.mobile-nav-link {
  display: block;
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--ivory);
  padding: 0.25rem 0;
  transition: color 200ms ease;
}

.mobile-nav-link:hover {
  color: var(--gold-light);
}

.mobile-nav-link:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
  border-radius: 2px;
}

.hamburger-line {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--forest);
  border-radius: 2px;
  transition: background 200ms ease, transform 250ms ease, opacity 200ms ease;
}

/* Animate hamburger into an X when the mobile menu is open */
#menu-toggle.open .hamburger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
#menu-toggle.open .hamburger-line:nth-child(2) {
  opacity: 0;
}
#menu-toggle.open .hamburger-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ── Mobile Menu ────────────────────────────── */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  visibility: hidden;
  transition: max-height 400ms cubic-bezier(0.16, 1, 0.3, 1),
              visibility 400ms;
}

.mobile-menu.open {
  max-height: 480px;
  visibility: visible;
}

/* ── Sticky Header ──────────────────────────── */
#site-header {
  background: transparent;
}

/* Transparent state (over dark hero) — all nav text must be light */
#site-header:not(.scrolled) nav > a > div > div:first-child {
  color: var(--ivory);
}
#site-header:not(.scrolled) nav > a > div > div:last-child {
  color: rgba(255, 255, 255, 0.55);
}

#site-header:not(.scrolled) .nav-link {
  color: rgba(255, 255, 255, 0.75);
}

#site-header:not(.scrolled) .nav-link:hover,
#site-header:not(.scrolled) .nav-link.active {
  color: var(--ivory);
}

#site-header:not(.scrolled) .hamburger-line {
  background: var(--ivory);
}

#site-header.scrolled {
  background: var(--forest-dark);
  box-shadow: 0 1px 12px rgba(0, 0, 0, 0.2);
}

/* Scrolled state — wordmark must also be light */
#site-header.scrolled nav > a > div > div:first-child {
  color: var(--ivory);
}
#site-header.scrolled nav > a > div > div:last-child {
  color: rgba(255, 255, 255, 0.5);
}

#site-header.scrolled .nav-link {
  color: rgba(255, 255, 255, 0.85);
}

#site-header.scrolled .nav-link:hover,
#site-header.scrolled .nav-link.active {
  color: var(--ivory);
}

#site-header.scrolled .hamburger-line {
  background: var(--ivory);
}

/* Keep gold underline on all nav states */
#site-header .nav-link::after {
  background: var(--gold);
}

/* ── Hero ───────────────────────────────────── */
.hero-section {
  /* Layout handled by Tailwind; hook for future additions */
}

.hero-bg {
  background-color: var(--forest-dark);
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 60px,
      rgba(255, 255, 255, 0.015) 60px,
      rgba(255, 255, 255, 0.015) 61px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 80px,
      rgba(255, 255, 255, 0.010) 80px,
      rgba(255, 255, 255, 0.010) 81px
    );
}

.scroll-indicator {
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { transform: scaleY(1);   opacity: 0.4; }
  50%       { transform: scaleY(0.6); opacity: 0.8; }
}

/* ── Section Labels ─────────────────────────── */
.section-label {
  display: inline-flex;
  align-items: center;
  font-family: 'Space Mono', monospace;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--forest);
  background: var(--sage);
  padding: 0.375rem 0.875rem;
  border-radius: 100px;
  border: 1px solid rgba(20, 39, 78, 0.15);
}

.section-label-light {
  display: inline-flex;
  align-items: center;
  font-family: 'Space Mono', monospace;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold-light);
  background: rgba(37, 99, 235, 0.15);
  padding: 0.375rem 0.875rem;
  border-radius: 100px;
  border: 1px solid rgba(37, 99, 235, 0.25);
}

/* ── Interior Page Hero ─────────────────────── */
.page-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--forest-dark) 0%, var(--forest) 100%);
  padding-top: 9rem;
  padding-bottom: 5rem;
}

.page-hero::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  border: 1px solid rgba(37, 99, 235, 0.12);
  pointer-events: none;
}

.page-hero::after {
  content: '';
  position: absolute;
  bottom: -40px;
  left: 10%;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 1px solid rgba(37, 99, 235, 0.08);
  pointer-events: none;
}

/* ── Component Cards ────────────────────────── */

/* Fellowship detail stats (homepage — no Tailwind classes in HTML) */
.fellowship-detail-card {
  background: rgba(46, 76, 122, 0.3);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 4px;
  padding: 1.25rem;
}

/* Niche/differentiator cards (homepage — no Tailwind classes in HTML) */
.niche-card {
  padding: 1.75rem;
  background: var(--sage);
  border-radius: 2px;
  border-top: 2px solid transparent;
  transition: border-color 200ms ease;
}

.niche-card:hover {
  border-top-color: var(--gold);
}

/* Publication type badge */
.pub-tag {
  display: inline-block;
  font-family: 'Space Mono', monospace;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 0.625rem;
  border-radius: 2px;
}

/* Semantic hooks — Tailwind handles visuals in HTML */
.program-card      { transition: box-shadow 300ms ease; }
.pub-card          { display: block; }
.pub-card-featured { isolation: isolate; }
.donor-tier-card   { transition: border-color 200ms ease; }
.donor-card-full   { display: block; }
.value-item        { transition: border-color 200ms ease; }

/* ── Contact Form ───────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #4A5568;
  letter-spacing: 0.02em;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: #1C1C1E;
  background: var(--ivory);
  border: 1px solid rgba(74, 85, 104, 0.25);
  border-radius: 2px;
  transition: border-color 200ms ease, box-shadow 200ms ease;
  appearance: auto;
}

.form-input:focus,
.form-input:focus-visible {
  outline: none;
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(20, 39, 78, 0.1);
}

/* ── Footer ─────────────────────────────────── */
.footer-link {
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.5);
  transition: color 200ms ease;
}

.footer-link:hover {
  color: var(--gold-light);
}

.footer-link:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.5);
  transition: color 200ms ease, border-color 200ms ease;
}

.social-icon:hover {
  color: var(--gold-light);
  border-color: var(--gold-light);
}

.social-icon:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* ── Scroll Reveal Animations ───────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--transition-reveal), transform var(--transition-reveal);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 100ms; }
.reveal-delay-2 { transition-delay: 250ms; }
.reveal-delay-3 { transition-delay: 400ms; }
