/* ------------------------------------------------------------------
   M'Aiken Magic. Tokens live in tokens.css; fonts in fonts.css.
   ------------------------------------------------------------------ */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--fog);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  --focus: var(--black);
}

img, svg { max-width: 100%; }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.012em;
  line-height: 0.98;
  color: var(--black);
  text-wrap: balance;
}
h1 { font-size: var(--display-l); }
h2 { font-size: var(--display-m); }
h3 { font-size: var(--display-s); }

p { margin: 0 0 1.1em; max-width: var(--measure); }
p:last-child { margin-bottom: 0; }

a { color: var(--moss); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--black); }

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

.wrap { width: min(100% - 2 * var(--gutter), var(--page)); margin-inline: auto; }
.soft { color: var(--text-soft); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 100;
  background: var(--leaf);
  color: var(--black);
  padding: 0.6rem 1rem;
  font-weight: 700;
}
.skip:focus { top: 0.75rem; }

/* ---------- Bands (page sections) ---------- */
.band { padding-block: var(--band); }
.band--fog2 { background: var(--fog-2); }
.band--moss,
.band--black { color: var(--on-dark); --focus: var(--fog); }
.band--moss { background: var(--moss); }
.band--black { background: var(--black); }
.band--moss h1, .band--moss h2, .band--moss h3,
.band--black h1, .band--black h2, .band--black h3 { color: var(--on-dark); }
.band--moss a, .band--black a { color: var(--on-dark); }
.band--moss a:hover, .band--black a:hover { color: var(--leaf); }
.band--moss .soft, .band--black .soft { color: var(--on-dark-soft); }

/* Gear teeth hanging off the bottom of a moss or black band. */
.teeth {
  height: 14px;
  background-image: linear-gradient(90deg, var(--tooth) 0 50%, var(--gap) 50% 100%);
  background-size: var(--teeth) 100%;
  background-repeat: repeat-x;
}
.teeth--moss { --tooth: var(--moss); --gap: var(--fog); }
.teeth--moss-on-fog2 { --tooth: var(--moss); --gap: var(--fog-2); }
.teeth--black { --tooth: var(--black); --gap: var(--fog); }
.teeth--black-on-moss { --tooth: var(--black); --gap: var(--moss); }

/* ---------- Header ---------- */
.site-header {
  background: var(--black);
  color: var(--on-dark);
  --focus: var(--fog);
  position: relative;
  z-index: 20;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4.75rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--on-dark);
  text-decoration: none;
}
.brand:hover { color: var(--on-dark); }
.brand__logo { display: grid; place-items: center; flex: none; width: 3.25rem; height: 3.25rem; padding: 0.25rem; background: var(--fog); border-radius: var(--leaf-radius); }
.brand__logo img { display: block; width: 100%; height: auto; }
.about-logo { display: block; width: min(220px, 60%); height: auto; margin-top: 2.25rem; }
.brand__name { font-family: var(--font-display); font-size: 2rem; letter-spacing: 0.02em; line-height: 1; }
.brand__team { font-size: var(--step--1); color: var(--on-dark-soft); line-height: 1; padding-left: 0.75rem; border-left: 1px solid rgb(238 241 234 / 0.3); }

.nav { display: flex; align-items: center; gap: clamp(1rem, 2vw, 1.75rem); }
.nav__list { display: flex; gap: clamp(0.9rem, 2vw, 1.6rem); list-style: none; margin: 0; padding: 0; }
.nav__list a {
  color: var(--on-dark);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.0625rem;
  padding-block: 0.4rem;
  border-bottom: 3px solid transparent;
}
.nav__list a:hover { color: var(--on-dark); border-bottom-color: var(--on-dark-soft); }
.nav__list a[aria-current="page"] { border-bottom-color: var(--leaf); }

.nav-toggle {
  display: none;
  background: none;
  border: 2px solid var(--on-dark);
  color: var(--on-dark);
  font: inherit;
  font-weight: 600;
  padding: 0.4rem 0.9rem;
  border-radius: var(--leaf-radius);
  cursor: pointer;
}

@media (max-width: 62rem) {
  .brand__team { display: none; }
  .js .nav-toggle { display: inline-block; }
  .js .nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--black);
    padding: 1rem var(--gutter) 1.75rem;
    flex-direction: column;
    align-items: stretch;
    border-top: 1px solid rgb(238 241 234 / 0.2);
  }
  .js .nav.is-open { display: flex; }
  .nav__list { flex-direction: column; gap: 0.25rem; }
  .nav .btn { text-align: center; padding: 0.85rem 1.4rem; font-size: 1.0625rem; margin-top: 0.75rem; }
  .nav__list a { display: block; padding-block: 0.7rem; font-size: 1.25rem; }
  .no-js .nav, .nav { flex-wrap: wrap; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  padding: 0.8rem 1.6rem;
  border: 2px solid transparent;
  border-radius: var(--leaf-radius);
  cursor: pointer;
  line-height: 1.2;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.btn--leaf { background: var(--leaf); color: var(--black); }
.btn--leaf:hover { background: var(--on-dark); color: var(--black); }
.btn--moss { background: var(--moss); color: var(--on-dark); }
.btn--moss:hover { background: var(--black); color: var(--on-dark); }
.btn--line { border-color: currentColor; color: inherit; background: transparent; }
.band--moss .btn--line, .band--black .btn--line { color: var(--on-dark); }
.band--moss .btn--line:hover, .band--black .btn--line:hover { background: var(--on-dark); color: var(--black); border-color: var(--on-dark); }
.btn--line:hover { background: var(--black); color: var(--on-dark); border-color: var(--black); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2rem; }
.site-header .btn { padding: 0.55rem 1.15rem; font-size: 1rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--moss);
  color: var(--on-dark);
  --focus: var(--fog);
  padding-block: clamp(3.5rem, 7vw, 6.5rem) clamp(4.5rem, 9vw, 8rem);
  isolation: isolate;
}
.hero h1 {
  font-size: var(--display-xl);
  line-height: 0.9;
  color: var(--on-dark);
  max-width: 12ch;
  margin-bottom: 1.5rem;
}
.hero .lead { font-size: var(--step-1); line-height: 1.5; max-width: 34em; color: var(--on-dark); }
.hero__copy { position: relative; z-index: 1; max-width: 44rem; }
.hero__art {
  position: absolute;
  z-index: 0;
  right: -14vw;
  top: 50%;
  width: min(92vw, 860px);
  translate: 0 -50%;
  color: var(--leaf);
  opacity: 0.32;
}
@media (min-width: 62rem) {
  .hero__art { right: -11vw; opacity: 0.95; width: min(54vw, 820px); }
}

/* The sigil. One orchestrated moment: it draws itself, then idles. */
.sigil { display: block; width: 100%; height: auto; overflow: visible; }
.sigil .draw { stroke-dasharray: 1; animation: draw 2.2s cubic-bezier(0.3, 0.7, 0.2, 1) both; }
.sigil .d1 { animation-delay: 0.1s; }
.sigil .d2 { animation-delay: 0.5s; }
.sigil .d3 { animation-delay: 0.8s; }
.sigil .d4 { animation-delay: 1.1s; }
.sigil .d5 { animation-delay: 1.4s; }
.sigil .d6 { animation-delay: 1.7s; }
.sigil__runes { animation: fade 1.4s 1.2s both; }
.sigil__gear, .sigil__core, .sigil__spark { transform-box: view-box; transform-origin: 300px 300px; }
.sigil__gear { animation: spin 240s linear infinite; }
.sigil__core { animation: spin 160s linear infinite reverse; }
.sigil__spark { animation: fade 0.8s 2.4s both, spin 18s linear 2.4s infinite; }
.sigil .halo { fill: var(--ember); opacity: 0.3; }
.sigil .dot { fill: var(--ember); }

@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .sigil, .sigil * { animation: none !important; }
}

/* ---------- Inner page heads ---------- */
.pagehead { background: var(--moss); color: var(--on-dark); padding-block: clamp(3.5rem, 7vw, 6rem) clamp(3.75rem, 7.5vw, 6.5rem); --focus: var(--fog); }
.pagehead h1 { color: var(--on-dark); font-size: var(--display-l); margin-bottom: 1.25rem; }
.pagehead p { font-size: var(--step-1); line-height: 1.5; max-width: 40em; color: var(--on-dark); }

/* ---------- Two-column section layout ---------- */
.split { display: grid; gap: clamp(2rem, 5vw, 4.5rem); }
@media (min-width: 62rem) {
  .split { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }
  .split__head { position: sticky; top: 2rem; align-self: start; }
}
.split__head h2 { margin-bottom: 1rem; }
.split__head p { color: var(--text-soft); }
.band--moss .split__head p, .band--black .split__head p { color: var(--on-dark-soft); }

/* Rows separated by rules. Used for programs, FAQs, people. */
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { padding-block: 1.75rem; border-top: 1px solid rgb(0 0 0 / 0.25); }
.rows > li:last-child { border-bottom: 1px solid rgb(0 0 0 / 0.25); }
.rows h3 { margin-bottom: 0.5rem; }
.rows .meta { color: var(--text-soft); font-size: var(--step--1); margin-bottom: 0.75rem; }
.band--moss .rows > li, .band--black .rows > li { border-color: rgb(238 241 234 / 0.3); }
.band--moss .rows .meta, .band--black .rows .meta { color: var(--on-dark-soft); }

/* ---------- Parts list (subteams) ---------- */
.parts { width: 100%; border-collapse: collapse; }
.parts caption { text-align: left; padding-bottom: 1rem; }
.parts thead th {
  text-align: left;
  font-weight: 700;
  font-size: var(--step--1);
  color: var(--text-soft);
  padding: 0 1.5rem 0.75rem 0;
  border-bottom: 3px solid var(--black);
}
.parts td, .parts tbody th { padding: 1.4rem 1.5rem 1.4rem 0; border-bottom: 1px solid rgb(0 0 0 / 0.25); vertical-align: baseline; text-align: left; }
.parts tbody th { font-family: var(--font-display); font-weight: 400; font-size: var(--display-s); letter-spacing: 0.012em; line-height: 1; color: var(--black); width: 15rem; white-space: nowrap; }
.parts .also { display: block; font-family: var(--font-body); font-size: var(--step--1); letter-spacing: 0; color: var(--text-soft); margin-top: 0.35rem; }
@media (max-width: 48rem) {
  .parts thead { position: absolute; left: -9999px; }
  .parts, .parts tbody, .parts tr, .parts td, .parts tbody th { display: block; width: 100%; }
  .parts tr { padding-block: 1.25rem; border-bottom: 1px solid rgb(0 0 0 / 0.25); }
  .parts td, .parts tbody th { padding: 0; border: 0; white-space: normal; }
  .parts tbody th { margin-bottom: 0.4rem; }
}

/* ---------- Agenda (events) ---------- */
.agenda { list-style: none; margin: 0; padding: 0; }
.agenda li { display: grid; gap: 0.35rem 2rem; padding-block: 1.5rem; border-top: 1px solid rgb(238 241 234 / 0.3); }
.agenda li:last-child { border-bottom: 1px solid rgb(238 241 234 / 0.3); }
@media (min-width: 48rem) { .agenda li { grid-template-columns: 15rem 1fr; align-items: baseline; } }
.agenda time { font-family: var(--font-display); font-size: var(--display-s); letter-spacing: 0.012em; line-height: 1; color: var(--on-dark); }
.agenda h3 { font-size: var(--display-s); margin-bottom: 0.25rem; }
.agenda .detail { color: var(--on-dark-soft); font-size: var(--step--1); margin: 0; }
.agenda--light li { border-color: rgb(0 0 0 / 0.25); }
.agenda--light time, .agenda--light h3 { color: var(--black); }
.agenda--light .detail { color: var(--text-soft); }
.agenda--past { opacity: 0.78; }
.subhead { font-size: var(--display-s); margin: 3rem 0 1rem; }
.subhead:first-child { margin-top: 0; }

.empty {
  border: 2px solid currentColor;
  border-radius: var(--leaf-radius);
  padding: 1.75rem 2rem;
  max-width: 44rem;
}
.empty h3 { margin-bottom: 0.6rem; }
.empty p { margin-bottom: 1rem; }

/* ---------- Tier ladder ---------- */
.ladder { list-style: none; margin: 0; padding: 0; }
.ladder li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 2rem;
  padding-block: 0.7rem;
  border-top: 1px solid rgb(238 241 234 / 0.3);
}
.ladder li:last-child { border-bottom: 1px solid rgb(238 241 234 / 0.3); }
.ladder .tier { font-family: var(--font-display); letter-spacing: 0.012em; line-height: 1; font-size: calc(1.5rem + var(--rank) * 0.26rem); color: var(--on-dark); }
.ladder .range { color: var(--on-dark-soft); font-size: var(--step--1); }
.ladder--light li { border-color: rgb(0 0 0 / 0.25); }
.ladder--light .tier { color: var(--black); }
.ladder--light .range { color: var(--text-soft); }
.ladder .recognition { flex-basis: 100%; max-width: none; margin: 0; font-size: var(--step--1); color: var(--on-dark-soft); }
.ladder--light .recognition { color: var(--text-soft); }

/* Sponsor wall */
.wall h3 { margin: 2.5rem 0 1rem; }
.wall h3:first-child { margin-top: 0; }
.wall ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 1.5rem 2.5rem; align-items: center; }
.wall img { display: block; height: auto; max-height: 5rem; width: auto; max-width: 14rem; }
.wall .name { font-family: var(--font-display); font-size: var(--display-s); line-height: 1; color: var(--black); }

/* ---------- Leadership and photos ---------- */
.people { list-style: none; margin: 0; padding: 0; display: grid; gap: 2.5rem 3rem; }
@media (min-width: 48rem) { .people { grid-template-columns: 1fr 1fr; } }
.people li { display: grid; grid-template-columns: 5rem 1fr; gap: 1.25rem; align-items: start; }
.initials {
  display: grid;
  place-items: center;
  width: 5rem;
  height: 5rem;
  background: var(--moss);
  color: var(--on-dark);
  font-family: var(--font-display);
  font-size: 2.1rem;
  letter-spacing: 0.04em;
  border-radius: var(--leaf-radius);
}
.people h3 { margin-bottom: 0.2rem; }
.people .role { font-weight: 600; margin-bottom: 0.4rem; }

.photos { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); margin-top: 2.5rem; }
.photos figure { margin: 0; }
.photos img { display: block; width: 100%; height: auto; border-radius: var(--leaf-radius); }
.photos figcaption { font-size: var(--step--1); color: var(--text-soft); margin-top: 0.4rem; }

/* ---------- Prose, FAQ, contact ---------- */
.prose { max-width: var(--measure); }
.prose h2 { margin: 2.5rem 0 0.9rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: 2rem 0 0.6rem; }
.prose ul { padding-left: 1.2rem; margin: 0 0 1.1em; }
.prose li { margin-bottom: 0.4rem; }

.faq { max-width: 52rem; }
.faq details { border-top: 1px solid rgb(0 0 0 / 0.25); }
.faq details:last-child { border-bottom: 1px solid rgb(0 0 0 / 0.25); }
.faq summary {
  list-style: none;
  cursor: pointer;
  padding-block: 1.25rem;
  padding-right: 3rem;
  position: relative;
  font-family: var(--font-display);
  font-size: var(--display-s);
  letter-spacing: 0.012em;
  line-height: 1.05;
  color: var(--black);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  position: absolute;
  right: 0.5rem;
  top: 50%;
  width: 0.7rem;
  height: 0.7rem;
  border-right: 3px solid var(--moss);
  border-bottom: 3px solid var(--moss);
  translate: 0 -75%;
  rotate: 45deg;
}
.faq details[open] summary::after { rotate: 225deg; translate: 0 -25%; }
.faq .answer { padding-bottom: 1.5rem; }

.contact { display: grid; gap: 2.5rem 4rem; }
@media (min-width: 48rem) { .contact { grid-template-columns: 1fr 1fr; } }
.contact h2 { font-size: var(--display-s); margin-bottom: 0.6rem; }
.contact address { font-style: normal; }

/* ---------- Call-to-action band ---------- */
.cta { text-align: left; }
.cta h2 { font-size: var(--display-l); max-width: 14ch; margin-bottom: 1.25rem; }
.cta p { font-size: var(--step-1); line-height: 1.5; }

/* ---------- Footer ---------- */
.site-footer { background: var(--black); color: var(--on-dark); padding-block: 4rem 3rem; --focus: var(--fog); }
.site-footer a { color: var(--on-dark); }
.site-footer a:hover { color: var(--leaf); }
.site-footer .grid { display: grid; gap: 2.5rem 3rem; }
@media (min-width: 48rem) { .site-footer .grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer .brand { margin-bottom: 1rem; }
.site-footer h2 { font-size: 1.5rem; color: var(--on-dark); margin-bottom: 0.75rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.35rem; }
.site-footer address { font-style: normal; color: var(--on-dark-soft); }
.site-footer .fine { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid rgb(238 241 234 / 0.25); font-size: var(--step--1); color: var(--on-dark-soft); max-width: none; }

/* ---------- Preview badge (added by scripts/mark-preview.mjs) ---------- */
.preview-badge { position: fixed; right: 1rem; bottom: 1rem; z-index: 999; background: var(--ember); color: var(--black); font: 700 0.875rem/1 var(--font-body); padding: 0.55rem 0.8rem; border-radius: var(--leaf-radius); }

@media print {
  .site-header, .site-footer, .hero__art, .teeth, .btn-row { display: none; }
  body, .hero, .pagehead, .band--moss, .band--black { background: #fff; color: #000; }
  h1, h2, h3 { color: #000 !important; }
}

/* Robots page */
.robot { display: grid; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.robot__media img { display: block; width: 100%; height: auto; border-radius: var(--leaf-radius); }
.robot__tile { display: grid; place-items: center; aspect-ratio: 4 / 3; background: var(--moss); color: var(--on-dark); border-radius: var(--leaf-radius); }
.robot__tile span { font-family: var(--font-display); font-size: var(--display-l); line-height: 1; letter-spacing: 0.02em; }
.robot__season { font-weight: 700; color: var(--text-soft); margin-bottom: 0.4rem; }
.robot__body h2 { margin-bottom: 1rem; }
.robot__summary { max-width: var(--measure); }
.specs { display: grid; gap: 0; margin: 1.5rem 0 0; max-width: 34rem; }
.specs > div { display: grid; grid-template-columns: minmax(7rem, 11rem) 1fr; gap: 1rem; padding: 0.6rem 0; border-top: 1px solid rgb(37 65 24 / 0.25); }
.specs > div:last-child { border-bottom: 1px solid rgb(37 65 24 / 0.25); }
.specs dt { font-weight: 700; }
.specs dd { margin: 0; }
.robot__results { margin-top: 1.25rem; max-width: var(--measure); }
@media (min-width: 52rem) {
  .robot { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
}
@media (max-width: 30rem) {
  .specs > div { grid-template-columns: 1fr; gap: 0.1rem; }
}
