/* Future Kid — homepage styles. Reference width 1346px (sizes sampled from the mockup). */

@font-face {
  font-family: "Nunito";
  src: url("/assets/fonts/nunito-latin-var.woff2") format("woff2");
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --navy: #070a33;
  --blue: #0a2cfe;
  --blue-dark: #001fc4;
  --link: #0a17ee;
  --lavender: #dacdfb;
  --ivory: #fdf8ef;
  --white: #ffffff;
  --coding: #fedc4a;
  --design: #75c8fa;
  --engineering: #9ae682;
  --robotics: #c29ff9;
  --focus: #0a2cfe;
  --page-pad: 33px;
  --radius-tile: 14px;
  --font: "Nunito", ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--navy);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 { margin: 0; font-weight: 900; letter-spacing: -0.015em; line-height: 1.04; }
p { margin: 0; }

a { color: inherit; }

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

[tabindex="-1"]:focus { outline: none; }

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--navy);
  color: var(--white);
  font-weight: 800;
  border-radius: 8px;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 34px;
  border: 2px solid var(--navy);
  border-radius: 9px;
  font: 800 1.6875rem/1 var(--font);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s ease, color .15s ease;
}
.btn--primary {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}
.btn--primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn--outline { background: var(--white); color: var(--navy); }
.btn--outline:hover { background: var(--navy); color: var(--white); }
.btn--small {
  min-height: 42px;
  padding: 0 24px;
  font-size: 1.4rem;
  border-radius: 10px;
}

/* ---------- Header ---------- */

.site-header { background: var(--white); }
.site-header__inner {
  display: flex;
  align-items: center;
  height: 63px;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 var(--page-pad) 0 46px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--navy);
}
.brand__mark { width: 78px; height: auto; }
.brand__word {
  white-space: nowrap;
  font-weight: 900;
  font-size: 2.45rem;
  letter-spacing: -0.01em;
  line-height: 1;
}

.site-nav { margin-left: clamp(32px, 7.1vw, 96px); }
.site-nav ul {
  display: flex;
  gap: clamp(28px, 4.5vw, 61px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  white-space: nowrap;
  font-weight: 800;
  font-size: 1.53rem;
  text-decoration: none;
}
.site-nav a:hover { color: var(--blue); }

.site-header__cta { margin-left: auto; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--lavender);
  aspect-ratio: 1346 / 434;
  max-height: 560px;
  width: 100%;
}
.hero__art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
}
.hero__copy {
  position: relative;
  max-width: 1600px;
  margin: 0 auto;
  /* Positions and sizes scale with the viewport so the copy keeps clear of the robot. */
  padding: clamp(36px, 3.95vw, 54px) 0 0 clamp(28px, 3.42vw, 46px);
}
.hero h1 {
  font-size: clamp(3rem, 5.4vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: -0.012em;
  word-spacing: -0.06em;
}
.hero__lede {
  max-width: 21em;
  margin-top: clamp(10px, 1vw, 16px);
  font-weight: 600;
  font-size: clamp(1.05rem, 2.1vw, 1.8rem);
  line-height: 1.22;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: clamp(18px, 1.9vw, 26px);
}
.hero__actions .btn {
  min-height: clamp(44px, 4.55vw, 62px);
  padding: 0 clamp(18px, 1.95vw, 26px);
  font-size: clamp(1rem, 1.84vw, 1.55rem);
}

/* ---------- Shared section layout ---------- */

.learn, .gallery {
  max-width: 1346px;
  margin: 0 auto;
  padding-inline: var(--page-pad);
}
.learn h2, .gallery h2 {
  font-size: clamp(2rem, 4.2vw, 3.55rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

/* ---------- Learning tiles ---------- */

.learn { padding-top: 22px; }
.learn h2 { padding-left: 9px; }

.tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}
.tile {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius-tile);
  text-decoration: none;
  color: var(--navy);
  aspect-ratio: 315 / 227;
  transition: transform .15s ease, box-shadow .15s ease;
}
.tile--coding { background: var(--coding); }
.tile--design { background: var(--design); }
.tile--engineering { background: var(--engineering); }
.tile--robotics { background: var(--robotics); }
.tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tile__label {
  position: absolute;
  z-index: 1;
  top: clamp(5px, 0.6vw, 8px);
  left: clamp(14px, 1.85vw, 25px);
  font-weight: 900;
  font-size: clamp(1.35rem, 2.75vw, 2.35rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.tile:hover { transform: translateY(-3px); box-shadow: 0 6px 0 rgba(7, 10, 51, .12); }
.tile:focus-visible {
  outline: 4px solid var(--navy);
  outline-offset: 4px;
  border-radius: var(--radius-tile);
}
@media (prefers-reduced-motion: reduce) { .tile:hover { transform: none; } }

/* ---------- Gallery ---------- */

.gallery { padding-top: 27px; padding-bottom: 48px; }
.gallery h2 { font-size: clamp(2rem, 4.4vw, 3.72rem); }
.gallery__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-left: 7px;
}
.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-right: 5px;
  color: var(--link);
  font-weight: 800;
  font-size: clamp(1.15rem, 1.8vw, 1.55rem);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.text-link:hover { color: var(--navy); }

.feature {
  display: grid;
  grid-template-columns: 61.7% minmax(0, 1fr);
  align-items: center;
  gap: clamp(20px, 2.3vw, 31px);
  margin-top: 16px;
}
.feature__img {
  width: 100%;
  aspect-ratio: 788 / 226;
  object-fit: cover;
  border-radius: 14px;
}
.feature h3 {
  font-size: clamp(1.75rem, 3.33vw, 2.85rem);
  line-height: 1.06;
  letter-spacing: -0.018em;
}
.feature__link { margin-top: 10px; }
.feature .feature__by { margin-top: 6px; font-weight: 800; }
.feature p {
  margin-top: 8px;
  font-weight: 600;
  font-size: clamp(1.15rem, 1.95vw, 1.65rem);
}

/* ---------- Footer & socials ---------- */

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.site-footer { background: var(--white); }
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  max-width: 1346px;
  margin: 0 auto;
  padding: 18px var(--page-pad);
}
.site-footer__label { font-weight: 900; font-size: 1.25rem; }
.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.social {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 18px;
  border: 2px solid var(--navy);
  border-radius: 10px;
  font-weight: 800;
  font-size: 1.1rem;
  text-decoration: none;
  color: var(--navy);
  transition: background-color .15s ease, color .15s ease;
}
.social:hover { background: var(--navy); color: var(--white); }
.social__icon { width: 22px; height: 22px; flex: none; }

/* ---------- Tablet & phone ---------- */

@media (max-width: 1100px) {
  .brand__mark { width: 64px; }
  .brand__word { font-size: 2rem; }
  .site-nav a { font-size: 1.3rem; }
  .btn--small { font-size: 1.2rem; padding: 0 18px; }
}

@media (max-width: 900px) {
  .site-header__inner { padding-left: var(--page-pad); }
  .brand__mark { width: 60px; }
  .brand__word { font-size: 1.9rem; }
  .site-nav { margin-left: auto; }
  .site-nav ul { gap: 24px; }
  .site-nav a { font-size: 1.2rem; }
  .site-header__cta { margin-left: 24px; }
  .btn--small { font-size: 1.15rem; padding: 0 18px; }
  .learn h2, .gallery h2 { font-size: clamp(2rem, 5.6vw, 2.8rem); }
  .feature { grid-template-columns: 1fr; gap: 16px; }
  .feature h3 { font-size: clamp(1.6rem, 5vw, 2.4rem); }
  .feature p { font-size: clamp(1.1rem, 3vw, 1.4rem); }

  .hero {
    display: flex;
    flex-direction: column;
    aspect-ratio: auto;
    min-height: 0;
    max-height: none;
  }
  .hero__copy { order: 1; padding: 36px var(--page-pad) 8px; margin: 0; }
  .hero__art { order: 2; }
  .hero__art img {
    position: static;
    width: 100%;
    height: auto;
    aspect-ratio: 760 / 434;
    object-position: right bottom;
  }
  .hero h1 { font-size: clamp(2.5rem, 7.6vw, 3.6rem); }
  .hero__lede { font-size: clamp(1.15rem, 3vw, 1.45rem); }
  .hero__actions .btn { min-height: 50px; font-size: clamp(1.15rem, 2.6vw, 1.35rem); }

  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile__label { font-size: clamp(1.3rem, 4.4vw, 2rem); }
}

@media (max-width: 640px) {
  :root { --page-pad: 18px; }
  .site-header__inner { height: auto; min-height: 63px; flex-wrap: wrap; padding: 10px var(--page-pad) 2px; row-gap: 0; }
  .brand { gap: 8px; }
  .brand__mark { width: 44px; }
  .brand__word { font-size: 1.45rem; }
  .site-header__cta { margin-left: auto; min-height: 44px; padding: 0 14px; font-size: 1.02rem; }
  .site-nav { order: 3; width: 100%; margin-left: 0; }
  .site-nav ul { gap: 24px; }
  .site-nav a { font-size: 1.15rem; }

  .hero h1 { font-size: clamp(1.9rem, 8.4vw, 2.6rem); }
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn { min-width: 0; width: 100%; }

  .tiles { gap: 10px; }
  .tile { border-radius: 12px; }

  .gallery__head { flex-wrap: wrap; padding-left: 0; }
  .learn h2 { padding-left: 0; }
  .feature { grid-template-columns: 1fr; }
}

@media (max-width: 350px) {
  .site-header__cta { display: none; }
}

/* ---------- Header "Learn" menu ---------- */

.nav-menu { position: relative; }
.nav-menu__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--navy);
  font: 800 1.53rem/1 var(--font);
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.nav-menu__toggle:hover { color: var(--blue); }
.nav-menu__toggle.is-current { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; }
.nav-menu__toggle svg { width: .7em; height: .47em; margin-top: .1em; transition: transform .15s ease; }
.nav-menu.is-open .nav-menu__toggle svg { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .nav-menu__toggle svg { transition: none; } }

.site-nav .nav-menu__list {
  position: absolute;
  top: calc(100% + 8px);
  left: -14px;
  z-index: 20;
  display: grid;
  gap: 4px;
  width: 250px;
  margin: 0;
  padding: 8px;
  list-style: none;
  border: 2px solid var(--navy);
  border-radius: 14px;
  background: var(--white);
  box-shadow: 0 8px 0 rgba(7, 10, 51, .12);
}
.site-nav .nav-menu__list[hidden] { display: none; }
.site-nav .nav-menu__list a {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 1.2rem;
}
.site-nav .nav-menu__list a:hover { background: var(--ivory); color: var(--navy); }
.site-nav .nav-menu__list a[aria-current="page"] { background: var(--ivory); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.nav-menu__swatch {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 2px solid var(--navy);
}
.nav-menu__swatch--coding { background: var(--coding); }
.nav-menu__swatch--design { background: var(--design); }
.nav-menu__swatch--engineering { background: var(--engineering); }
.nav-menu__swatch--robotics { background: var(--robotics); }

@media (max-width: 1100px) { .nav-menu__toggle { font-size: 1.3rem; } }
@media (max-width: 900px)  { .nav-menu__toggle { font-size: 1.2rem; } }
@media (max-width: 640px)  { .nav-menu__toggle { font-size: 1.15rem; } .site-nav .nav-menu__list { left: 0; } }

.site-footer__about { margin-right: auto; }
.site-footer__about a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 800; font-size: 1.1rem; color: var(--navy); text-underline-offset: 4px; }
.site-footer__about a:hover { color: var(--blue); }

/* ---------- Header with four menu items: second row at tablet and phone widths ---------- */
@media (max-width: 1100px) {
  .site-header__inner { height: auto; min-height: 63px; flex-wrap: wrap; row-gap: 0; padding-top: 8px; padding-bottom: 2px; }
  .site-nav { order: 3; width: 100%; margin-left: 0; }
  .site-nav ul { flex-wrap: wrap; gap: 0 32px; }
  .site-header__cta { margin-left: auto; }
}
@media (max-width: 640px) {
  .site-nav ul { gap: 0 18px; }
  .site-nav a, .nav-menu__toggle { font-size: 1.05rem; }
}
@media (max-width: 440px) {
  .site-nav ul { gap: 0 10px; }
  .site-nav a, .nav-menu__toggle { font-size: .95rem; }
}
@media (max-width: 370px) {
  .site-nav ul { gap: 0 8px; }
  .site-nav a, .nav-menu__toggle { font-size: .88rem; }
}

/* ---------- Phone menu: hamburger button (added by nav.js) ---------- */
.nav-toggle, .site-nav__cta { display: none; }
@media (max-width: 760px) {
  .has-nav-toggle .site-header__inner { flex-wrap: wrap; align-items: center; min-height: 63px; padding-top: 8px; padding-bottom: 8px; row-gap: 0; }
  .has-nav-toggle .site-header__cta { margin-left: auto; }
  .has-nav-toggle .nav-toggle {
    display: inline-flex; align-items: center; gap: 8px;
    min-height: 44px; margin-left: 12px; padding: 0 12px;
    border: 2px solid var(--navy); border-radius: 12px;
    background: var(--white); color: var(--navy);
    font: 800 1.02rem/1 var(--font); cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .has-nav-toggle .nav-toggle:hover { color: var(--blue); border-color: var(--blue); }
  .nav-toggle__icon { position: relative; display: block; width: 20px; height: 14px; }
  .nav-toggle__icon span { position: absolute; left: 0; width: 100%; height: 2.5px; border-radius: 2px; background: currentColor; transition: transform .18s ease, opacity .18s ease, top .18s ease; }
  .nav-toggle__icon span:nth-child(1) { top: 0; }
  .nav-toggle__icon span:nth-child(2) { top: 5.75px; }
  .nav-toggle__icon span:nth-child(3) { top: 11.5px; }
  .is-nav-open .nav-toggle__icon span:nth-child(1) { top: 5.75px; transform: rotate(45deg); }
  .is-nav-open .nav-toggle__icon span:nth-child(2) { opacity: 0; }
  .is-nav-open .nav-toggle__icon span:nth-child(3) { top: 5.75px; transform: rotate(-45deg); }

  /* The menu itself: hidden until the button is pressed, then a full-width list under the logo. */
  .has-nav-toggle .site-nav { display: none; order: 3; width: 100%; margin: 8px 0 4px; }
  .has-nav-toggle.is-nav-open .site-nav { display: block; }
  .has-nav-toggle .site-nav > ul { display: block; border-top: 2px solid var(--navy); }
  .has-nav-toggle .site-nav > ul > li { border-bottom: 1px solid rgba(7, 10, 51, .15); }
  .has-nav-toggle .site-nav > ul > li > a,
  .has-nav-toggle .nav-menu__toggle { display: flex; width: 100%; min-height: 54px; font-size: 1.3rem; }
  .has-nav-toggle .nav-menu__toggle { justify-content: space-between; }
  .has-nav-toggle .site-nav .nav-menu__list {
    position: static; width: auto; margin: 0 0 10px; padding: 0 0 0 4px;
    border: 0; box-shadow: none; background: none;
  }
  .has-nav-toggle .site-nav .nav-menu__list a { font-size: 1.15rem; }
  .has-nav-toggle .site-nav > ul > li.site-nav__cta { display: none; border-bottom: 0; padding: 14px 0 6px; }
  .has-nav-toggle .site-nav__cta .btn { width: 100%; }
}
@media (max-width: 420px) {
  /* Too narrow for the header button as well: it lives at the bottom of the menu instead. */
  .has-nav-toggle .site-header__cta { display: none; }
  .has-nav-toggle .nav-toggle { margin-left: auto; }
  .has-nav-toggle .site-nav > ul > li.site-nav__cta { display: block; }
}
@media (prefers-reduced-motion: reduce) { .nav-toggle__icon span { transition: none; } }
.site-nav .site-nav__cta a, .site-nav .site-nav__cta a:hover { color: var(--white); justify-content: center; }
@media (max-width: 359px) {
  .has-nav-toggle .brand__mark { width: 38px; }
  .has-nav-toggle .brand__word { font-size: 1.25rem; }
  .has-nav-toggle .nav-toggle { padding: 0 9px; gap: 6px; }
}

/* ---------- Popup video (video.js, data-video-popup) ---------- */
.link-button { padding: 0; border: 0; background: none; font-family: inherit; line-height: inherit; cursor: pointer; text-align: left; }
.video-popup {
  position: fixed; inset: 0; margin: auto;
  width: min(92vw, calc(88vh * 720 / 1600 + 0px), 460px);
  max-height: 92vh; padding: 0; overflow: visible;
  border: 3px solid var(--navy); border-radius: 18px; background: #000;
}
.video-popup::backdrop { background: rgba(7, 10, 51, .78); }
.video-popup video { display: block; width: 100%; height: auto; max-height: 88vh; aspect-ratio: 720 / 1600; border-radius: 15px; background: #000; }
.video-popup__close {
  position: absolute; top: -14px; right: -14px; z-index: 1;
  display: grid; place-items: center; width: 48px; height: 48px; padding: 0;
  border: 3px solid var(--navy); border-radius: 50%; background: var(--white); color: var(--navy); cursor: pointer;
}
.video-popup__close svg { width: 22px; height: 22px; }
.video-popup__close:hover { background: var(--navy); color: var(--white); }
@media (max-width: 520px) { .video-popup__close { top: 8px; right: 8px; } }
.creation__shop { margin-top: 2px; }
.creation__shop .text-link { font-size: 1.1rem; }

/* Footer: About and Privacy side by side */
.site-footer__about { display: flex; flex-wrap: wrap; gap: 0 20px; }
