/* ==========================================================================
   Neribo Academy
   Palette:  navy #0E2A47, green #1E7B52, yellow #F5B800, chalk #F1F5F9,
             ruling blue #C3D7EC, margin red #D8574B
   Type:     Lexend (headings), Source Sans 3 (body)
   ========================================================================== */

:root {
  --navy: #0e2a47;
  --green: #1e7b52;
  --green-dark: #176243;
  --green-tint: #e4f1ea;
  --yellow: #f5b800;
  --yellow-dark: #e0a800;
  --chalk: #f1f5f9;
  --paper: #ffffff;
  --ink: #1b2a3b;
  --muted: #465769;
  --rule-blue: #c3d7ec;
  --margin-red: #d8574b;
  --line: #d5e0ec;
  --ph-1: #d6e0eb;
  --ph-2: #eaf0f6;

  --font-head: "Lexend", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

  --radius: 6px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
p { margin: 0 0 1rem; max-width: 62ch; }
h1, h2, h3, h4 { margin: 0; }
ul, ol { margin: 0; padding: 0; }

a { color: var(--green-dark); text-underline-offset: 0.2em; }
a:hover { color: var(--navy); }

:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 3px;
  border-radius: 2px;
}
.on-dark :focus-visible { outline-color: var(--yellow); }

.wrap {
  width: min(100% - 2.5rem, 72rem);
  margin-inline: auto;
}

.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: 1rem; top: -4rem;
  z-index: 50;
  background: var(--navy);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  text-decoration: none;
}
.skip-link:focus { top: 1rem; outline-color: var(--yellow); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.6rem 1.4rem;
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-yellow { background: var(--yellow); color: var(--navy); }
.btn-yellow:hover { background: var(--yellow-dark); color: var(--navy); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-dark); color: #fff; }
.btn-outline { border-color: var(--navy); color: var(--navy); background: transparent; }
.btn-outline:hover { background: var(--navy); color: #fff; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 4.25rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--navy);
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: var(--navy); }
.brand-mark { flex: none; width: auto; height: 3rem; }
.brand-mark-footer {
  height: 3rem;
  background: #fff;
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius);
}

.site-nav {
  display: flex;
  gap: 1.75rem;
  margin-left: auto;
}
.site-nav a {
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
  text-decoration: none;
  padding-block: 0.4rem;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { border-bottom-color: var(--navy); color: var(--navy); }

.bar-cta { min-height: 2.75rem; padding-inline: 1.1rem; white-space: nowrap; }

.menu-toggle {
  display: none;
  width: 2.75rem; height: 2.75rem;
  padding: 0;
  background: transparent;
  border: 2px solid var(--navy);
  border-radius: var(--radius);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.menu-icon,
.menu-icon::before,
.menu-icon::after {
  display: block;
  width: 1.15rem; height: 2px;
  background: var(--navy);
  content: "";
  position: relative;
}
.menu-icon::before { position: absolute; top: -6px; }
.menu-icon::after { position: absolute; top: 6px; }
.menu-toggle[aria-expanded="true"] .menu-icon { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-icon::before { top: 0; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-icon::after { top: 0; transform: rotate(-45deg); }

@media (max-width: 30rem) {
  .bar { gap: 0.6rem; }
  .brand { font-size: 1rem; gap: 0.5rem; }
  .brand-mark { height: 2.6rem; }
  .brand-mark-footer { height: 2.75rem; }
  .bar-cta { padding-inline: 0.85rem; font-size: 0.95rem; }
}

@media (max-width: 62rem) {
  .bar-cta { margin-left: auto; }
  .site-nav { margin-left: 0; }

  .js .menu-toggle { display: inline-flex; }
  .js .site-nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 1.25rem 1rem;
  }
  .js .site-nav.is-open { display: flex; }
  .js .site-nav a {
    padding: 0.9rem 0;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--line);
  }
  .js .site-nav a:hover { border-bottom-color: var(--line); }

  /* Without JavaScript the links simply wrap under the logo */
  html:not(.js) .bar { flex-wrap: wrap; padding-block: 0.5rem; }
  html:not(.js) .site-nav { order: 3; width: 100%; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
}

/* ---------- Hero: an exercise-book page ---------- */
.hero {
  --rule: clamp(2.75rem, 2.1rem + 2.6vw, 3.75rem);
  --gutter: clamp(1.1rem, 5vw, 4.5rem);
  position: relative;
  background-color: var(--paper);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(var(--rule) - 1px),
    var(--rule-blue) calc(var(--rule) - 1px),
    var(--rule-blue) var(--rule)
  );
  border-bottom: 4px solid var(--navy);
}
.hero::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: var(--gutter);
  width: 2px;
  background: var(--margin-red);
  transform-origin: top;
  animation: draw-margin 0.9s ease-out both;
}

.hero-inner {
  display: grid;
  gap: calc(var(--rule) * 0.75);
  align-items: start;
  padding: var(--rule) 1.25rem calc(var(--rule) * 1.5) calc(var(--gutter) + 1.4rem);
}

.hero-copy { max-width: 40rem; animation: fade-in 0.7s ease-out 0.55s both; }

.hero h1 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: calc(var(--rule) * 0.74);
  line-height: var(--rule);
  letter-spacing: -0.015em;
  color: var(--navy);
  margin: 0 0 var(--rule);
  max-width: 15em;
}

.hero-lead {
  font-size: calc(var(--rule) * 0.38);
  line-height: calc(var(--rule) / 2);
  color: var(--ink);
  margin: 0 0 var(--rule);
  max-width: 34rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.hero-photo { margin: 0; animation: fade-in 0.7s ease-out 0.8s both; }
.photo-hero {
  aspect-ratio: 4 / 3;
  box-shadow: 0.75rem 0.75rem 0 var(--yellow);
  margin: 0 0.75rem 0.75rem 0;
}

@media (min-width: 60rem) {
  .hero-inner {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: 3rem;
    padding-right: var(--gutter);
  }
  .hero-photo { justify-self: end; width: 100%; max-width: 28rem; margin-top: var(--rule); }
  .photo-hero { aspect-ratio: 4 / 5; }
}

@keyframes draw-margin { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Shared section styles ---------- */
.section { padding-block: clamp(3.5rem, 8vw, 6rem); }
.section-chalk { background: var(--chalk); }
.section-navy { background: var(--navy); color: #fff; }

.h2 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--navy);
  margin-bottom: 1.25rem;
  text-wrap: balance;
}
.section-navy .h2 { color: #fff; }

.section-head { margin-bottom: 2.5rem; max-width: 40rem; }
.section-head .h2 { margin-bottom: 0.75rem; }
.section-intro { font-size: 1.2rem; color: var(--muted); margin: 0; }

/* Photo placeholder: a neutral gradient sits behind every image.
   If the image file is missing, the gradient (and a label) simply stays. */
.photo {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--ph-1), var(--ph-2));
  border-radius: var(--radius);
}
.photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ph-label {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  line-height: 1.35;
  color: var(--muted);
}
.photo img.focus-top { object-position: center 30%; }
.photo-landscape { aspect-ratio: 4 / 3; }
.photo-campus { aspect-ratio: 6 / 5; }
.photo-portrait { aspect-ratio: 4 / 5; }
figure { margin: 0; }

/* ---------- About ---------- */
.about { display: grid; gap: 2.25rem; }
.mission {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: clamp(1.2rem, 1.05rem + 0.8vw, 1.5rem);
  line-height: 1.45;
  color: var(--navy);
  border-left: 4px solid var(--yellow);
  padding-left: 1.1rem;
  margin: 0 0 1.5rem;
  max-width: 36rem;
}
@media (min-width: 58rem) {
  .about { grid-template-columns: 5fr 6fr; gap: 4.5rem; align-items: center; }
}

/* ---------- Programs ---------- */
.group-title {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 1.15rem;
  color: var(--navy);
  margin-bottom: 1rem;
}
.group-title-tutorial { margin-top: 2.5rem; }

.levels {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 40rem) { .levels { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 66rem) { .levels { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 40rem) { .levels-tutorial { grid-template-columns: repeat(2, 1fr); } }

.level {
  background: var(--paper);
  border-top: 4px solid var(--navy);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 1.25rem 1.25rem 1.5rem;
}
.level h4 {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 1.2rem;
  line-height: 1.3;
  color: var(--navy);
  margin-bottom: 0.25rem;
}
.level .range {
  font-weight: 600;
  font-size: 1rem;
  color: var(--green-dark);
  margin-bottom: 0.75rem;
}
.level p:last-child { margin-bottom: 0; font-size: 1.05rem; }

.level-tutorial {
  background: var(--green-tint);
  border-top-color: var(--green);
}

/* ---------- Why choose us ---------- */
.why { display: grid; gap: 2.5rem; }
.points { list-style: none; }
.points li {
  border-top: 1px solid rgba(255, 255, 255, 0.28);
  padding: 1.25rem 0 0.5rem;
}
.points h3 {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 1.2rem;
  color: var(--yellow);
  margin-bottom: 0.35rem;
}
.points p { color: #dbe6f1; }
@media (min-width: 58rem) {
  .why { grid-template-columns: 5fr 6fr; gap: 4.5rem; align-items: start; }
  .why-photo { position: sticky; top: 6rem; }
}

/* ---------- Staff ---------- */
.staff-grid {
  display: grid;
  gap: 2.25rem 2rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}
.staff-card { max-width: 24rem; }
.staff-card .photo { margin-bottom: 1rem; }
.staff-card h3 {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1.3;
  color: var(--navy);
  margin-bottom: 0.4rem;
}
.staff-card p { font-size: 1.05rem; margin: 0; }
@media (min-width: 62rem) {
  .staff-card:nth-child(2) { margin-top: 2.75rem; }
}

/* ---------- Admissions ---------- */
.admissions { display: grid; gap: 2.5rem; }
.admissions-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0 1rem;
}
.small-note { font-size: 1rem; color: var(--muted); }

.steps { list-style: none; counter-reset: step; }
.steps li {
  position: relative;
  counter-increment: step;
  padding: 0 0 2rem 3.75rem;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 0;
  display: grid;
  place-items: center;
  width: 2.5rem; height: 2.5rem;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 500;
}
.steps li::after {
  content: "";
  position: absolute;
  left: 1.2rem;
  top: 2.85rem;
  bottom: 0.35rem;
  width: 2px;
  background: var(--rule-blue);
}
.steps li:last-child { padding-bottom: 0; }
.steps li:last-child::after { display: none; }
.steps h3 {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 1.2rem;
  color: var(--navy);
  margin: 0.3rem 0 0.25rem;
}
.steps p { margin: 0; }

@media (min-width: 58rem) {
  .admissions { grid-template-columns: 5fr 6fr; gap: 4.5rem; align-items: start; }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy);
  color: #dbe6f1;
  border-top: 4px solid var(--yellow);
  padding-top: 3rem;
}
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--yellow); }
.site-footer .brand { color: #fff; }
.site-footer .brand:hover { color: #fff; }

.footer-grid { display: grid; gap: 2rem; }
.footer-brand p { margin-top: 1rem; max-width: 26rem; }
.site-footer h2 {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--yellow);
  margin-bottom: 0.75rem;
}
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 0.4rem; }

.footer-base {
  margin-top: 2.5rem;
  padding-block: 1.25rem 1.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.95rem;
}
.footer-base p { margin: 0; }

@media (min-width: 52rem) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; gap: 3rem; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero::before,
  .hero-copy,
  .hero-photo { animation: none; }
  .btn { transition: none; }
}
