/* =========================================================
   COLEGIO INCREÍBLE — Demo design system
   Palette: Navy / Burgundy / Gold (prep-school prestige)
   ========================================================= */

:root {
  /* Brand */
  --navy:        #0a1f44;
  --navy-deep:   #061634;
  --navy-soft:   #1a2e5a;
  --burgundy:    #8b1538;
  --burgundy-dk: #6b0f2a;
  --gold:        #c9a961;
  --gold-soft:   #e3cf95;

  /* Neutrals */
  --cream:       #faf8f3;
  --cream-warm:  #f3ede0;
  --paper:       #ffffff;
  --ink:         #11151c;
  --ink-soft:    #2b3340;
  --muted:       #6b6f78;
  --line:        #e6e1d4;

  /* Type */
  --serif: 'Playfair Display', 'Cormorant Garamond', Georgia, serif;
  --sans:  'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Shadows */
  --sh-sm: 0 2px 6px rgba(10,31,68,.06);
  --sh-md: 0 10px 30px rgba(10,31,68,.10);
  --sh-lg: 0 20px 60px rgba(10,31,68,.18);

  /* Layout */
  --container: 1280px;
  --radius: 4px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, picture { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul { list-style: none; padding: 0; margin: 0; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.15; color: var(--navy); margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.4rem, 5vw, 4.4rem); font-weight: 500; }
h2 { font-size: clamp(2rem, 3.5vw, 3rem); }
h3 { font-size: clamp(1.4rem, 2vw, 1.7rem); }
.eyebrow {
  display: inline-block;
  font-family: var(--sans);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--burgundy);
  margin-bottom: 1.1rem;
}
.lead { font-size: 1.18rem; color: var(--ink-soft); max-width: 60ch; }
.divider-gold {
  width: 60px; height: 2px; background: var(--gold);
  margin: 1.4rem 0 1.6rem;
}

/* ---------- Layout helpers ---------- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 28px; }
.section { padding: clamp(64px, 9vw, 120px) 0; }
.section--cream { background: var(--cream); }
.section--navy { background: var(--navy); color: #e9edf5; }
.section--navy h2, .section--navy h3 { color: #fff; }
.grid { display: grid; gap: 28px; }
.flex { display: flex; }
.center { text-align: center; }

/* ---------- Top utility bar ---------- */
.utility-bar {
  background: var(--navy-deep);
  color: #b9c2d6;
  font-size: .82rem;
  letter-spacing: .04em;
}
.utility-bar .container {
  display: flex;
  justify-content: flex-end;
  gap: 22px;
  padding-top: 9px;
  padding-bottom: 9px;
}
.utility-bar a { color: #d3dbed; transition: color .2s; }
.utility-bar a:hover { color: var(--gold); }
.utility-bar .lang-toggle {
  display: inline-flex; gap: 8px; align-items: center;
  border-left: 1px solid rgba(255,255,255,.15);
  padding-left: 22px;
}
.lang-toggle button {
  font-size: .82rem;
  color: #8d97ad;
  letter-spacing: .08em;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 2px;
  transition: color .2s;
}
.lang-toggle button.active { color: var(--gold); font-weight: 700; }
.lang-toggle button:hover { color: #fff; }
.lang-toggle .sep { color: #4a5570; }

/* ---------- Header / Nav ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .25s, background .25s;
}
.header.scrolled { box-shadow: var(--sh-sm); }
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0;
}
.brand {
  display: flex; align-items: center; gap: 14px;
}
.brand-mark {
  width: 46px; height: 46px;
  background: var(--navy);
  color: var(--gold);
  display: grid; place-items: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.25rem;
  border: 2px solid var(--gold);
  letter-spacing: -.02em;
}
.brand-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.32rem;
  color: var(--navy);
  line-height: 1;
}
.brand-tag {
  font-size: .68rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--burgundy);
  margin-top: 4px;
}
.nav-menu {
  display: flex; align-items: center; gap: 30px;
}
.nav-menu a {
  font-size: .94rem;
  font-weight: 500;
  color: var(--ink-soft);
  position: relative;
  padding: 6px 0;
  transition: color .2s;
}
.nav-menu a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px; background: var(--burgundy);
  transform: scaleX(0); transform-origin: left;
  transition: transform .25s;
}
.nav-menu a:hover, .nav-menu a.active { color: var(--navy); }
.nav-menu a:hover::after, .nav-menu a.active::after { transform: scaleX(1); }
.nav-cta {
  background: var(--burgundy);
  color: #fff !important;
  padding: 10px 20px !important;
  border-radius: 2px;
  font-weight: 600 !important;
  letter-spacing: .04em;
  transition: background .2s, transform .2s;
}
.nav-cta:hover { background: var(--burgundy-dk); transform: translateY(-1px); }
.nav-cta::after { display: none !important; }
.nav-toggle { display: none; font-size: 1.6rem; color: var(--navy); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 28px;
  font-weight: 600;
  letter-spacing: .04em;
  font-size: .95rem;
  border-radius: 2px;
  transition: all .25s;
  cursor: pointer;
}
.btn-primary { background: var(--burgundy); color: #fff; }
.btn-primary:hover { background: var(--burgundy-dk); transform: translateY(-2px); box-shadow: var(--sh-md); }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: var(--gold-soft); transform: translateY(-2px); }
.btn-ghost { border: 1.5px solid #fff; color: #fff; }
.btn-ghost:hover { background: #fff; color: var(--navy); }
.btn-outline-navy { border: 1.5px solid var(--navy); color: var(--navy); }
.btn-outline-navy:hover { background: var(--navy); color: #fff; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 86vh;
  display: flex; align-items: center;
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}
.hero-slides {
  position: absolute; inset: 0;
}
.hero-slide {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0;
  transform: scale(1.08);
  transition: opacity 2.4s cubic-bezier(0.45, 0, 0.15, 1);
  will-change: opacity, transform;
}
.hero-slide.active {
  opacity: 1;
  transform: scale(1);
  transition: opacity 2.4s cubic-bezier(0.45, 0, 0.15, 1), transform 12s linear;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(115deg, rgba(6,22,52,.88) 0%, rgba(6,22,52,.55) 55%, rgba(6,22,52,.35) 100%);
  z-index: 1;
}
.hero .container { position: relative; z-index: 2; padding-top: 60px; padding-bottom: 60px; }
.hero-eyebrow {
  display: inline-block;
  color: var(--gold);
  letter-spacing: .25em;
  text-transform: uppercase;
  font-size: .82rem;
  font-weight: 600;
  margin-bottom: 18px;
}
.hero h1 {
  color: #fff;
  font-weight: 500;
  max-width: 16ch;
  margin-bottom: 28px;
}
.hero p.lead {
  color: #d8dde9; max-width: 52ch; margin-bottom: 38px; font-size: 1.2rem;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-dots {
  position: absolute; bottom: 30px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 10px;
  z-index: 3;
}
.hero-dots button {
  width: 36px; height: 3px;
  background: rgba(255,255,255,.35);
  transition: background .25s;
}
.hero-dots button.active { background: var(--gold); }

/* ---------- Mission section ---------- */
.mission {
  display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center;
}
.mission-image {
  position: relative;
  aspect-ratio: 4/5;
  background-size: cover; background-position: center;
  box-shadow: var(--sh-lg);
}
.mission-image::before {
  content: ''; position: absolute; inset: -22px -22px 22px 22px;
  border: 2px solid var(--gold); z-index: -1;
}
@media (max-width: 900px) { .mission { grid-template-columns: 1fr; gap: 50px; } }

/* ---------- Programs (3 cards) ---------- */
.programs-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px;
}
.program-card {
  position: relative;
  aspect-ratio: 4/5;
  overflow: hidden;
  background: var(--navy);
  cursor: pointer;
}
.program-card-img {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  transition: transform .8s ease;
  filter: brightness(.7);
}
.program-card:hover .program-card-img { transform: scale(1.06); filter: brightness(.55); }
.program-card-content {
  position: absolute; inset: auto 0 0 0; padding: 32px;
  color: #fff; z-index: 2;
}
.program-card::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(6,22,52,.95) 0%, rgba(6,22,52,.2) 60%, transparent 100%);
  z-index: 1;
}
.program-card h3 { color: #fff; margin-bottom: 8px; }
.program-card p { color: #d8dde9; margin: 0 0 16px; font-size: .98rem; }
.program-card .arrow {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--gold);
  font-weight: 600; font-size: .9rem;
  letter-spacing: .08em; text-transform: uppercase;
  transition: gap .25s;
}
.program-card:hover .arrow { gap: 14px; }
@media (max-width: 900px) { .programs-grid { grid-template-columns: 1fr; } }

/* ---------- PARALLAX COUNTER-SCROLL GALLERY ---------- */
.parallax-gallery {
  background: var(--navy);
  color: #fff;
  padding: clamp(80px, 10vw, 140px) 0;
  overflow: hidden;
}
.parallax-gallery .intro { text-align: center; max-width: 720px; margin: 0 auto 80px; }
.parallax-gallery h2 { color: #fff; }
.parallax-gallery .lead { color: #b9c2d6; margin: 0 auto; }
.parallax-row {
  display: flex; gap: 24px;
  margin-bottom: 24px;
  margin-left: -16vw;
  width: max-content;
  will-change: transform;
}
.parallax-tile {
  flex: 0 0 clamp(260px, 26vw, 380px);
  aspect-ratio: 4/3;
  background-size: cover; background-position: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.parallax-tile::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(6,22,52,.6) 100%);
}
.parallax-tile span {
  position: absolute; left: 22px; bottom: 18px; z-index: 2;
  font-family: var(--serif);
  font-size: 1.15rem;
  color: #fff;
}

/* ---------- Stats ---------- */
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px;
  text-align: center;
}
.stat .num {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 5vw, 4rem);
  color: var(--gold);
  line-height: 1; margin-bottom: 12px;
  font-weight: 600;
}
.stat .label {
  text-transform: uppercase;
  letter-spacing: .15em;
  font-size: .82rem;
  color: #b9c2d6;
}
.section--navy.stats-section { padding: 90px 0; }
@media (max-width: 800px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Stories / Testimonials ---------- */
.stories-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px;
}
.story-card {
  background: var(--paper);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform .3s, box-shadow .3s;
}
.story-card:hover { transform: translateY(-4px); box-shadow: var(--sh-md); }
.story-card .img {
  aspect-ratio: 16/9;
  background-size: cover; background-position: center;
}
.story-card.feature .img { aspect-ratio: 16/10; }
.story-card .body { padding: 26px 28px 30px; }
.story-card .tag {
  font-size: .72rem; letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--burgundy); font-weight: 600;
  margin-bottom: 10px; display: block;
}
.story-card h3 { font-size: 1.4rem; margin-bottom: 8px; }
.story-card p { color: var(--muted); margin: 0; font-size: .96rem; }
@media (max-width: 950px) { .stories-grid { grid-template-columns: 1fr; } }

/* ---------- Testimonial pull ---------- */
.testimonial {
  background: var(--cream);
  padding: clamp(70px, 9vw, 120px) 0;
}
.testimonial blockquote {
  max-width: 880px; margin: 0 auto;
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.4;
  color: var(--navy);
  text-align: center;
  font-style: italic;
  font-weight: 500;
  position: relative;
}
.testimonial blockquote::before {
  content: '"';
  position: absolute; top: -.4em; left: 50%; transform: translateX(-50%);
  font-size: 6rem; color: var(--gold); opacity: .35;
  font-family: var(--serif);
}
.testimonial cite {
  display: block; margin-top: 30px; text-align: center;
  font-style: normal;
  font-family: var(--sans); font-size: .85rem;
  color: var(--burgundy);
  letter-spacing: .2em; text-transform: uppercase;
  font-weight: 600;
}

/* ---------- CTA strip ---------- */
.cta-strip {
  position: relative;
  background: linear-gradient(135deg, var(--burgundy) 0%, var(--burgundy-dk) 100%);
  color: #fff;
  padding: 80px 0;
  text-align: center;
}
.cta-strip h2 { color: #fff; }
.cta-strip p { color: #f3d5dd; max-width: 60ch; margin: 0 auto 30px; }

/* ---------- Footer ---------- */
.footer {
  background: var(--navy-deep); color: #b9c2d6;
  padding: 70px 0 30px;
  font-size: .92rem;
}
.footer h4 {
  color: #fff;
  font-family: var(--sans);
  font-size: .82rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px;
  margin-bottom: 50px;
}
.footer a { color: #b9c2d6; transition: color .2s; line-height: 2; }
.footer a:hover { color: var(--gold); }
.footer .brand-name { color: #fff; }
.footer-social { display: flex; gap: 14px; margin-top: 18px; }
.footer-social a {
  width: 38px; height: 38px;
  border: 1px solid rgba(255,255,255,.2);
  display: grid; place-items: center;
  border-radius: 50%;
  transition: all .2s;
}
.footer-social a:hover { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 25px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-size: .82rem; color: #7a8499;
}
@media (max-width: 850px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- WhatsApp floating button ---------- */
.wa-float {
  position: fixed; bottom: 26px; right: 26px;
  width: 64px; height: 64px;
  background: #25d366;
  border-radius: 50%;
  display: grid; place-items: center;
  box-shadow: 0 10px 30px rgba(37,211,102,.45);
  z-index: 100;
  animation: wa-pulse 2.5s infinite;
  transition: transform .25s;
}
.wa-float:hover { transform: scale(1.08); }
.wa-float svg { width: 32px; height: 32px; fill: #fff; }
.wa-tooltip {
  position: absolute; right: 78px; top: 50%; transform: translateY(-50%);
  background: var(--navy);
  color: #fff;
  padding: 10px 16px;
  font-size: .88rem;
  white-space: nowrap;
  border-radius: 4px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.wa-tooltip::after {
  content: ''; position: absolute;
  right: -6px; top: 50%; transform: translateY(-50%);
  border-left: 6px solid var(--navy);
  border-top: 6px solid transparent; border-bottom: 6px solid transparent;
}
.wa-float:hover .wa-tooltip { opacity: 1; transform: translateY(-50%) translateX(-4px); }
@keyframes wa-pulse {
  0%, 100% { box-shadow: 0 10px 30px rgba(37,211,102,.45), 0 0 0 0 rgba(37,211,102,.5); }
  50%      { box-shadow: 0 10px 30px rgba(37,211,102,.45), 0 0 0 14px rgba(37,211,102,0); }
}

/* ---------- Subpage hero (program pages) ---------- */
.subhero {
  position: relative;
  min-height: 56vh;
  display: flex; align-items: flex-end;
  color: #fff;
  background-size: cover; background-position: center;
  padding-bottom: 60px;
}
.subhero::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(6,22,52,.92), rgba(6,22,52,.45) 60%, rgba(6,22,52,.25));
}
.subhero .container { position: relative; z-index: 2; }
.subhero .eyebrow { color: var(--gold); }
.subhero h1 { color: #fff; max-width: 18ch; margin-bottom: 18px; }
.subhero p { color: #d8dde9; max-width: 60ch; font-size: 1.1rem; }
.breadcrumb {
  font-size: .8rem;
  letter-spacing: .12em; text-transform: uppercase;
  color: rgba(255,255,255,.7);
  margin-bottom: 22px;
}
.breadcrumb a { color: rgba(255,255,255,.85); }
.breadcrumb a:hover { color: var(--gold); }

/* ---------- Program content blocks ---------- */
.split {
  display: grid; grid-template-columns: 1fr 1fr; gap: 70px; align-items: center;
}
.split--reverse > :first-child { order: 2; }
.split-image {
  aspect-ratio: 4/3;
  background-size: cover; background-position: center;
  box-shadow: var(--sh-md);
}
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; gap: 40px; }
  .split--reverse > :first-child { order: 0; }
}

.feature-list { margin-top: 24px; }
.feature-list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  display: flex; gap: 16px;
}
.feature-list li::before {
  content: '✦';
  color: var(--gold); flex-shrink: 0;
  font-size: 1.1rem;
}
.feature-list li:last-child { border-bottom: none; }
.feature-list strong { color: var(--navy); display: block; margin-bottom: 2px; }

/* ---------- Curriculum / pillars grid ---------- */
.pillars {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.pillar {
  padding: 36px 30px;
  background: var(--paper);
  border: 1px solid var(--line);
  transition: transform .3s, box-shadow .3s, border-color .3s;
}
.pillar:hover { transform: translateY(-4px); box-shadow: var(--sh-md); border-color: var(--gold); }
.pillar .icon {
  width: 56px; height: 56px;
  background: var(--cream);
  border: 1px solid var(--gold);
  display: grid; place-items: center;
  margin-bottom: 22px;
  color: var(--burgundy);
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 600;
}
.pillar h3 { font-size: 1.3rem; margin-bottom: 8px; }
.pillar p { color: var(--muted); font-size: .96rem; margin: 0; }
@media (max-width: 850px) { .pillars { grid-template-columns: 1fr; } }

/* ---------- Schedule table ---------- */
.schedule {
  width: 100%; border-collapse: collapse;
  margin-top: 30px;
  font-size: .98rem;
}
.schedule th, .schedule td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.schedule thead th {
  background: var(--navy);
  color: #fff;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .82rem;
}
.schedule tbody tr:hover { background: var(--cream); }
.schedule tbody td:first-child { font-weight: 600; color: var(--burgundy); }

/* ---------- Student portal ---------- */
.portal-shell {
  background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy) 60%, var(--navy-soft) 100%);
  min-height: 100vh;
  padding: 0;
}
.portal-login {
  min-height: 100vh;
  display: grid; grid-template-columns: 1fr 1fr;
}
.portal-login__visual {
  position: relative;
  background-size: cover; background-position: center;
}
.portal-login__visual::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(6,22,52,.85), rgba(139,21,56,.7));
}
.portal-login__visual .quote {
  position: absolute; bottom: 60px; left: 60px; right: 60px; color: #fff;
  font-family: var(--serif); font-size: 1.6rem; font-style: italic; line-height: 1.4;
}
.portal-login__visual .quote small {
  display: block; margin-top: 18px; font-family: var(--sans); font-size: .8rem;
  color: var(--gold); letter-spacing: .2em; text-transform: uppercase; font-style: normal;
}
.portal-login__form {
  background: var(--paper);
  display: flex; align-items: center; justify-content: center;
  padding: 60px 50px;
}
.portal-login__form .inner { width: 100%; max-width: 420px; }
.portal-login__form .brand { margin-bottom: 50px; }
.portal-login__form h2 { font-size: 2rem; margin-bottom: 6px; }
.portal-login__form .lead { font-size: 1rem; margin-bottom: 36px; }
.field { margin-bottom: 22px; }
.field label {
  display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .14em;
  color: var(--navy); font-weight: 600; margin-bottom: 8px;
}
.field input {
  width: 100%; padding: 14px 16px;
  border: 1.5px solid var(--line); border-radius: 2px;
  font: inherit; color: var(--ink);
  transition: border-color .2s;
}
.field input:focus { outline: none; border-color: var(--burgundy); }
.portal-hint {
  font-size: .82rem; color: var(--muted); margin-top: 18px;
  background: var(--cream); padding: 12px 14px; border-left: 3px solid var(--gold);
}
@media (max-width: 900px) { .portal-login { grid-template-columns: 1fr; } .portal-login__visual { display: none; } }

/* ---------- Portal dashboard ---------- */
.portal-app { display: none; min-height: 100vh; background: var(--cream); }
.portal-app.active { display: grid; grid-template-columns: 260px 1fr; }
.portal-sidebar {
  background: var(--navy-deep);
  color: #b9c2d6;
  padding: 30px 0;
  position: sticky; top: 0; height: 100vh;
}
.portal-sidebar .brand { padding: 0 28px 32px; border-bottom: 1px solid rgba(255,255,255,.08); }
.portal-sidebar .brand .brand-name { color: #fff; font-size: 1.1rem; }
.portal-nav { padding: 22px 0; }
.portal-nav a {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 28px;
  color: #b9c2d6;
  font-size: .94rem;
  transition: background .2s, color .2s;
  border-left: 3px solid transparent;
}
.portal-nav a.active, .portal-nav a:hover {
  background: rgba(255,255,255,.04);
  color: #fff;
  border-left-color: var(--gold);
}
.portal-nav .icon { width: 18px; text-align: center; }
.portal-user {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 22px 28px; border-top: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: 12px;
}
.portal-user .avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--burgundy); color: #fff;
  display: grid; place-items: center;
  font-weight: 600;
}
.portal-user .name { color: #fff; font-size: .9rem; }
.portal-user .grade { color: #8d97ad; font-size: .76rem; }

.portal-main { padding: 42px 56px; }
.portal-topbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 36px;
}
.portal-topbar h1 {
  font-size: 1.9rem; margin: 0; color: var(--navy);
}
.portal-topbar .greeting { color: var(--muted); font-size: .94rem; }

.portal-cards {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
  margin-bottom: 38px;
}
.portal-card {
  background: var(--paper);
  border-radius: 6px;
  padding: 22px;
  border: 1px solid var(--line);
  position: relative;
}
.portal-card .label {
  font-size: .75rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 8px;
}
.portal-card .value {
  font-family: var(--serif); font-size: 2.2rem;
  color: var(--navy); line-height: 1;
}
.portal-card .pill {
  position: absolute; top: 18px; right: 18px;
  font-size: .72rem; padding: 4px 8px; border-radius: 20px;
  background: var(--cream); color: var(--burgundy);
  letter-spacing: .08em; text-transform: uppercase; font-weight: 600;
}

.portal-grid-2 {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px;
}
.portal-panel {
  background: var(--paper);
  border-radius: 6px;
  border: 1px solid var(--line);
  padding: 24px 26px 26px;
}
.portal-panel h3 {
  font-family: var(--sans); font-weight: 600;
  font-size: 1rem; color: var(--navy);
  letter-spacing: .04em;
  margin-bottom: 18px; padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.portal-panel h3 .more { font-size: .78rem; color: var(--burgundy); font-weight: 500; letter-spacing: 0; }
.task-row {
  display: grid; grid-template-columns: auto 1fr auto auto; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
  align-items: center;
}
.task-row:last-child { border-bottom: none; }
.task-row .subject {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 6px;
  font-family: var(--serif); font-weight: 600; font-size: 1.05rem;
  color: var(--navy);
  background: var(--cream-warm);
}
.task-row .info .title { font-weight: 600; color: var(--navy); margin: 0 0 2px; font-size: .96rem; }
.task-row .info .meta { font-size: .82rem; color: var(--muted); }
.task-row .due {
  font-size: .82rem; color: var(--ink-soft);
  background: var(--cream); padding: 4px 10px; border-radius: 16px;
  white-space: nowrap;
}
.task-row .due.urgent { background: #fde7ec; color: var(--burgundy); }
.task-row .due.done { background: #e3f2dc; color: #2d6e2c; }
.task-row .status-icon {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  border: 2px solid var(--line);
}
.task-row .status-icon.checked { background: var(--gold); border-color: var(--gold); color: var(--navy); }
@media (max-width: 1100px) {
  .portal-cards { grid-template-columns: repeat(2, 1fr); }
  .portal-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .portal-app.active { grid-template-columns: 1fr; }
  .portal-sidebar { position: static; height: auto; }
  .portal-user { position: static; }
  .portal-main { padding: 28px 24px; }
}

/* ---------- Mobile nav ---------- */
@media (max-width: 1000px) {
  .nav-toggle { display: block; }
  .nav-menu {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--paper);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 16px 28px 28px;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--sh-md);
    transform: translateY(-15px); opacity: 0; pointer-events: none;
    transition: all .25s;
  }
  .nav-menu.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-menu a { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .nav-menu a::after { display: none; }
  .nav-cta { text-align: center; margin-top: 12px; }
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s, transform .8s; }
.reveal.in { opacity: 1; transform: none; }

/* =========================================================
   MOBILE OPTIMIZATIONS (≤640px)
   ========================================================= */
@media (max-width: 640px) {
  body { font-size: 16px; }

  /* Containers / sections */
  .container { padding: 0 20px; }
  .section { padding: 56px 0; }

  /* Typography */
  h1 { font-size: 2.1rem; line-height: 1.12; }
  h2 { font-size: 1.7rem; line-height: 1.18; }
  h3 { font-size: 1.22rem; }
  .lead { font-size: 1rem; line-height: 1.55; }
  .eyebrow { font-size: .72rem; letter-spacing: .18em; margin-bottom: .9rem; }

  /* Utility bar — collapse to lang + access only */
  .utility-bar { font-size: .76rem; }
  .utility-bar .container { gap: 12px; padding: 8px 20px; justify-content: space-between; }
  .utility-bar a:nth-of-type(2),
  .utility-bar a:nth-of-type(3) { display: none; }
  .utility-bar .lang-toggle { border-left: none; padding-left: 0; }

  /* Header */
  .nav { padding: 12px 0; }
  .brand-mark { width: 38px; height: 38px; font-size: 1rem; }
  .brand-name { font-size: 1rem; }
  .brand-tag { font-size: .6rem; letter-spacing: .2em; margin-top: 2px; }
  .header.scrolled { box-shadow: 0 1px 6px rgba(10,31,68,.08); }

  /* Buttons — stack & make tappable */
  .btn { padding: 13px 22px; font-size: .92rem; width: 100%; justify-content: center; }
  .btn-outline-navy, .btn-ghost { width: auto; }

  /* Hero */
  .hero { min-height: 76vh; }
  .hero .container { padding-top: 36px; padding-bottom: 48px; }
  .hero-eyebrow { font-size: .7rem; margin-bottom: 14px; letter-spacing: .22em; }
  .hero h1 { max-width: none; margin-bottom: 18px; font-size: 2.15rem; }
  .hero p.lead { font-size: 1rem; margin-bottom: 26px; max-width: none; }
  .hero-actions { flex-direction: column; align-items: stretch; gap: 10px; }
  .hero-actions .btn { width: 100%; }
  .hero-dots { bottom: 18px; }
  .hero-dots button { width: 28px; }

  /* Mission */
  .mission { gap: 36px; }
  .mission-image { aspect-ratio: 4/5; max-width: 90%; margin: 0 auto; }
  .mission-image::before { inset: -10px -10px 10px 10px; }

  /* Programs */
  .program-card { aspect-ratio: 4/5; }
  .program-card-content { padding: 22px 22px; }
  .program-card .arrow { font-size: .8rem; letter-spacing: .06em; }

  /* Preparatoria banner — make less wide */
  a.program-card[style*="21/9"] { aspect-ratio: 4/5 !important; }

  /* Parallax gallery */
  .parallax-gallery { padding: 60px 0; }
  .parallax-gallery .intro { margin: 0 auto 44px; padding: 0 20px; }
  .parallax-row { gap: 14px; margin-bottom: 14px; margin-left: -28vw; }
  .parallax-tile { flex: 0 0 230px; box-shadow: 0 6px 20px rgba(0,0,0,.3); }
  .parallax-tile span { font-size: .95rem; left: 14px; bottom: 12px; }

  /* Stats */
  .section--navy.stats-section { padding: 60px 0; }
  .stats-grid { gap: 30px 18px; }
  .stat .num { font-size: 2.3rem; margin-bottom: 8px; }
  .stat .label { font-size: .7rem; letter-spacing: .12em; }

  /* Testimonial */
  .testimonial { padding: 56px 0; }
  .testimonial blockquote { font-size: 1.35rem; line-height: 1.4; }
  .testimonial blockquote::before { font-size: 4rem; top: -.35em; }
  .testimonial cite { font-size: .76rem; margin-top: 22px; }

  /* Stories */
  .stories-grid { gap: 18px; }
  .story-card .img { aspect-ratio: 16/9; }
  .story-card.feature .img { aspect-ratio: 16/9; }
  .story-card .body { padding: 20px 22px 22px; }
  .story-card h3 { font-size: 1.2rem; }
  .story-card p { font-size: .92rem; }

  /* CTA strip */
  .cta-strip { padding: 56px 0; }
  .cta-strip .btn { width: auto; }

  /* Footer */
  .footer { padding: 48px 0 24px; font-size: .9rem; }
  .footer-grid { gap: 28px; margin-bottom: 32px; }
  .footer h4 { font-size: .76rem; margin-bottom: 14px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 10px; font-size: .76rem; }
  .footer-social a { width: 34px; height: 34px; }

  /* WhatsApp */
  .wa-float { width: 54px; height: 54px; bottom: 16px; right: 16px; }
  .wa-float svg { width: 26px; height: 26px; }
  .wa-tooltip { display: none; }

  /* Subhero (program subpages) */
  .subhero { min-height: 50vh; padding-bottom: 32px; }
  .subhero h1 { max-width: none; font-size: 1.95rem; margin-bottom: 14px; }
  .subhero p { font-size: 1rem; }
  .breadcrumb { font-size: .72rem; margin-bottom: 14px; letter-spacing: .1em; }

  /* Split (subpages) */
  .split { gap: 32px; }
  .split--reverse > :first-child { order: 0; }
  .split-image { aspect-ratio: 4/3; }

  /* Pillars */
  .pillar { padding: 26px 24px; }
  .pillar .icon { width: 50px; height: 50px; font-size: 1.4rem; margin-bottom: 16px; }
  .pillar h3 { font-size: 1.18rem; }

  /* Schedule */
  .schedule { font-size: .88rem; }
  .schedule th, .schedule td { padding: 12px 14px; }
  .schedule thead th { font-size: .72rem; }

  /* Portal — login */
  .portal-login__form { padding: 50px 24px; }
  .portal-login__form .brand { margin-bottom: 36px; }
  .portal-login__form h2 { font-size: 1.6rem; }
  .portal-login__form .lead { font-size: .96rem; margin-bottom: 28px; }
  .portal-hint { font-size: .78rem; }

  /* Portal — dashboard */
  .portal-main { padding: 24px 18px; }
  .portal-topbar { flex-direction: column; align-items: flex-start; gap: 14px; margin-bottom: 24px; }
  .portal-topbar h1 { font-size: 1.5rem; }
  .portal-topbar .greeting { font-size: .88rem; }
  .portal-topbar .btn { width: auto; }
  .portal-cards { grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 26px; }
  .portal-card { padding: 16px 16px 18px; }
  .portal-card .label { font-size: .68rem; }
  .portal-card .value { font-size: 1.7rem; }
  .portal-card .pill { font-size: .62rem; padding: 3px 6px; top: 12px; right: 12px; }
  .portal-grid-2 { gap: 16px; }
  .portal-panel { padding: 18px 20px 20px; }
  .portal-panel h3 { font-size: .92rem; margin-bottom: 14px; padding-bottom: 12px; }
  .task-row { grid-template-columns: auto 1fr auto; gap: 10px; padding: 12px 0; }
  .task-row .status-icon { display: none; }
  .task-row .subject { width: 36px; height: 36px; font-size: .95rem; }
  .task-row .info .title { font-size: .9rem; }
  .task-row .info .meta { font-size: .76rem; }
  .task-row .due { font-size: .72rem; padding: 3px 8px; }

  /* Portal sidebar — when stacked on mobile */
  .portal-sidebar { padding: 22px 0 0; }
  .portal-sidebar .brand { padding: 0 22px 22px; }
  .portal-nav a { padding: 11px 22px; font-size: .9rem; }
  .portal-user { padding: 18px 22px; }
}

/* Very small phones (≤380px) */
@media (max-width: 380px) {
  .brand-tag { display: none; }
  h1 { font-size: 1.85rem; }
  .hero h1 { font-size: 1.95rem; }
  .testimonial blockquote { font-size: 1.2rem; }
  .stat .num { font-size: 2rem; }
  .portal-cards { grid-template-columns: 1fr; }
}
