/* RobotSpace.ai Robotics Academy (R2A) — stem.robotspace.ai
   Tokens follow the approved design system. The brand orange #F58220 measures
   2.59:1 on white, so it is a FILL colour only: primary buttons are deep navy
   text on orange (5.46:1), and --accent-text carries orange-family text on
   light grounds (5.00:1). Nothing declares a literal hex outside :root. */

:root {
  --navy-900: #041D39;
  --navy-700: #082B54;
  --orange: #F58220;
  --accent-text: #B15608;
  --surface: #FFFFFF;
  --ground: #F2F6F8;
  --ink: #132B45;
  --ink-2: #5D6D7D;
  --line: #D6DEE6;
  --line-strong: #B6C3CF;
  --ok: #1B6E3C;
  --err: #A3231C;

  --display: 'Archivo', system-ui, -apple-system, sans-serif;
  --body: 'Public Sans', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;

  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 48px; --s6: 64px; --s7: 88px;
  --max: 1120px;
  --measure: 68ch;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--s3); }

h1, h2, h3, h4 { font-family: var(--display); margin: 0; text-wrap: balance; letter-spacing: -.02em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 700; line-height: 1.06; }
h2 { font-size: clamp(1.5rem, 3vw, 2.15rem); font-weight: 700; line-height: 1.14; }
h3 { font-size: 1.12rem; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; max-width: var(--measure); }
a { color: var(--accent-text); }

.eyebrow {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-2); display: block;
}

:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
  border-radius: 3px;
  box-shadow: 0 0 0 6px rgba(4, 29, 57, .25);
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--navy-900); color: #fff; padding: 12px 20px; border-radius: 0 0 6px 0;
}
.skip:focus { left: 0; }

/* ---------- announcement ---------- */
.announce {
  background: var(--navy-900); color: #C9D6E2; font-size: .9rem;
  padding: 10px 0; border-bottom: 1px solid #16375A;
}
.announce .wrap { display: flex; gap: var(--s2); align-items: center; justify-content: center; flex-wrap: wrap; }
.announce a { color: var(--orange); font-weight: 600; text-decoration: none; }
.announce a:hover { text-decoration: underline; }
.announce button {
  background: none; border: 0; color: #7E93A8; cursor: pointer; font-size: 1.1rem;
  line-height: 1; padding: 4px 8px; margin-left: auto;
}

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.site-header .wrap { display: flex; align-items: center; gap: var(--s3); min-height: 64px; }
.brand { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand b { font-family: var(--display); font-weight: 700; font-size: 1.02rem; letter-spacing: -.02em; }
.brand span { font-family: var(--mono); font-size: .58rem; letter-spacing: .16em; color: var(--ink-2); text-transform: uppercase; }

.nav { display: flex; gap: var(--s3); margin-left: auto; align-items: center; }
.nav a {
  color: var(--ink); text-decoration: none; font-size: .93rem; font-weight: 500;
  padding: 6px 0; border-bottom: 2px solid transparent;
}
.nav a:hover { border-bottom-color: var(--orange); }
.nav a[aria-current="true"] { border-bottom-color: var(--orange); font-weight: 600; }

.menu-btn {
  display: none; margin-left: auto; background: none; border: 1px solid var(--line-strong);
  border-radius: 6px; padding: 8px 12px; font-family: var(--body); font-size: .9rem;
  font-weight: 600; color: var(--ink); cursor: pointer; min-height: 44px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block; font-family: var(--body); font-weight: 600; font-size: .96rem;
  padding: 13px 24px; border-radius: 6px; border: 2px solid transparent;
  text-decoration: none; cursor: pointer; min-height: 44px; text-align: center;
}
.btn-primary { background: var(--orange); color: var(--navy-700); border-color: var(--orange); }
.btn-primary:hover { background: #E0741A; border-color: #E0741A; }
.btn-secondary { background: transparent; color: var(--navy-700); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--navy-700); }
.on-dark .btn-secondary { color: #fff; border-color: #2C536F; }
.on-dark .btn-secondary:hover { border-color: #fff; }
.btn-sm { padding: 9px 16px; font-size: .88rem; }

/* ---------- sections ---------- */
main > section { padding: var(--s7) 0; border-bottom: 1px solid var(--line); }
main > section > .wrap { display: flex; flex-direction: column; gap: var(--s3); }
.sec-head { display: flex; flex-direction: column; gap: var(--s1); }
.lede { font-size: 1.12rem; color: var(--ink); max-width: 62ch; }

.dark { background: var(--navy-900); color: #E6EDF3; border-bottom: 0; }
.dark h2, .dark h3 { color: #fff; }
.dark p { color: #C9D6E2; }
.dark .eyebrow { color: #7E93A8; }
.dark .card { background: #0A2540; border-color: #16375A; }
.dark .card p { color: #A9BCCD; }
.dark .card .k { color: var(--orange); }

/* ---------- hero ---------- */
.hero { background: var(--navy-900); color: #fff; padding: var(--s7) 0 var(--s6); border-bottom: 4px solid var(--orange); }
.hero .wrap { display: flex; flex-direction: column; gap: var(--s3); }
.hero h1 { color: #fff; max-width: 17ch; }
.hero .lede { color: #C9D6E2; max-width: 56ch; font-size: 1.16rem; }
.hero .cta-row { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s1); }
.proof { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid #16375A; }
.proof div { display: flex; flex-direction: column; gap: 2px; }
.proof b { font-family: var(--display); font-size: 1.28rem; color: #fff; font-weight: 700; }
.proof span { font-size: .86rem; color: #9FB2C2; }

/* ---------- cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--s2); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--s3); display: flex; flex-direction: column; gap: var(--s1);
}
.card:hover { border-color: var(--line-strong); }
.card .k { font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-text); }
.card p { font-size: .94rem; color: var(--ink-2); }

/* ---------- stage selector ---------- */
.stages { display: flex; flex-direction: column; gap: var(--s3); }
.stage-tabs { display: flex; gap: var(--s1); flex-wrap: wrap; border-bottom: 2px solid var(--line); }
.stage-tabs button {
  font-family: var(--display); font-weight: 600; font-size: .96rem; background: none;
  border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px;
  padding: 12px 18px; cursor: pointer; color: var(--ink-2); min-height: 44px;
}
.stage-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--orange); }
.stage-tabs button:hover { color: var(--ink); }
.stage-panel { display: grid; grid-template-columns: 1.1fr 1fr; gap: var(--s4); align-items: start; }
.stage-panel[hidden] { display: none; }
.stage-main { display: flex; flex-direction: column; gap: var(--s2); }
.stage-meta { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); }
.pill {
  font-family: var(--mono); font-size: .74rem; padding: 5px 11px; border-radius: 999px;
  background: var(--ground); border: 1px solid var(--line); color: var(--ink-2);
}
.pill.kit { background: rgba(245, 130, 32, .14); border-color: rgba(245, 130, 32, .45); color: var(--accent-text); font-weight: 500; }
.stage-side { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3); display: flex; flex-direction: column; gap: var(--s2); }
.stage-side h3 { font-size: .98rem; }

/* ---------- lists ---------- */
ul.ticks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; max-width: var(--measure); }
ul.ticks li { position: relative; padding-left: 22px; font-size: .96rem; }
ul.ticks li::before { content: ""; position: absolute; left: 0; top: .6em; width: 9px; height: 2px; background: var(--orange); }

/* ---------- flow ---------- */
.flow { list-style: none; counter-reset: f; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--s2); }
.flow li { counter-increment: f; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3); }
.flow li::before { content: counter(f, decimal-leading-zero); font-family: var(--mono); font-size: .72rem; color: var(--accent-text); display: block; margin-bottom: 6px; }
.flow b { display: block; font-family: var(--display); font-size: 1.02rem; margin-bottom: 4px; }
.flow p { font-size: .9rem; color: var(--ink-2); }

/* ---------- table ---------- */
.scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .93rem; min-width: 560px; }
th, td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); font-weight: 500; }
tbody tr:last-child td { border-bottom: 0; }

/* ---------- faq ---------- */
.faq { display: flex; flex-direction: column; gap: 0; border-top: 1px solid var(--line); max-width: 80ch; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  font-family: var(--display); font-weight: 600; font-size: 1.02rem; padding: 18px 40px 18px 0;
  cursor: pointer; position: relative; list-style: none; min-height: 44px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 8px; top: 15px; font-family: var(--mono);
  font-size: 1.4rem; color: var(--accent-text); font-weight: 400;
}
.faq details[open] summary::after { content: "−"; }
.faq .a { padding: 0 40px 20px 0; color: var(--ink-2); font-size: .97rem; max-width: var(--measure); }

/* ---------- contact ---------- */
.contact-box {
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--orange);
  border-radius: 0 var(--radius) var(--radius) 0; padding: var(--s4);
  display: flex; flex-direction: column; gap: var(--s2);
}
.contact-lines { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); }
.contact-lines div { display: flex; flex-direction: column; gap: 2px; }
.contact-lines .lbl { font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.contact-lines a { font-size: 1.06rem; font-weight: 600; text-decoration: none; }
.contact-lines a:hover { text-decoration: underline; }

/* ---------- footer ---------- */
footer { background: var(--navy-900); color: #9FB2C2; padding: var(--s6) 0 var(--s4); font-size: .92rem; }
footer .wrap { display: flex; flex-direction: column; gap: var(--s4); }
.f-cols { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: var(--s4); }
.f-cols h4 { font-size: .8rem; font-family: var(--mono); letter-spacing: .1em; text-transform: uppercase; color: #7E93A8; font-weight: 500; margin-bottom: var(--s2); }
.f-cols ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.f-cols a { color: #C9D6E2; text-decoration: none; font-size: .92rem; }
.f-cols a:hover { color: #fff; text-decoration: underline; }
.f-brand b { font-family: var(--display); color: #fff; font-size: 1.1rem; display: block; }
.f-brand .tag { font-family: var(--mono); font-size: .66rem; letter-spacing: .16em; color: var(--orange); text-transform: uppercase; margin: 4px 0 12px; }
.f-brand p { font-size: .9rem; color: #9FB2C2; max-width: 40ch; }
.f-legal { border-top: 1px solid #16375A; padding-top: var(--s3); display: flex; flex-wrap: wrap; gap: 8px var(--s2); font-size: .82rem; }
.f-legal a { color: #9FB2C2; text-decoration: none; }
.f-legal a:hover { color: #fff; text-decoration: underline; }
.f-base { display: flex; flex-wrap: wrap; gap: 8px var(--s3); justify-content: space-between; font-size: .8rem; color: #7E93A8; }

/* ---------- responsive ---------- */
@media (max-width: 1023px) {
  .stage-panel { grid-template-columns: 1fr; gap: var(--s3); }
  .f-cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 767px) {
  body { font-size: 16px; }
  main > section { padding: var(--s6) 0; }
  .menu-btn { display: block; }
  .nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: stretch; gap: 0; padding: var(--s2) var(--s3) var(--s3);
  }
  .nav.open { display: flex; }
  .nav a { padding: 14px 0; border-bottom: 1px solid var(--line); min-height: 44px; }
  .nav a:last-child { border-bottom: 0; }
  .header-cta { display: none; }
  .stage-tabs { overflow-x: auto; flex-wrap: nowrap; }
  .stage-tabs button { white-space: nowrap; }
  .f-cols { grid-template-columns: 1fr; gap: var(--s3); }
  .hero .cta-row .btn { width: 100%; }
}
