/* ==========================================================================
   NEXUS — Online Math Tutorials
   Palette sampled directly from the brand assets in /assets/img.
   ========================================================================== */

:root {
  /* Navy gradient stops, sampled from 01-hero-banner.png */
  --navy-900: #071230;
  --navy-800: #09193b;
  --navy-700: #0d2350;
  --navy-600: #123a72;
  --navy-500: #1b5492;

  /* Gold accent, sampled from the hero pill + button */
  --gold: #e7b466;
  --gold-light: #f0c98a;
  --gold-dark: #c9924a;
  --on-gold: #3f2c0c;

  /* Neutrals */
  --cream: #f6f3e8;
  --text: #f6f3e8;
  --text-dim: #b9c9df;
  --text-dimmer: #8ea4c2;
  --hairline: rgba(219, 232, 250, 0.14);
  --card: rgba(255, 255, 255, 0.045);
  --card-hover: rgba(255, 255, 255, 0.075);

  --maxw: 1180px;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow: 0 18px 44px rgba(3, 9, 24, 0.42);
  --shadow-lg: 0 28px 70px rgba(3, 9, 24, 0.55);

  --font-display: "Poppins", "Segoe UI", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* --------------------------------------------------------------- base --- */

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

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-dim);
  background: var(--navy-900);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text);
  line-height: 1.14;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  font-weight: 700;
}

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 50%;
  top: -100px;
  transform: translateX(-50%);
  z-index: 200;
  background: var(--gold);
  color: var(--on-gold);
  padding: 0.7rem 1.3rem;
  border-radius: 0 0 10px 10px;
  font-weight: 700;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 0; color: var(--on-gold); }

/* ------------------------------------------------------------ layout --- */

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(1.15rem, 4vw, 2rem);
}

.section { position: relative; padding-block: clamp(4rem, 9vw, 7rem); }
.section--tight { padding-block: clamp(3rem, 6vw, 4.5rem); }

/* Shared navy gradient + constellation texture, matching the PNG banners. */
.band {
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(120% 130% at 12% 0%, var(--navy-500) 0%, var(--navy-600) 34%, var(--navy-800) 74%, var(--navy-900) 100%);
}
.band::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("assets/constellation.svg") center / cover no-repeat;
  opacity: 0.85;
  pointer-events: none;
}
.band--deep {
  background:
    radial-gradient(100% 140% at 50% 0%, var(--navy-700) 0%, var(--navy-800) 46%, var(--navy-900) 100%);
}
.band--flat { background: var(--navy-900); }

.eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--on-gold);
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  padding: 0.42rem 1.05rem;
  border-radius: 999px;
  margin-bottom: 1.15rem;
}

.section__head { max-width: 46rem; margin-bottom: clamp(2.25rem, 4vw, 3.25rem); }
.section__head--center { margin-inline: auto; text-align: center; }
.section__title { font-size: clamp(1.85rem, 4.2vw, 2.9rem); }
.section__lead { font-size: clamp(1rem, 1.6vw, 1.12rem); color: var(--text-dim); }

/* ------------------------------------------------------------ buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.95rem 1.9rem;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease),
              background-color 0.18s var(--ease), color 0.18s var(--ease);
}

.btn--gold {
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  color: var(--on-gold);
  box-shadow: 0 10px 26px rgba(231, 180, 102, 0.24);
}
.btn--gold:hover {
  color: var(--on-gold);
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(231, 180, 102, 0.34);
}

.btn--ghost {
  border-color: rgba(219, 232, 250, 0.4);
  color: var(--text);
  background: transparent;
}
.btn--ghost:hover {
  color: var(--text);
  border-color: var(--gold);
  background: rgba(231, 180, 102, 0.1);
  transform: translateY(-2px);
}

.btn--sm { padding: 0.7rem 1.4rem; font-size: 0.78rem; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.9rem;
}
.btn-row--center { justify-content: center; }

/* --------------------------------------------------------------- nav --- */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 18, 48, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hairline);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 74px;
}

.brand { display: flex; align-items: center; gap: 0.7rem; }
.brand:hover { color: inherit; }
/* The mark is 255x240, not square — pin the height and let width follow so
   it never gets squashed. */
.brand__mark { width: auto; height: 40px; flex: none; }
.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.22rem;
  letter-spacing: 0.13em;
  color: var(--text);
  line-height: 1;
}
.brand__tag {
  display: block;
  font-family: var(--font-body);
  font-size: 0.63rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dimmer);
  margin-top: 0.28rem;
  font-weight: 500;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 1.9rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav__links a {
  color: var(--text-dim);
  font-size: 0.93rem;
  font-weight: 500;
  position: relative;
  padding-block: 0.35rem;
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 2px;
  background: var(--gold);
  transition: right 0.25s var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__links a:hover::after { right: 0; }

.nav__cta { display: inline-flex; }

/* The CTA inside the link list exists only for the collapsed mobile menu —
   the standalone .nav__cta covers desktop, so hide this one to avoid two. */
.nav__links .btn { display: none; }

.nav__toggle {
  display: none;
  width: 46px;
  height: 46px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  padding: 0;
  place-items: center;
}
.nav__toggle span,
.nav__toggle span::before,
.nav__toggle span::after {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.22s var(--ease), opacity 0.22s var(--ease);
}
.nav__toggle span { position: relative; }
.nav__toggle span::before,
.nav__toggle span::after { content: ""; position: absolute; left: 0; }
.nav__toggle span::before { top: -6px; }
.nav__toggle span::after { top: 6px; }
.nav__toggle[aria-expanded="true"] span { background: transparent; }
.nav__toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

/* -------------------------------------------------------------- hero --- */

.hero { padding-block: clamp(3.25rem, 7vw, 5.75rem); overflow: hidden; }

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2.25rem, 5vw, 4rem);
  align-items: center;
}

.hero__title {
  font-size: clamp(2.5rem, 6.4vw, 4.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1.1rem;
}

.hero__lead {
  font-size: clamp(1.03rem, 1.8vw, 1.2rem);
  color: var(--text-dim);
  max-width: 34rem;
}

.hero__checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.85rem;
  list-style: none;
  margin: 2.4rem 0 0;
  padding: 0;
}
.hero__checks li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.check-dot {
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 50%;
  background: var(--gold);
  display: grid;
  place-items: center;
}
.check-dot svg { width: 13px; height: 13px; stroke: var(--on-gold); }

.hero__visual {
  position: relative;
  aspect-ratio: 2 / 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(219, 232, 250, 0.16);
}
/* The source PNG carries its own baked-in caption across the top third;
   anchoring to the bottom crops it away and leaves just the illustration. */
.hero__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
}

/* ------------------------------------------------------------ levels --- */

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 275px), 1fr));
  gap: clamp(1.15rem, 2.4vw, 1.75rem);
}

.level {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.24s var(--ease), border-color 0.24s var(--ease),
              background-color 0.24s var(--ease);
}
.level:hover {
  transform: translateY(-6px);
  border-color: rgba(231, 180, 102, 0.45);
  background: var(--card-hover);
}
.level__art {
  position: relative;
  isolation: isolate;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 3vw, 1.6rem);
  border-bottom: 1px solid var(--hairline);
  background:
    radial-gradient(125% 135% at 20% 10%, var(--navy-500) 0%, #164e8b 32%, #0b1f45 74%, var(--navy-900) 100%);
}
.level__art::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("assets/constellation.svg") center / cover no-repeat;
  opacity: 0.7;
  pointer-events: none;
}
.level__art svg { width: 100%; height: auto; display: block; }

.level__body { padding: 1.5rem 1.5rem 1.7rem; }

.level__badge {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--on-gold);
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  padding: 0.32rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 0.85rem;
}

.level__body h3 { font-size: 1.12rem; margin-bottom: 0.35rem; }

.level__subjects {
  font-size: 0.87rem;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 0.7rem;
}

.level__body p { font-size: 0.93rem; color: var(--text-dim); }

/* --------------------------------------------------------------- why --- */

.why__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  gap: clamp(2.25rem, 5vw, 4.5rem);
  align-items: start;
}

.why__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.6rem; }

.why__item { display: grid; grid-template-columns: auto 1fr; gap: 1.1rem; align-items: start; }
.why__item h3 { font-size: 1.05rem; margin-bottom: 0.3rem; }
.why__item p { font-size: 0.94rem; color: var(--text-dim); }

.tick {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  background: rgba(231, 180, 102, 0.16);
  border: 1px solid rgba(231, 180, 102, 0.5);
  display: grid;
  place-items: center;
  margin-top: 0.15rem;
}
.tick svg { width: 15px; height: 15px; stroke: var(--gold); }

/* ----------------------------------------------------------- process --- */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: clamp(1.15rem, 2.4vw, 1.6rem);
  counter-reset: step;
}

.step {
  position: relative;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 2.4rem 1.7rem 2rem;
  text-align: center;
  transition: transform 0.24s var(--ease), border-color 0.24s var(--ease);
}
.step:hover { transform: translateY(-5px); border-color: rgba(231, 180, 102, 0.4); }

.step__num {
  width: 62px;
  height: 62px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  color: var(--on-gold);
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px rgba(231, 180, 102, 0.22);
}
.step h3 { font-size: 1.12rem; letter-spacing: 0.03em; text-transform: uppercase; margin-bottom: 0.55rem; }
.step p { font-size: 0.93rem; color: var(--text-dim); }

/* ---------------------------------------------------------- features --- */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 275px), 1fr));
  gap: clamp(1.15rem, 2.4vw, 1.75rem);
}

.tile {
  position: relative;
  isolation: isolate;
  min-height: clamp(255px, 30vw, 310px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(1.5rem, 3vw, 2.1rem);
  border-radius: var(--radius-lg);
  border: 1px solid var(--hairline);
  overflow: hidden;
  box-shadow: var(--shadow);
  background:
    radial-gradient(125% 135% at 18% 8%, var(--navy-500) 0%, #164e8b 30%, #0b1f45 72%, var(--navy-900) 100%);
  transition: transform 0.24s var(--ease), border-color 0.24s var(--ease);
}
.tile::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("assets/constellation.svg") center / cover no-repeat;
  opacity: 0.7;
  pointer-events: none;
}
.tile:hover { transform: translateY(-5px); border-color: rgba(231, 180, 102, 0.4); }

.tile__art { width: min(64%, 205px); margin-bottom: clamp(1rem, 2.4vw, 1.5rem); }
.tile__art svg { width: 100%; height: auto; display: block; }

.tile__title {
  font-size: clamp(1.02rem, 2.1vw, 1.28rem);
  text-transform: uppercase;
  letter-spacing: 0.035em;
  margin: 0 0 0.45rem;
}
.tile__sub { font-size: clamp(0.84rem, 1.6vw, 0.95rem); color: var(--text-dim); margin: 0; }

/* ----------------------------------------------------------- lessons --- */

.lesson {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
  gap: clamp(1.75rem, 4vw, 3.25rem);
  align-items: center;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
/* The thumbnail carries baked-in text, so it must keep its native 16:9 —
   filling the column height instead would crop the title off both sides. */
.lesson__img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.lesson__body { padding: clamp(1.75rem, 3.5vw, 2.75rem); padding-left: 0; }

/* --------------------------------------------------------------- cta --- */

.cta { text-align: center; }
.cta__title { font-size: clamp(1.9rem, 4.6vw, 3rem); margin-bottom: 0.7rem; }
.cta__lead { font-size: clamp(1rem, 1.7vw, 1.15rem); max-width: 38rem; margin-inline: auto; }

/* ------------------------------------------------------------ footer --- */

.footer { background: var(--navy-900); border-top: 1px solid var(--hairline); }
.footer__top {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, 1fr));
  gap: clamp(2rem, 4vw, 3.5rem);
  padding-block: clamp(3rem, 6vw, 4.25rem);
}
.footer__about p { font-size: 0.93rem; max-width: 26rem; margin-top: 1.1rem; }

.footer h4 {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.15rem;
}
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }
.footer ul a, .footer address a { color: var(--text-dim); font-size: 0.93rem; }
.footer ul a:hover, .footer address a:hover { color: var(--gold); }
.footer address { font-style: normal; font-size: 0.93rem; display: grid; gap: 0.7rem; }

.socials { display: flex; gap: 0.6rem; margin-top: 1.6rem; }
.socials a {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  display: grid;
  place-items: center;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease),
              transform 0.2s var(--ease);
}
.socials a:hover { background: var(--gold); border-color: var(--gold); transform: translateY(-2px); }
.socials svg { width: 17px; height: 17px; fill: var(--text-dim); }
.socials a:hover svg { fill: var(--on-gold); }

.footer__bottom {
  border-top: 1px solid var(--hairline);
  padding-block: 1.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  justify-content: space-between;
  align-items: center;
  font-size: 0.86rem;
  color: var(--text-dimmer);
}

/* Marks copy that still needs the owner's real details. */
.todo {
  color: var(--gold-light);
  background: rgba(231, 180, 102, 0.12);
  border: 1px dashed rgba(231, 180, 102, 0.45);
  border-radius: 6px;
  padding: 0.05rem 0.4rem;
  font-size: 0.86em;
}

/* -------------------------------------------------------- responsive --- */

@media (max-width: 900px) {
  .hero__grid,
  .why__grid,
  .lesson { grid-template-columns: 1fr; }

  .hero__visual { order: -1; }
  .lesson__body { padding: 0 clamp(1.4rem, 5vw, 2rem) clamp(1.9rem, 5vw, 2.4rem); }
  .footer__top { grid-template-columns: 1fr 1fr; }
  .footer__about { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .nav__toggle { display: grid; }
  .nav__cta { display: none; }

  .nav__links {
    position: absolute;
    inset: 74px 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--navy-800);
    border-bottom: 1px solid var(--hairline);
    padding: 0.5rem clamp(1.15rem, 4vw, 2rem) 1.4rem;
    display: none;
  }
  .nav__links[data-open="true"] { display: flex; }
  .nav__links li { border-top: 1px solid var(--hairline); }
  .nav__links a { display: block; padding: 0.95rem 0; }
  .nav__links a::after { display: none; }
  .nav__links .btn { display: inline-flex; margin-top: 1rem; }
}

@media (max-width: 560px) {
  .hero__checks { gap: 0.7rem 1.2rem; }
  .btn { width: 100%; }
  .btn-row { flex-direction: column; align-items: stretch; }
  .footer__top { grid-template-columns: 1fr; }
  .footer__bottom { justify-content: center; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
