/* BridgePoint Grants & Technology - Design Tokens & Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Color Tokens */
  --brand: #0A2540;
  --brand-deep: #06182B;
  --brand-surface: #0F3254;
  --brand-soft: #F0F6FC;
  --brand-on-dark: #38BDF8;
  
  --cta: #F59E0B;
  --cta-hover: #D97706;
  --cta-press: #B45309;
  --cta-ink: #0A2540;
  
  --accent-cyan: #0EA5E9;
  --accent-cyan-soft: #E0F2FE;
  --accent-emerald: #10B981;
  --accent-emerald-soft: #ECFDF5;
  
  --ink: #0F172A;
  --ink-secondary: #334155;
  --muted: #64748B;
  --muted-light: #94A3B8;
  
  --bg: #FFFFFF;
  --surface: #F8FAFC;
  --surface-alt: #F1F5F9;
  --surface-card: #FFFFFF;
  --line: #E2E8F0;
  --line-strong: #CBD5E1;
  --line-dark: rgba(255, 255, 255, 0.12);
  
  /* Typography */
  --font-display: 'Outfit', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Shapes & Radius */
  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-2xl: 32px;
  --r-pill: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(10, 37, 64, 0.05);
  --shadow-md: 0 4px 12px rgba(10, 37, 64, 0.08);
  --shadow-lg: 0 12px 30px rgba(10, 37, 64, 0.12);
  --shadow-cta: 0 8px 24px color-mix(in srgb, var(--cta) 35%, transparent);
  --shadow-glow: 0 0 35px rgba(14, 165, 233, 0.25);
  
  /* Provisional BridgePoint motion tokens — calm, precise, architectural. */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur: 0.8s;
  --dur-fast: 0.3s;
  --dist: 28px;
  --t-hover: 0.25s;
  
  /* Layout */
  --gutter: clamp(16px, 4vw, 32px);
  --maxw: 1280px;
  --section-y: clamp(60px, 8vw, 110px);
}

/* Base Setup */
html {
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--bg);
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  overflow-x: clip;
  min-width: 320px;
}

h1, h2, h3, h4, .font-display {
  font-family: var(--font-display);
  letter-spacing: -0.025em;
}

/* Language Engine Switcher Styles */
[data-lang-content="es"] {
  display: none !important;
}

html[data-current-lang="es"] [data-lang-content="en"] {
  display: none !important;
}

html[data-current-lang="es"] [data-lang-content="es"] {
  display: inherit !important;
}

html[data-current-lang="es"] blockquote[data-lang-content="es"],
html[data-current-lang="es"] div[data-lang-content="es"],
html[data-current-lang="es"] p[data-lang-content="es"],
html[data-current-lang="es"] h1[data-lang-content="es"],
html[data-current-lang="es"] h2[data-lang-content="es"],
html[data-current-lang="es"] h3[data-lang-content="es"],
html[data-current-lang="es"] h4[data-lang-content="es"],
html[data-current-lang="es"] section[data-lang-content="es"],
html[data-current-lang="es"] ul[data-lang-content="es"] {
  display: block !important;
}

html[data-current-lang="es"] span[data-lang-content="es"],
html[data-current-lang="es"] strong[data-lang-content="es"],
html[data-current-lang="es"] a[data-lang-content="es"] {
  display: inline !important;
}

html[data-current-lang="es"] .flex[data-lang-content="es"] {
  display: flex !important;
}

html[data-current-lang="es"] .grid[data-lang-content="es"] {
  display: grid !important;
}

/* Lang Switcher Pill */
.lang-toggle-btn {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: var(--r-pill);
  transition: all var(--t-hover) var(--ease);
  color: var(--muted);
}
.lang-toggle-btn.active {
  background: var(--brand);
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(10, 37, 64, 0.2);
}

/* Capsule Desktop Navigation Menu */
.nav-capsule {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(241, 245, 249, 0.85);
  padding: 4px 6px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(203, 213, 225, 0.6);
  box-shadow: 0 1px 3px rgba(10, 37, 64, 0.04);
}

.nav-capsule a {
  padding: 6px 13px;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: var(--r-pill);
  color: #475569;
  transition: all var(--t-hover) var(--ease);
  white-space: nowrap;
}

.nav-capsule a:hover {
  color: var(--brand);
  background: #FFFFFF;
  box-shadow: 0 2px 6px rgba(10, 37, 64, 0.06);
}

/* Primary CTA Button Component */
.btn-cta-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  padding: 0.875rem 1.75rem;
  background-color: var(--cta);
  color: var(--cta-ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-cta);
  transition: transform var(--t-hover) var(--ease),
              background-color var(--t-hover) var(--ease),
              box-shadow var(--t-hover) var(--ease);
  cursor: pointer;
}

.btn-cta-primary:hover {
  background-color: var(--cta-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--cta) 42%, transparent);
}

.btn-cta-primary:active {
  background-color: var(--cta-press);
  transform: translateY(0);
}

.btn-cta-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  padding: 0.875rem 1.75rem;
  background-color: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--r-md);
  backdrop-filter: blur(8px);
  transition: all var(--t-hover) var(--ease);
}

.btn-cta-secondary:hover {
  background-color: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
}

/* Cards & Surfaces */
.bp-card {
  background-color: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-hover) var(--ease),
              box-shadow var(--t-hover) var(--ease),
              border-color var(--t-hover) var(--ease);
}

.bp-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--line-strong);
}

/* Background Gradients & Grid Motifs */
.bg-radial-grid {
  background-image: radial-gradient(rgba(14, 165, 233, 0.15) 1px, transparent 1px);
  background-size: 28px 28px;
}

.bg-dot-matrix-gold {
  background-image: radial-gradient(rgba(245, 158, 11, 0.18) 1.2px, transparent 1.2px);
  background-size: 20px 20px;
}

/* Signature Brand Graphic: Arch Conduit */
.bridge-line-pulse {
  stroke-dasharray: 8 6;
  animation: lineDash 24s linear infinite;
}

@keyframes lineDash {
  to {
    stroke-dashoffset: -200;
  }
}

/* Program Financial Tables */
.grant-program-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.grant-program-table tr {
  border-bottom: 1px solid var(--line);
}

.grant-program-table tr:last-child {
  border-bottom: none;
}

.grant-program-table td {
  padding: 0.875rem 0;
  vertical-align: middle;
}

.grant-program-table .td-label {
  font-size: 0.8125rem;
  color: var(--muted);
  font-weight: 500;
}

.grant-program-table .td-val {
  text-align: right;
  font-weight: 700;
  font-size: 0.9375rem;
}

/* Accessible focus ring */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 3px;
}

/* =========================================================================
   Native, accessible motion — no CDN and nothing hidden without JS.
   ========================================================================= */
.js.motion-ready :is(.reveal-init,.reveal-left,.reveal-right,.reveal-scale) {
  opacity: 0;
  translate: 0 var(--dist);
  transition: opacity var(--dur) var(--ease), translate calc(var(--dur) * 1.1) var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}
.js.motion-ready .reveal-left { translate: calc(-1 * var(--dist)) 0; }
.js.motion-ready .reveal-right { translate: var(--dist) 0; }
.js.motion-ready .reveal-scale { scale: .975; translate: 0 8px; }
.js.motion-ready :is(.reveal-init,.reveal-left,.reveal-right,.reveal-scale).is-revealed {
  opacity: 1;
  translate: 0 0;
  scale: 1;
}
/* Sticky Header Scroll Active State */
header.header-scrolled {
  box-shadow: 0 4px 20px rgba(10, 37, 64, 0.08);
  border-bottom-color: rgba(203, 213, 225, 0.8);
}

/* Step Connector Line Animation */
.step-connecting-line {
  position: absolute;
  top: 36px;
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(90deg, #0EA5E9, #F59E0B, #10B981, #A855F7);
  opacity: 0.3;
  z-index: 0;
}

/* Reduced Motion Guard */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal-init, .reveal-left, .reveal-right, .reveal-scale {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .bridge-line-pulse {
    animation: none !important;
  }
}


/* ===== BridgePoint 1.c refinements ===== */
:root {
  --nav-h: 80px;
  /* provisional palette retained from the supplied website until final brand tokens arrive */
  --ease: cubic-bezier(.25,1,.5,1);
  --ease-io: cubic-bezier(.76,0,.24,1);
  --ease-pop: var(--ease);
  --dur: .74s;
  --dist: 18px;
  --t-hover: .32s;
}
body { isolation: isolate; }
main section[id] { scroll-margin-top: var(--nav-h); }
.skip-link { position: fixed; z-index: 300; top: 10px; left: 10px; padding: 12px 18px; background: white; color: var(--brand); border-radius: 10px; font-weight: 700; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.nav-capsule a.is-active, .nav-capsule a[aria-current="location"] { background: #fff; color: var(--brand); box-shadow: var(--shadow-sm); }
.lang-toggle-btn { cursor: pointer; }
.lang-toggle-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.brand-symbol { transform-origin: center; transition: rotate .5s var(--ease), scale .5s var(--ease); }
@media (hover:hover) { a:hover .brand-symbol { rotate: -5deg; scale: 1.04; } }
/* Provisional brand's arch/conduit line is the motion motif, never a forced preloader. */
.hero-showcase { isolation: isolate; }
.hero-showcase > div { position: relative; z-index: 2; }
.hero-bridge-trace { position:absolute; inset:-11% -12%; width:124%; height:124%; overflow:visible; z-index:1; pointer-events:none; }
.hero-bridge-trace__path { stroke: color-mix(in srgb, var(--brand-on-dark) 40%, transparent); stroke-width:2.2; stroke-linecap:round; }
.hero-bridge-trace__path--secondary { stroke: color-mix(in srgb, var(--cta) 45%, transparent); stroke-width:1.4; }
.hero-showcase img { aspect-ratio: 3/2; object-fit:cover; }
/* Step progression advances during reading, only on desktop. */
.step-connecting-line { overflow: hidden; background: color-mix(in srgb,var(--line-strong) 70%,transparent); opacity: 1; }
.step-line-progress { display:block; width:100%; height:100%; background: linear-gradient(90deg,var(--accent-cyan),var(--cta),var(--accent-emerald)); transform:scaleX(0); transform-origin:left; }
/* Mobile navigation: overlay and panel slide independently. Closed drawer is inert and non-interactive. */
.mobile-drawer { position:fixed; inset:0; z-index:80; background:rgba(4,15,29,.66); opacity:0; visibility:hidden; pointer-events:none; transition:opacity .38s var(--ease),visibility .38s; }
.mobile-drawer__panel { width:min(380px,88vw); height:100%; margin-left:auto; padding:24px; background:#fff; box-shadow:-12px 0 35px rgba(0,0,0,.16); display:flex; flex-direction:column; justify-content:space-between; overflow-y:auto; overscroll-behavior:contain; transform:translateX(105%); transition:transform .48s var(--ease-io); }
.mobile-drawer.is-open { opacity:1; visibility:visible; pointer-events:auto; }
.mobile-drawer.is-open .mobile-drawer__panel { transform:none; }
body.menu-open { overflow:hidden; }
@media (min-width:1280px) { .mobile-drawer { display:none !important; } }
/* Contact action shows only after the hero, hides at contact. */
.mobile-cta { display:none; position:fixed; bottom:calc(12px + env(safe-area-inset-bottom)); left:12px; right:12px; z-index:45; padding:7px; border:1px solid rgba(255,255,255,.1); background:var(--brand-deep); border-radius:16px; box-shadow:0 18px 45px rgba(3,12,26,.22); translate:0 160%; opacity:0; visibility:hidden; pointer-events:none; transition:translate .5s var(--ease),opacity .5s var(--ease),visibility .5s; }
.mobile-cta.is-visible { translate:0 0; opacity:1; visibility:visible; pointer-events:auto; }
@media (max-width:639px) { .mobile-cta {display:flex} footer {padding-bottom:96px !important} }
.btn-cta-primary { transform:translateY(0); }
/* Preserve contrast on dark CTA in all states. */
.btn-cta-primary:hover { color:var(--cta-ink); }
.btn-cta-primary:focus-visible { outline:3px solid var(--brand-on-dark); outline-offset:3px; }
.bp-card, .hero-showcase img { backface-visibility:hidden; }
.inquiry-preview textarea { color-scheme:dark; }
.inquiry-preview textarea:focus-visible { outline:2px solid var(--cta); outline-offset:2px; }
.calc-disclaimer { max-width:850px; margin-inline:auto; }
#calcCampuses { accent-color:var(--accent-cyan); }
/* System preference switches off ALL motion, while preserving interactions. */
@media (prefers-reduced-motion:reduce) {
  html { scroll-behavior:auto !important; }
  .js.motion-ready :is(.reveal-init,.reveal-left,.reveal-right,.reveal-scale) { opacity:1 !important; translate:none !important; scale:1 !important; }
  .hero-bridge-trace__path { stroke-dasharray:none !important; stroke-dashoffset:0 !important; }
  .step-line-progress { transform:scaleX(1) !important; }
  .mobile-drawer,.mobile-drawer__panel,.mobile-cta { transition:none !important; }
}


/* ===== BridgePoint V1.d · Hero typewriter with live focus / blur =====
   Built only when JS starts successfully: original bilingual heading remains
   visible, and is still fully accessible, if JS fails or motion is reduced.
*/
.hero-title .hero-typewriter__lang {
  position: relative;
  display: block;
}
.hero-typewriter__source { display: block; }
/* The animated version occupies REAL layout height; this fixes Spanish H1 overlapping the subtitle. */
.hero-title.is-typewriter-active .hero-typewriter__source { position:absolute;inset:0;pointer-events:none; }
.hero-title.is-typewriter-active .hero-typewriter__source { opacity: 0; }
.hero-typewriter__visual {
  position: relative;
  display: block;
  pointer-events: none;
  user-select: none;
}
/* Inline-block word groups prevent isolated punctuation or orphaned letters. */
.hero-typewriter__visual .typeword { display: inline-block; white-space: nowrap; }
.hero-typewriter__visual .typeglyph {
  position: relative;
  display: inline-block;
  letter-spacing: -.049em;
  opacity: 0;
  filter: blur(8px);
  translate: 0 .13em;
  transition: opacity .27s ease-out, filter .45s var(--ease), translate .48s var(--ease);
}
.hero-typewriter__visual .typeglyph.is-typed {
  opacity: 1;
  filter: blur(0);
  translate: 0 0;
}
/* One understated insertion cursor, following the actively typed character. */
.hero-typewriter__visual .typeglyph.is-caret::after {
  content: '';
  position: absolute;
  right: -0.07em;
  top: .13em;
  height: .79em;
  width: 2px;
  border-radius: 2px;
  background: var(--cta);
  animation: bp-caret 0.66s steps(1,end) infinite;
}
@keyframes bp-caret { 0%, 52% {opacity:1} 53%, 100% {opacity:0} }
@media (prefers-reduced-motion:reduce) {
  .hero-title .hero-typewriter__source { opacity:1 !important; }
  .hero-typewriter__visual { display:none !important; }
  .hero-typewriter__visual .typeglyph { opacity:1 !important; filter:none !important; translate:none !important; }
  .hero-typewriter__visual .typeglyph.is-caret::after { display:none !important; }
}

/* Preserve the CTA-to-amber accent while each letter is a composited blur layer. */
.hero-typewriter__accent .typeglyph {
  color: color-mix(in srgb, var(--cta), #fde68a var(--accent-stop, 50%));
}
/* Desktop dock is intentionally absent on tablets/phones. Unlayered component
   display previously overrode Tailwind's layered `hidden` utility. */
nav.nav-capsule { display:none; }
@media (min-width:1280px) { nav.nav-capsule { display:flex; } }
/* Avoid a 3-item header overflowing 320–639px screens: custom button display
   is unlayered and otherwise takes precedence over Tailwind's `hidden`. */
@media (max-width:639px) {
  header a.btn-cta-primary { display:none; }
}
@media (max-width:359px) {
  header .max-w-7xl { padding-inline:12px; gap:6px; }
  header a[href="#hero"] { gap:6px; }
  header a[href="#hero"] > div:first-child { width:36px; height:36px; }
  header a[href="#hero"] > div:nth-child(2) > span:first-child { font-size:1.05rem; }
  header a[href="#hero"] > div:nth-child(2) > span:last-child { font-size:7px; }
  header .max-w-7xl > div:last-child { gap:6px; }
  header #mobileMenuToggle { padding:5px; }
}
@media (max-width:359px) {
  footer .space-x-6 { flex-wrap:wrap; column-gap:14px; row-gap:8px; }
  footer .space-x-6 > :not(:last-child) { margin-inline-end:0; }
}

/* V2.2: Static source is the default; only display visual during typing. */
.hero-title:not(.is-typewriter-active) .hero-typewriter__visual { display:none; }
.hero-title .hero-typewriter__lang { min-width:0; }
.hero-title { overflow-wrap:normal; }
@media (min-width:1024px) and (max-width:1439px) { html[data-current-lang="es"] .hero-title { font-size:clamp(2.45rem,3.7vw,3.55rem);line-height:1.12; } }
