@font-face {
  font-family: "Fredoka";
  src: url("../assets/fonts/Fredoka-var.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../assets/fonts/AtkinsonHyperlegible-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../assets/fonts/AtkinsonHyperlegible-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../assets/fonts/AtkinsonHyperlegible-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --night: #0e1a3a;
  --night-2: #18295a;
  --mars: #ff6b2c;
  --mars-deep: #d94d12;
  --sun: #ffc93c;
  --sky: #3fb6f2;
  --paper: #f5f7fb;
  --peg: #e8edf6;
  --ink: #16203b;
  --muted: #56607a;
  --line: #d7deeb;
  --radius: 18px;
  --display: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }

.wrap { width: min(1180px, 100% - 40px); margin-inline: auto; }

.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 12px; }

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

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 600; font-size: 1.05rem;
  padding: 0.8em 1.5em; border-radius: 999px; border: 2px solid transparent;
  text-decoration: none; cursor: pointer; transition: transform .15s ease, background-color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-mars { background: var(--mars); color: #fff; box-shadow: 0 4px 0 var(--mars-deep); }
.btn-mars:hover { background: #ff7b42; }
.btn-ghost { border-color: rgba(255, 255, 255, .7); color: #fff; }
.btn-ghost:hover { background: rgba(255, 255, 255, .12); }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(14, 26, 58, .94);
  backdrop-filter: blur(8px);
  color: #fff;
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 600; font-size: 1.55rem; }
.brand-mark { width: 34px; height: 34px; color: #fff; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a { text-decoration: none; padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: .98rem; }
.nav a:hover { background: rgba(255, 255, 255, .1); }
.nav .nav-cta { background: var(--mars); margin-left: 6px; }
.nav .nav-cta:hover { background: #ff7b42; }
.nav-toggle { display: none; }

/* Hero */
.hero { position: relative; color: #fff; overflow: hidden; background: var(--night); }
.hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(100deg, rgba(14, 26, 58, .92) 0%, rgba(14, 26, 58, .72) 45%, rgba(14, 26, 58, .2) 100%); }
.hero-inner { position: relative; padding: clamp(72px, 12vw, 150px) 0 clamp(56px, 8vw, 96px); max-width: 1180px; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); max-width: 13ch; }
.hero-sub { margin-top: 18px; font-size: clamp(1.1rem, 1.8vw, 1.3rem); max-width: 34rem; color: #dfe6f5; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.hero-facts { list-style: none; padding: 0; margin: 44px 0 0; display: flex; flex-wrap: wrap; gap: 10px 28px; color: #c9d3ea; font-size: .98rem; }
.hero-facts strong { color: var(--sun); font-family: var(--display); font-size: 1.25rem; margin-right: 4px; }

/* Sections */
section { padding: clamp(64px, 9vw, 110px) 0; }
.section-head { max-width: 40rem; margin-bottom: 36px; }
.section-head h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); }
.section-head p { margin-top: 12px; color: var(--muted); font-size: 1.1rem; }

/* Kits: pegboard */
.kits { background: #fff; }
.level-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.level-filter button {
  font: 700 .98rem var(--body); color: var(--ink); cursor: pointer;
  padding: 9px 18px; border-radius: 999px; border: 2px solid var(--line); background: #fff;
}
.level-filter button:hover { border-color: var(--night-2); }
.level-filter button[aria-selected="true"] { background: var(--night); border-color: var(--night); color: #fff; }

.pegboard {
  border-radius: 26px;
  padding: clamp(16px, 3vw, 34px);
  background-color: var(--peg);
  background-image: radial-gradient(circle, #c9d2e4 2.6px, transparent 3px);
  background-size: 28px 28px;
  background-position: 14px 14px;
}
.kit-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: clamp(16px, 2.2vw, 26px); }

.kit {
  position: relative; display: flex; flex-direction: column;
  background: #fff; border-radius: var(--radius);
  box-shadow: 0 1px 0 var(--line), 0 10px 24px -14px rgba(22, 32, 59, .35);
  transform-origin: 50% -14px;
  transition: transform .25s ease, box-shadow .25s ease;
}
.kit[hidden] { display: none; }
/* The hanging hook every kit box sits on */
.kit::before {
  content: ""; position: absolute; top: -13px; left: 50%; translate: -50% 0;
  width: 26px; height: 18px; border: 4px solid #9aa6bf; border-bottom: 0; border-radius: 14px 14px 0 0;
}
.kit:hover { transform: rotate(-1.2deg); box-shadow: 0 1px 0 var(--line), 0 18px 30px -14px rgba(22, 32, 59, .4); }
.kit:nth-child(even):hover { transform: rotate(1.2deg); }

.kit-photo {
  position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center;
  border-radius: var(--radius) var(--radius) 0 0; padding: 22px; overflow: hidden;
}
.kit[data-level="1"] .kit-photo { background: #fff4d1; }
.kit[data-level="2"] .kit-photo { background: #ddf2fd; }
.kit[data-level="3"] .kit-photo { background: #ffe6da; }
.kit-photo img { max-height: 100%; width: auto; object-fit: contain; filter: drop-shadow(0 8px 10px rgba(22, 32, 59, .18)); }
.kit-age {
  position: absolute; top: 12px; left: 12px; font-size: .82rem; font-weight: 700;
  padding: 3px 10px; border-radius: 999px; background: #fff; color: var(--ink);
}
.kit-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.kit-body h3 { font-size: 1.3rem; }
.kit-learn { font-size: .9rem; font-weight: 700; color: var(--mars-deep); }
.kit-desc { color: var(--muted); font-size: .97rem; }
.kit-foot { margin-top: auto; padding-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kit-sku { font-size: .8rem; color: #8590a8; }
.kit-price { font-family: var(--display); font-weight: 600; font-size: 1.2rem; }
.kit-cur { font-family: var(--body); font-weight: 700; font-size: .72rem; color: #8590a8; }
.kit-add {
  font: 700 .95rem var(--body); cursor: pointer; padding: 8px 16px; border-radius: 999px;
  border: 2px solid var(--night); background: #fff; color: var(--night);
}
.kit-add:hover { background: var(--night); color: #fff; }
.kit-add[aria-pressed="true"] { background: var(--mars); border-color: var(--mars); color: #fff; }

.kits-more { margin-top: 26px; color: var(--muted); }
.kits-more a { color: var(--mars-deep); font-weight: 700; }

.enquiry-bar {
  position: fixed; left: 50%; bottom: 18px; translate: -50% 140%; z-index: 60;
  display: flex; align-items: center; gap: 16px; padding: 10px 10px 10px 22px;
  background: var(--night); color: #fff; border-radius: 999px; box-shadow: 0 14px 30px -10px rgba(14, 26, 58, .6);
  transition: translate .3s ease;
}
.enquiry-bar.is-on { translate: -50% 0; }
.enquiry-bar a { padding: .6em 1.2em; font-size: .98rem; white-space: nowrap; }
#enquiry-count { white-space: nowrap; }

.kits-cta { margin-top: 28px; text-align: center; }

/* Products page */
.kits-hero { background: var(--night); color: #fff; padding: clamp(48px, 7vw, 84px) 0 clamp(40px, 6vw, 64px); }
.kits-hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); max-width: 16ch; }
.kits-hero p { margin-top: 14px; max-width: 38rem; color: #dfe6f5; font-size: 1.12rem; }
.kits-hero-facts { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 10px 28px; color: #c9d3ea; }
.kits-hero-facts strong { color: var(--sun); font-family: var(--display); font-size: 1.2rem; margin-right: 4px; }
.kits-full { padding-top: clamp(40px, 6vw, 64px); }
.kits-full .kit-grid { align-items: start; }
.nav a[aria-current="page"] { background: rgba(255, 255, 255, .14); }

.kit-more { margin-top: 4px; border-top: 1px dashed var(--line); padding-top: 8px; }
.kit-more summary { cursor: pointer; font-weight: 700; font-size: .93rem; color: var(--night-2); list-style: none; }
.kit-more summary::-webkit-details-marker { display: none; }
.kit-more summary::before { content: "+"; display: inline-block; width: 1.1em; font-family: var(--display); color: var(--mars-deep); }
.kit-more[open] summary::before { content: "–"; }
.kit-more p { margin-top: 8px; color: var(--muted); font-size: .95rem; }
.kit-more .kit-meta { font-size: .82rem; color: #8590a8; }

.levels-guide { margin-top: clamp(40px, 6vw, 64px); }
.levels-guide h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 18px; }
.levels-guide ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.levels-guide li { background: var(--paper); border-radius: var(--radius); padding: 20px 22px; border-top: 6px solid var(--tone); }
.levels-guide li[data-tone="sun"] { --tone: var(--sun); }
.levels-guide li[data-tone="sky"] { --tone: var(--sky); }
.levels-guide li[data-tone="mars"] { --tone: var(--mars); }
.levels-guide h3 { font-size: 1.25rem; }
.levels-guide h3 span { font-family: var(--body); font-size: .9rem; font-weight: 700; color: var(--muted); margin-left: 6px; }
.levels-guide p { margin-top: 8px; color: var(--muted); }

/* Learning paths */
.paths { background: var(--paper); }
.path {
  display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(24px, 4vw, 56px); align-items: center;
  padding: clamp(24px, 4vw, 44px); border-radius: 28px; background: #fff; margin-top: 28px;
  border-top: 8px solid var(--tone);
}
.path[data-tone="sun"] { --tone: var(--sun); --tone-ink: #8a5d00; }
.path[data-tone="sky"] { --tone: var(--sky); --tone-ink: #0b6694; }
.path[data-tone="mars"] { --tone: var(--mars); --tone-ink: var(--mars-deep); }
.path:nth-of-type(even) .path-text { order: 2; }
.path-age { font-weight: 700; color: var(--tone-ink); }
.path h3 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin: 4px 0 14px; }
.path-text > p:not(.path-age) { color: var(--muted); }
.ticks { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 8px; }
.ticks li { padding-left: 32px; position: relative; font-weight: 700; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: .2em; width: 20px; height: 20px; border-radius: 50%;
  background: var(--tone) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
}
.player { border-radius: var(--radius); overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
.player video { width: 100%; height: 100%; object-fit: contain; }
.thumbs { display: flex; gap: 12px; margin-top: 12px; }
.thumb {
  display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; cursor: pointer;
  font: 700 .95rem var(--body); color: var(--ink); background: var(--paper);
  border: 2px solid transparent; border-radius: 14px;
}
.thumb img { width: 52px; height: 40px; object-fit: cover; border-radius: 9px; }
.thumb:hover { border-color: var(--line); }
.thumb.is-on { border-color: var(--tone); background: #fff; }

/* AIOT */
.aiot { background: var(--night); color: #fff; }
.aiot .section-head p { color: #b9c4de; }
.aiot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.aiot-card { margin: 0; background: var(--night-2); border-radius: 24px; overflow: hidden; }
.aiot-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: contain; background: #fff; padding: 18px; }
.aiot-card figcaption { padding: 22px 24px 26px; }
.aiot-card h3 { font-size: 1.45rem; margin-bottom: 8px; color: var(--sun); }
.aiot-card p { color: #d2daec; }

/* Team */
.team { background: #fff; }
.team-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; }
.team-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 50% 50% 22px 22px; background: var(--peg); }
.team-grid h3 { font-size: 1.3rem; margin-top: 16px; }
.team-grid .role { font-weight: 700; color: var(--mars-deep); margin: 2px 0 6px; }
.team-grid p:not(.role) { color: var(--muted); font-size: .97rem; }

/* Contact */
.contact { background: var(--paper); }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
.contact h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); }
.contact-grid > div > p { margin-top: 12px; color: var(--muted); font-size: 1.1rem; }
.contact-list { margin: 28px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 10px 20px; }
.contact-list dt { font-weight: 700; }
.contact-list dd { margin: 0; color: var(--muted); }
.contact-list a { color: var(--ink); }
.enquiry { background: #fff; border-radius: 24px; padding: clamp(22px, 3vw, 32px); display: grid; gap: 16px; box-shadow: 0 10px 30px -18px rgba(22, 32, 59, .35); }
.enquiry label { display: grid; gap: 6px; font-weight: 700; font-size: .96rem; }
.enquiry input, .enquiry textarea {
  font: 400 1rem var(--body); color: var(--ink); padding: 12px 14px;
  border: 2px solid var(--line); border-radius: 12px; background: #fff;
}
.enquiry input:focus, .enquiry textarea:focus { outline: none; border-color: var(--sky); }
.enquiry .btn { justify-self: start; }
.form-note { color: var(--muted); font-size: .95rem; min-height: 1.5em; }
.form-note a { color: var(--mars-deep); font-weight: 700; }
.form-privacy { color: #8590a8; font-size: .85rem; margin-top: -8px; }
.enquiry .btn:disabled { opacity: .6; cursor: wait; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Footer */
.footer { background: var(--night); color: #b9c4de; padding: 26px 0; font-size: .95rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; }
.footer a { color: #fff; }

/* Responsive */
@media (max-width: 960px) {
  .team-grid { grid-template-columns: repeat(2, 1fr); }
  .levels-guide ul { grid-template-columns: 1fr; }
  .path, .aiot-grid, .contact-grid { grid-template-columns: 1fr; }
  .path:nth-of-type(even) .path-text { order: 0; }
}
@media (max-width: 760px) {
  .nav-toggle {
    display: block; font: 700 .95rem var(--body); color: #fff; background: transparent;
    border: 2px solid rgba(255, 255, 255, .5); padding: 6px 14px; border-radius: 999px; cursor: pointer;
  }
  .nav {
    position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 2px;
    padding: 10px 20px 18px; background: var(--night); display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 12px 14px; }
  .nav .nav-cta { margin: 6px 0 0; text-align: center; }
  .hero-shade { background: rgba(14, 26, 58, .78); }
  .kit-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
  .thumbs { flex-wrap: wrap; }
  .enquiry-bar { gap: 10px; padding-left: 16px; font-size: .92rem; }
}
@media (max-width: 480px) {
  .team-grid { grid-template-columns: 1fr 1fr; gap: 18px; }
  .team-grid h3 { font-size: 1.1rem; }
  .footer-inner { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .kit:hover, .kit:nth-child(even):hover { transform: none; }
}

.player { background: #fff; border: 2px solid var(--peg); }
.player:has(video:not([hidden])) { background: #000; border-color: #000; }
.player-img { width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.player [hidden] { display: none; }
