/* See the Systems shared look — copied into each lab repo. Do not load this file from another origin.
   Tokens from seethesystems.com front page v3 (main 1e4335b). See GUIDE.md. */

:root {
  --sts-paper: #f3ead4;
  --sts-ink: #0d0c0b;
  --sts-yellow: #ffd000;
  --sts-cobalt: #1a2cff;
  --sts-rust: #ff5a00;
  --sts-violet: #5b1fff;
  --sts-magenta: #ff2d6a;
  --sts-teal: #00c2a8;
  --sts-display: "Bricolage Grotesque", sans-serif;
  --sts-body: "Instrument Sans", sans-serif;
  --sts-mono: "Space Mono", ui-monospace, monospace;
  --sts-lab: var(--sts-cobalt);
  --sts-on-lab: #fff;
  --sts-pad: max(1.1rem, env(safe-area-inset-left, 0px));
  --sts-padr: max(1.1rem, env(safe-area-inset-right, 0px));
  --sts-padt: max(1rem, env(safe-area-inset-top, 0px));
  --sts-padb: max(2.2rem, env(safe-area-inset-bottom, 0px));
}

html[data-lab="physics"]  { --sts-lab: var(--sts-cobalt);  --sts-on-lab: #fff; }
html[data-lab="light"]    { --sts-lab: var(--sts-yellow);  --sts-on-lab: var(--sts-ink); }
html[data-lab="machines"] { --sts-lab: var(--sts-rust);    --sts-on-lab: #fff; }
html[data-lab="atoms"]    { --sts-lab: var(--sts-violet);  --sts-on-lab: #fff; }
html[data-lab="soft"]     { --sts-lab: var(--sts-magenta); --sts-on-lab: #fff; }
html[data-lab="geometry"] { --sts-lab: var(--sts-teal);    --sts-on-lab: var(--sts-ink); }
html[data-lab="samples"]  { --sts-lab: var(--sts-ink);     --sts-on-lab: var(--sts-yellow); }

html[data-lab] { overflow-x: clip; max-width: 100%; }

/* Full-page hubs only (not the exhibit canvases). */
body.sts {
  margin: 0;
  background: var(--sts-paper);
  color: var(--sts-ink);
  font-family: var(--sts-body);
  font-size: 1.05rem;
  line-height: 1.4;
  min-height: 100dvh;
  max-width: 100%;
  overflow-x: clip;
}
body.sts *, body.sts *::before, body.sts *::after { box-sizing: border-box; }
html:has(body.sts) { overflow-x: clip; max-width: 100%; }
body.sts a { color: inherit; }
body.sts :focus-visible {
  outline: 3px solid var(--sts-ink);
  outline-offset: 3px;
}
html[data-lab="physics"] body.sts .sts-hero :focus-visible,
html[data-lab="machines"] body.sts .sts-hero :focus-visible,
html[data-lab="atoms"] body.sts .sts-hero :focus-visible,
html[data-lab="soft"] body.sts .sts-hero :focus-visible,
html[data-lab="samples"] body.sts .sts-hero :focus-visible,
html[data-lab="physics"] body.sts .sts-lessons a:focus-visible,
html[data-lab="machines"] body.sts .sts-lessons a:focus-visible,
html[data-lab="atoms"] body.sts .sts-lessons a:focus-visible,
html[data-lab="soft"] body.sts .sts-lessons a:focus-visible,
html[data-lab="samples"] body.sts .sts-lessons a:focus-visible {
  outline-color: #fff;
}

.sts-skip {
  position: absolute;
  left: var(--sts-pad);
  top: 0.4rem;
  z-index: 20;
  font-family: var(--sts-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--sts-ink);
  color: var(--sts-paper);
  padding: 0.4rem 0.65rem;
  text-decoration: none;
  transform: translateY(-200%);
}
.sts-skip:focus { transform: none; }

/* Works on both full hubs and interactive indexes. */
.sts-nav {
  pointer-events: auto;
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: var(--sts-padt) var(--sts-padr) 0.7rem var(--sts-pad);
  background: var(--sts-lab);
  color: var(--sts-on-lab);
  font-family: var(--sts-mono);
}
.sts-back {
  color: inherit;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 2px solid currentColor;
  padding-bottom: 0.12rem;
  white-space: nowrap;
}
.sts-back:hover, .sts-back:focus-visible { opacity: 0.85; }
.sts-nav-name {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.8;
}

.sts-hero {
  position: relative;
  overflow: hidden;
  background: var(--sts-lab);
  color: var(--sts-on-lab);
  padding: 0.6rem var(--sts-padr) 2.2rem var(--sts-pad);
}
.sts-motif {
  position: absolute;
  right: -0.6rem;
  top: 0.2rem;
  width: 7.6rem;
  height: 7.6rem;
  opacity: 0.9;
  pointer-events: none;
  z-index: 0;
}
.sts-title, .sts-lead { position: relative; z-index: 1; }
.sts-title {
  margin: 0;
  font-family: var(--sts-display);
  font-weight: 800;
  font-optical-sizing: auto;
  font-size: clamp(3.2rem, 16.5vw, 8.4rem);
  line-height: 0.8;
  letter-spacing: -0.07em;
  max-width: 18ch;
  padding-right: 5rem;
}
.sts-title span { display: block; }
.sts-lead {
  margin: 1.15rem 0 0;
  max-width: 34rem;
  font-size: clamp(1.05rem, 2.6vw, 1.3rem);
  line-height: 1.35;
  font-weight: 500;
}

.sts-lessons {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0 var(--sts-padb);
  display: grid;
  gap: 0.3rem;
  overflow-x: clip;
}
.sts-lessons > li { overflow: hidden; }
.sts-lessons a {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 0.85rem;
  row-gap: 0.25rem;
  text-decoration: none;
  padding: 1.15rem var(--sts-padr) 1.2rem var(--sts-pad);
  background: var(--sts-paper);
  color: var(--sts-ink);
  touch-action: manipulation;
}
.sts-lessons .num {
  grid-row: 1 / span 2;
  font-family: var(--sts-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--sts-lab);
  padding-top: 0.55rem;
}
html[data-lab="samples"] .sts-lessons .num { color: var(--sts-ink); }
.sts-lessons .name {
  margin: 0;
  font-family: var(--sts-display);
  font-weight: 800;
  font-size: clamp(1.55rem, 6.4vw, 2.7rem);
  line-height: 0.92;
  letter-spacing: -0.05em;
}
.sts-lessons .desc {
  margin: 0;
  grid-column: 2;
  max-width: 38rem;
  font-size: 1rem;
  line-height: 1.35;
  font-weight: 500;
}
.sts-lessons a:hover,
.sts-lessons a:focus-visible {
  background: var(--sts-lab);
  color: var(--sts-on-lab);
}
.sts-lessons a:hover .num,
.sts-lessons a:focus-visible .num { color: inherit; }

.sts-sec {
  margin: 0;
  padding: 1.4rem var(--sts-padr) 0.4rem var(--sts-pad);
  font-family: var(--sts-display);
  font-weight: 800;
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  letter-spacing: -0.04em;
  line-height: 1.1;
}
.sts-sec-lead {
  margin: 0;
  padding: 0.35rem var(--sts-padr) 0.4rem var(--sts-pad);
  max-width: 38rem;
  font-weight: 500;
}

.sts-foot {
  padding: 1.2rem var(--sts-padr) var(--sts-padb) var(--sts-pad);
  font-family: var(--sts-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sts-ink);
}

@media (min-width: 900px) {
  .sts-hero { padding: 1.2rem 3vw 3rem; min-height: min(42vh, 24rem); }
  .sts-motif { width: 12rem; height: 12rem; right: 3vw; top: 1.2rem; }
  .sts-title { font-size: clamp(5.5rem, 11vw, 9.5rem); padding-right: 10rem; }
  .sts-lessons { padding-left: 1.5vw; padding-right: 1.5vw; }
  .sts-lessons a { padding: 1.35rem 1.6rem 1.45rem; }
  .sts-sec, .sts-sec-lead, .sts-foot { padding-left: 3vw; padding-right: 3vw; }
}

@media (prefers-reduced-motion: no-preference) {
  .sts-lessons a,
  .sts-lessons .name,
  .sts-motif {
    transition: background-color 200ms ease, color 200ms ease, transform 200ms cubic-bezier(.2,.8,.2,1);
  }
  .sts-lessons a:hover .name,
  .sts-lessons a:focus-visible .name { transform: translateX(0.35rem); }
  .sts-hero:hover .sts-motif { transform: rotate(12deg) scale(1.06); }
}
@media (prefers-reduced-motion: reduce) {
  .sts-lessons a, .sts-lessons .name, .sts-motif { transition: none; transform: none !important; }
}


/* —— Lesson / exhibit chrome (lessons pass). Does not require body.sts, so
   canvases, tables, and specimens keep their own layout CSS. Load this file
   after each lab's theme.css. */

.sts-hub {
  color: inherit;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 2px solid currentColor;
  padding-bottom: 0.12rem;
  white-space: nowrap;
}
.sts-hub:hover, .sts-hub:focus-visible { opacity: 0.85; }
.sts-nav-credit {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.8;
  margin-left: auto;
}

/* Compact hero for interactive hubs so the exhibit still gets the page. */
.sts-hero-exhibit { min-height: 0; padding: 0.5rem var(--sts-padr) 1.5rem var(--sts-pad); }
.sts-hero-exhibit .sts-title {
  font-size: clamp(2.6rem, 13vw, 6.4rem);
  padding-right: 4.5rem;
}
.sts-hero-exhibit .sts-lead { margin-top: 0.85rem; max-width: 36rem; }
.sts-hero-exhibit .sts-motif { width: 6.2rem; height: 6.2rem; top: 0.1rem; }
@media (min-width: 900px) {
  .sts-hero-exhibit { padding: 0.7rem 3vw 1.8rem; min-height: 0; }
  .sts-hero-exhibit .sts-title { font-size: clamp(4rem, 8vw, 7rem); padding-right: 9rem; }
  .sts-hero-exhibit .sts-motif { width: 10rem; height: 10rem; right: 3vw; top: 0.6rem; }
}

/* Map existing lab type tokens onto the locked families (theme.css may set Anton,
   Unbounded, Fraunces, etc.). Specificity beats :root. */
html[data-lab] {
  --display: var(--sts-display);
  --body: var(--sts-body);
  --mono: var(--sts-mono);
  --sans: var(--sts-body);
  --font-display: var(--sts-display);
  --font-sans: var(--sts-body);
  --font-mono: var(--sts-mono);
  --font-body: var(--sts-body);
}

/* Hide lab chrome when a lesson is embedded. */
body.embed .sts-nav,
body.embed .sts-hero,
body.embed .sts-foot,
html.embed .sts-nav,
html.embed .sts-hero,
html.embed .sts-foot { display: none !important; }

/* Fixed credit for full-viewport canvas lessons — keeps the document from growing. */
.sts-foot-overlay {
  position: fixed;
  left: 0;
  bottom: 0;
  z-index: 18;
  margin: 0;
  padding: 0.45rem var(--sts-padr) max(0.55rem, env(safe-area-inset-bottom, 0px)) var(--sts-pad);
  background: transparent;
  color: var(--sts-ink);
  pointer-events: none;
  text-shadow: 0 0 4px var(--sts-paper), 0 0 10px var(--sts-paper);
}
html[data-lab="physics"] .sts-foot-overlay,
html[data-lab="machines"] .sts-foot-overlay,
html[data-lab="atoms"] .sts-foot-overlay,
html[data-lab="soft"] .sts-foot-overlay,
html[data-lab="samples"] .sts-foot-overlay {
  color: #fff;
  text-shadow: 0 0 6px rgba(0,0,0,.55);
}

html[data-lab="geometry"] body.demo > .top .brand { display: none; }

/* Keep hero titles from inheriting exhibit rules like `h1 span:last-child { color: accent }`. */
.sts-title span,
.sts-title span:last-child {
  color: inherit;
  padding-left: 0;
  margin-left: 0;
}
