/* =====================================================================
   NECS — site styles
   Palette and type are defined as tokens below; change them here.
   ===================================================================== */

:root {
  --navy: #14284b;
  --navy-deep: #0d1b33;
  --navy-soft: #2a4170;
  --gold: #b08d3e;
  --gold-light: #d9bf7f;
  --white: #ffffff;
  --mist: #eef2f7;
  --line: #d9e0ea;
  --ink: #1b2536;
  --text: #3d4a5c;
  --muted: #64718a;
  --wa: #1f8f4e;

  --font-serif: "Literata", Georgia, "Times New Roman", serif;
  --font-sans: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --container: 1180px;
  --gutter: 20px;
  --radius: 10px;
  --radius-lg: 16px;
  --header-h: 76px;
  --section: clamp(64px, 9vw, 112px);
}

/* ---------- Fonts (self-hosted, no external requests) ---------- */
@font-face { font-family: "Literata"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/literata-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Literata"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/literata-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/public-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/public-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/public-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/public-sans-latin-700-normal.woff2") format("woff2"); }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--navy-soft); }
h1, h2, h3 {
  font-family: var(--font-serif);
  color: var(--ink);
  line-height: 1.18;
  margin: 0 0 .5em;
  font-weight: 600;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.3rem, 4.6vw, 3.4rem); }
h2 { font-size: clamp(1.75rem, 3.2vw, 2.4rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }
code { font-size: .9em; background: var(--mist); padding: 1px 6px; border-radius: 4px; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--gold); color: var(--navy-deep); padding: 10px 16px; border-radius: 6px; font-weight: 600;
}
.skip-link:focus { top: 12px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 768px) { :root { --gutter: 32px; } }

.section { padding: var(--section) 0; }
.section-mist { background: var(--mist); }
.lead { font-size: 1.15rem; color: var(--text); max-width: 62ch; }
.measure { max-width: 66ch; }

/* The "margin line": a gold vertical rule beside headings, like the
   margin of an exercise book. It is the site's one signature detail. */
.ruled { position: relative; padding-left: 22px; }
.ruled::before {
  content: ""; position: absolute; left: 0; top: .18em; bottom: .12em;
  width: 3px; border-radius: 2px; background: var(--gold);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 24px;
  font: 600 1rem/1.2 var(--font-sans);
  border-radius: 8px; border: 2px solid transparent;
  text-decoration: none; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, transform .2s;
}
.btn .icon { width: 20px; height: 20px; }
.btn:hover { transform: translateY(-1px); }
.btn-sm { min-height: 42px; padding: 8px 18px; font-size: .95rem; }
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-soft); color: var(--white); }
.btn-gold { background: var(--gold); color: var(--navy-deep); }
.btn-gold:hover { background: var(--gold-light); color: var(--navy-deep); }
.btn-outline { border-color: var(--navy); color: var(--navy); background: transparent; }
.btn-outline:hover { background: var(--navy); color: var(--white); }
.btn-ghost-light { border-color: rgba(255,255,255,.55); color: var(--white); }
.btn-ghost-light:hover { background: var(--white); color: var(--navy); border-color: var(--white); }
.btn-whatsapp { background: var(--wa); color: var(--white); }
.btn-whatsapp:hover { background: #18773f; color: var(--white); }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

.text-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; color: var(--navy); text-decoration: none;
  border-bottom: 2px solid var(--gold); padding-bottom: 2px;
}
.text-link:hover { color: var(--navy-soft); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  min-height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid transparent;
  transition: box-shadow .25s, border-color .25s;
}
.site-header.is-scrolled { border-color: var(--line); box-shadow: 0 6px 20px rgba(13,27,51,.06); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: var(--header-h); }

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-logo { width: 46px; height: 46px; object-fit: cover; border-radius: 8px; flex: none; box-shadow: 0 0 0 1px var(--line); }
.brand-light .brand-logo { box-shadow: 0 0 0 2px rgba(255,255,255,.18); }
.brand-crest {
  flex: none; width: 44px; height: 48px; display: grid; place-items: center;
  background: var(--navy); color: var(--gold-light);
  clip-path: polygon(0 0, 100% 0, 100% 68%, 50% 100%, 0 68%);
  font: 700 .72rem/1 var(--font-sans); letter-spacing: .06em; padding-bottom: 8px;
}
.brand-name { font-family: var(--font-serif); font-weight: 600; font-size: 1.12rem; line-height: 1.2; }
.brand-short { display: none; }

.nav-toggle {
  display: none; width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--white); color: var(--navy); cursor: pointer; place-items: center;
}
.nav-toggle .icon { width: 24px; height: 24px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav ul { display: flex; gap: 6px; }
.site-nav ul a {
  display: block; padding: 8px 12px; border-radius: 6px;
  color: var(--ink); text-decoration: none; font-weight: 500;
}
.site-nav ul a:hover { background: var(--mist); color: var(--navy); }
.site-nav ul a[aria-current="page"] { color: var(--navy); box-shadow: inset 0 -2px 0 var(--gold); border-radius: 0; }

.icon { width: 22px; height: 22px; flex: none; }

@media (max-width: 960px) {
  .nav-toggle { display: grid; }
  .site-nav {
    position: fixed; inset: var(--header-h) 0 0 0;
    flex-direction: column; align-items: stretch; gap: 24px;
    padding: 24px var(--gutter) 32px;
    background: var(--white); border-top: 1px solid var(--line);
    visibility: hidden; opacity: 0; transform: translateY(-8px);
    transition: opacity .2s, transform .2s, visibility .2s;
    overflow-y: auto;
  }
  .site-nav.is-open { visibility: visible; opacity: 1; transform: none; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav ul a { padding: 16px 4px; font-size: 1.15rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .site-nav ul a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--gold); padding-left: 14px; }
  .site-nav .btn { width: 100%; }
  body.nav-open { overflow: hidden; }
}
@media (max-width: 520px) {
  .brand-full { display: none; }
  .brand-short { display: inline; }
  .site-footer .brand-full { display: inline; }
}

/* ---------- Hero (home) ---------- */
.hero { background: var(--navy); color: rgba(255,255,255,.86); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1fr; }
.hero-copy { padding: clamp(48px, 8vw, 96px) 0 clamp(40px, 6vw, 72px); }
.hero-copy .ruled::before { background: var(--gold-light); }
.hero-school { font-family: var(--font-sans); font-weight: 600; color: var(--gold-light); margin-bottom: 18px; font-size: 1rem; }
.hero h1 { color: var(--white); max-width: 17ch; margin-bottom: 22px; }
.hero .lead { color: rgba(255,255,255,.82); max-width: 46ch; margin-bottom: 32px; }
.hero-media { position: relative; margin: 0 calc(var(--gutter) * -1); }
.hero-media img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; }

@media (min-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); min-height: min(640px, calc(100vh - var(--header-h))); }
  .hero-copy { padding-right: 56px; align-self: center; }
  .hero-media { margin: 0 calc((100vw - min(100vw, var(--container))) / -2 - var(--gutter)) 0 0; }
  .hero-media img { aspect-ratio: auto; position: absolute; inset: 0; }
}

/* One orchestrated page-load moment on the hero only. */
@media (prefers-reduced-motion: no-preference) {
  .js-ready .hero-copy > * { animation: rise .7s cubic-bezier(.2,.7,.2,1) both; }
  .js-ready .hero-copy > *:nth-child(2) { animation-delay: .08s; }
  .js-ready .hero-copy > *:nth-child(3) { animation-delay: .16s; }
  .js-ready .hero-copy > *:nth-child(4) { animation-delay: .24s; }
  .js-ready .hero-media img { animation: settle 1.1s cubic-bezier(.2,.7,.2,1) both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes settle { from { opacity: .4; transform: scale(1.04); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
}

/* ---------- Highlights strip ---------- */
.highlights { background: var(--navy-deep); color: rgba(255,255,255,.8); }
.highlights-grid { display: grid; gap: 0; }
.highlight { display: flex; gap: 16px; align-items: flex-start; padding: 28px 0; border-top: 1px solid rgba(255,255,255,.12); }
.highlight:first-child { border-top: 0; }
.highlight .icon { width: 30px; height: 30px; color: var(--gold-light); margin-top: 2px; }
.highlight h3 { color: var(--white); font-size: 1.15rem; margin-bottom: 4px; }
.highlight p { margin: 0; font-size: .97rem; }
@media (min-width: 820px) {
  .highlights-grid { grid-template-columns: repeat(3, 1fr); }
  .highlight { padding: 36px 32px; border-top: 0; border-left: 1px solid rgba(255,255,255,.12); }
  .highlight:first-child { border-left: 0; padding-left: 0; }
}

/* ---------- Split layouts ---------- */
.split { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) {
  .split { grid-template-columns: 1fr 1fr; gap: 72px; }
  .split-reverse > :first-child { order: 2; }
}
.framed { position: relative; }
.framed img { border-radius: var(--radius-lg); width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.framed::after {
  content: ""; position: absolute; inset: 18px -18px -18px 18px; z-index: -1;
  border: 2px solid var(--gold); border-radius: var(--radius-lg);
}
.framed { z-index: 0; margin-right: 18px; }

/* ---------- Section heads ---------- */
.section-head { display: grid; gap: 12px; margin-bottom: 48px; }
.section-head p { max-width: 60ch; margin: 0; }
@media (min-width: 900px) {
  .section-head-split { grid-template-columns: 1fr auto; align-items: end; }
}

/* ---------- Features ---------- */
.features { display: grid; gap: 8px 48px; }
.feature { display: flex; gap: 18px; padding: 22px 0; border-top: 1px solid var(--line); }
.feature-icon { width: 26px; height: 26px; color: var(--gold); margin-top: 3px; }
.feature h3 { font-size: 1.12rem; margin-bottom: 4px; }
.feature p { margin: 0; font-size: .97rem; }
@media (min-width: 700px) { .features { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1040px) { .features { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Course cards ---------- */
.course-grid { display: grid; gap: 28px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.course-card {
  display: flex; flex-direction: column;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden; transition: border-color .2s, box-shadow .2s;
}
.course-card:hover { border-color: var(--gold); box-shadow: 0 12px 28px rgba(13,27,51,.08); }
.course-media { aspect-ratio: 3 / 2; overflow: hidden; background: var(--mist); }
.course-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.course-card:hover .course-media img { transform: scale(1.03); }
.course-body { padding: 22px 24px 26px; }
.course-level { font-size: .9rem; font-weight: 600; color: var(--gold); margin-bottom: 6px; }
.course-body h3 { margin-bottom: 8px; }
.course-body p:last-child { margin: 0; font-size: .97rem; }

.course-group + .course-group { margin-top: clamp(56px, 8vw, 88px); }
.group-head { margin-bottom: 32px; display: flex; gap: 20px; align-items: center; }
.group-logo { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; flex: none; box-shadow: 0 0 0 1px var(--line); }
.group-head h2 { margin-bottom: 6px; }
@media (max-width: 520px) { .group-logo { width: 56px; height: 56px; } }
.group-head p { max-width: 60ch; margin: 0; }

/* ---------- Page header (inner pages) ---------- */
.page-header { background: var(--navy); color: rgba(255,255,255,.82); padding: clamp(56px, 8vw, 96px) 0 clamp(48px, 6vw, 72px); }
.page-header h1 { color: var(--white); margin-bottom: 14px; }
.page-header .ruled::before { background: var(--gold-light); }
.page-header p { max-width: 58ch; margin: 0; font-size: 1.12rem; }

/* ---------- About ---------- */
.mv-grid { display: grid; gap: 24px; }
@media (min-width: 820px) { .mv-grid { grid-template-columns: 1fr 1fr; gap: 32px; } }
.mv-card { background: var(--white); border-top: 3px solid var(--gold); border-radius: 4px 4px var(--radius) var(--radius); padding: 32px; }
.mv-card h2 { font-size: 1.6rem; }
.mv-card p:last-child { margin: 0; }

.approach { display: grid; gap: 0; margin-top: 8px; }
.approach li { display: flex; gap: 16px; padding: 18px 0; border-top: 1px solid var(--line); }
.approach li:last-child { border-bottom: 1px solid var(--line); }
.approach .icon { color: var(--gold); width: 24px; height: 24px; margin-top: 3px; }
.approach strong { color: var(--ink); display: block; font-size: 1.05rem; }
.approach span { font-size: .97rem; }

.placeholder-note {
  border-left: 3px solid var(--gold); background: var(--mist);
  padding: 14px 18px; border-radius: 0 8px 8px 0; font-size: .95rem; color: var(--muted);
}

/* ---------- CTA band ---------- */
.cta-band { position: relative; color: rgba(255,255,255,.85); background: var(--navy); overflow: hidden; }
.cta-band img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .18; }
.cta-inner { position: relative; display: grid; gap: 28px; padding-block: clamp(56px, 8vw, 88px); }
.cta-inner h2 { color: var(--white); max-width: 22ch; }
.cta-inner .ruled::before { background: var(--gold-light); }
.cta-inner p { margin: 0; max-width: 52ch; }
@media (min-width: 900px) { .cta-inner { grid-template-columns: 1fr auto; align-items: center; } }

/* ---------- Contact ---------- */
.contact-grid { display: grid; gap: 40px; }
@media (min-width: 960px) { .contact-grid { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 56px; } }
.contact-item { display: flex; gap: 18px; padding: 22px 0; border-top: 1px solid var(--line); }
.contact-item:first-child { border-top: 0; padding-top: 0; }
.contact-item > .icon { width: 26px; height: 26px; color: var(--gold); margin-top: 4px; }
.contact-item h2 { font-family: var(--font-sans); font-size: .95rem; font-weight: 600; color: var(--muted); margin: 0 0 4px; letter-spacing: 0; }
.contact-item p { margin: 0; font-size: 1.08rem; color: var(--ink); }
.contact-item div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.hours li { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; color: var(--ink); flex-wrap: wrap; }
.hours li span:first-child { color: var(--text); }
#contact-actions { margin-top: 28px; }

.map-box {
  min-height: 420px; border-radius: var(--radius-lg); overflow: hidden;
  background: var(--mist); border: 1px solid var(--line); display: flex;
}
.map-box iframe { border: 0; width: 100%; min-height: 420px; flex: 1; }
.map-placeholder { margin: auto; text-align: center; padding: 32px; max-width: 36ch; color: var(--muted); }
.map-placeholder .icon { width: 40px; height: 40px; color: var(--gold); margin: 0 auto 12px; }
.map-placeholder p { margin: 0 0 6px; }
.map-placeholder strong { color: var(--ink); font-family: var(--font-serif); font-size: 1.2rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-deep); color: rgba(255,255,255,.72); padding-top: 64px; font-size: .97rem; }
.site-footer a { color: rgba(255,255,255,.85); text-decoration: none; }
.site-footer a:hover { color: var(--gold-light); }
.footer-grid { display: grid; gap: 40px; padding-bottom: 48px; }
@media (min-width: 820px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1.2fr; gap: 56px; } }
.brand-light { color: var(--white) !important; margin-bottom: 18px; }
.brand-light .brand-crest { background: var(--gold); color: var(--navy-deep); }
.footer-about p { max-width: 44ch; margin: 0; }
.footer-title { font-family: var(--font-sans); font-size: 1rem; font-weight: 600; color: var(--white); margin-bottom: 16px; letter-spacing: 0; }
.footer-links li + li { margin-top: 10px; }
.footer-contact li { display: flex; gap: 12px; align-items: flex-start; overflow-wrap: anywhere; }
.footer-contact li + li { margin-top: 14px; }
.footer-contact .icon { width: 20px; height: 20px; color: var(--gold-light); margin-top: 3px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding-top: 22px; padding-bottom: 26px; }
.footer-bottom p { margin: 0; font-size: .9rem; }

/* ---------- Floating WhatsApp ---------- */
.wa-float {
  position: fixed; right: 20px; bottom: 20px; z-index: 40;
  width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--wa); color: var(--white);
  box-shadow: 0 10px 24px rgba(13,27,51,.25);
  transition: transform .2s;
}
.wa-float:hover { transform: scale(1.06); color: var(--white); }
.wa-float .icon { width: 30px; height: 30px; }

/* Header placeholder keeps layout stable before JS renders it. */
#site-header:empty { min-height: var(--header-h); }

/* ---------- Two institutions (About) ---------- */
.institutions { display: grid; gap: 16px; margin: 28px 0 8px; }
@media (min-width: 560px) { .institutions { grid-template-columns: 1fr 1fr; } }
.institution { display: flex; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); }
.institution img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex: none; }
.institution strong { display: block; color: var(--ink); font-family: var(--font-serif); font-size: 1.05rem; line-height: 1.25; }
.institution span { font-size: .92rem; color: var(--muted); }
