/*
  The showcase's layout. Colors come from theme.css, the company's theme in
  the Nyxsis format (--theme-*), and from the --ground-* values index.html
  sets: the company's fixed dark and light grounds, which on-dark and on-light
  artwork is always shown on, whichever scheme the page is in.
*/

@font-face {
  font-family: "Archivo";
  src: url("fonts/Archivo.woff2") format("woff2");
  font-weight: 400 800;
  font-stretch: 100% 125%;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/JetBrainsMono.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --line: color-mix(in srgb, var(--theme-text) 14%, transparent);
  --line-strong: color-mix(in srgb, var(--theme-text) 28%, transparent);
  --radius: 14px;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1200px;
}

:root[data-nyxsis-scheme="light"] {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
}

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

body {
  margin: 0;
  background: var(--theme-background);
  color: var(--theme-text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

img {
  max-width: 100%;
}

a {
  color: var(--theme-primary);
  text-underline-offset: 3px;
}

code,
.mono {
  font-family: var(--mono);
  font-size: 0.86em;
}

:focus-visible {
  outline: 2px solid var(--theme-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

/* ---------- bar ---------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--theme-background) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
}

.bar-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 60px;
}

.bar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--theme-text);
  text-decoration: none;
  font-weight: 700;
  font-stretch: 112%;
  white-space: nowrap;
}

.bar-brand img {
  width: 28px;
  height: 28px;
}

.bar-nav {
  display: flex;
  gap: 4px;
  margin-left: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.bar-nav a {
  color: var(--theme-text-muted);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
}

.bar-nav a:hover {
  color: var(--theme-text);
  background: var(--theme-background-alt);
}

.bar-end {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bar-link {
  color: var(--theme-text-muted);
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}

.bar-link:hover {
  color: var(--theme-text);
}

.scheme-toggle {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--theme-text);
  cursor: pointer;
}

.scheme-toggle:hover {
  background: var(--theme-background-alt);
}

.scheme-toggle svg {
  width: 18px;
  height: 18px;
}

.scheme-toggle .to-dark,
:root[data-nyxsis-scheme="light"] .scheme-toggle .to-light {
  display: none;
}

:root[data-nyxsis-scheme="light"] .scheme-toggle .to-dark {
  display: block;
}

@media (max-width: 760px) {
  .bar-nav {
    display: none;
  }
}

/* ---------- hero ---------- */

.hero {
  padding-block: clamp(48px, 9vw, 112px) clamp(36px, 6vw, 72px);
  border-bottom: 1px solid var(--line);
  position: relative;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--theme-primary);
  margin: 0 0 18px;
}

.hero h1 {
  font-size: clamp(40px, 7.5vw, 88px);
  line-height: 0.98;
  font-weight: 800;
  font-stretch: 125%;
  letter-spacing: -0.02em;
  margin: 0;
  overflow-wrap: anywhere;
}

.lede {
  font-size: clamp(17px, 2vw, 20px);
  color: var(--theme-text-muted);
  max-width: 46em;
  margin: 20px 0 0;
}

.hero-logo {
  margin-top: clamp(32px, 5vw, 56px);
  padding: clamp(28px, 5vw, 56px);
  background: var(--theme-background-alt);
  border-radius: calc(var(--radius) + 6px);
  display: grid;
  place-items: center;
}

.hero-logo img {
  width: min(560px, 100%);
  max-height: 220px;
  object-fit: contain;
}

.hero-rule {
  height: 4px;
  width: 96px;
  background: var(--theme-brand);
  border-radius: 2px;
  margin: 28px 0 0;
}

/* Artwork drawn twice, once per scheme, shows the copy for the scheme in use. */
.for-light,
:root[data-nyxsis-scheme="light"] .for-dark {
  display: none;
}

:root[data-nyxsis-scheme="light"] .for-light {
  display: block;
}

/* ---------- sections ---------- */

.section {
  padding-block: clamp(48px, 7vw, 88px);
  border-bottom: 1px solid var(--line);
}

.section:last-of-type {
  border-bottom: 0;
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 12px 40px;
  align-items: end;
  margin-bottom: 32px;
}

.section-head h2 {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  font-stretch: 118%;
  line-height: 1;
  letter-spacing: -0.01em;
  margin: 0;
}

.section-head p {
  margin: 0;
  color: var(--theme-text-muted);
  max-width: 40em;
}

@media (max-width: 760px) {
  .section-head {
    grid-template-columns: 1fr;
  }
}

.group + .group {
  margin-top: 56px;
}

.group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 16px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.group-head h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  font-stretch: 112%;
}

.group-head p {
  margin: 0;
  color: var(--theme-text-muted);
  font-size: 15px;
}

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

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.tile {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--theme-background);
}

.tile-stage {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  padding: 28px;
  background: var(--theme-background-alt);
}

.tile.wide {
  grid-column: span 2;
}

.tile.wide .tile-stage {
  aspect-ratio: auto;
  min-height: 220px;
}

@media (max-width: 560px) {
  .tile.wide {
    grid-column: auto;
  }
}

.tile[data-ground="dark"] .tile-stage {
  background: var(--ground-dark);
}

.tile[data-ground="light"] .tile-stage {
  background: var(--ground-light);
}

.tile-stage img {
  max-width: 100%;
  max-height: 140px;
  object-fit: contain;
}

.tile-stage img.icon {
  width: 112px;
  height: 112px;
}

.tile-stage img.spinner {
  width: auto;
  height: 96px;
  max-width: 100%;
}

.tile figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  min-height: 52px;
}

.tile-name {
  font-size: 14px;
  font-weight: 600;
}

.tile-note {
  flex: 1 1 100%;
  font-size: 13px;
  line-height: 1.45;
  color: var(--theme-text-muted);
}

.tile-links {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.dl {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--theme-text);
  text-decoration: none;
  padding: 5px 8px;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
}

.dl:hover {
  background: var(--theme-brand);
  border-color: var(--theme-brand);
  color: var(--theme-on-brand);
}

/* ---------- products ---------- */

.products {
  display: grid;
  gap: 20px;
}

.product {
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  padding: clamp(18px, 3vw, 28px);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 2fr);
  gap: 20px 32px;
}

@media (max-width: 860px) {
  .product {
    grid-template-columns: 1fr;
  }
}

.product-id {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
}

.product-id > img {
  width: 88px;
  height: 88px;
}

.product h4 {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  font-stretch: 115%;
  line-height: 1.05;
}

.product p {
  margin: 0;
  color: var(--theme-text-muted);
  font-size: 15px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--theme-text-muted);
}

.product-link {
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.product-link:hover {
  text-decoration: underline;
}

.product .tiles {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  align-content: start;
}

/* ---------- colors ---------- */

.schemes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.scheme {
  border-radius: calc(var(--radius) + 4px);
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--line);
}

.scheme h3 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  font-stretch: 112%;
}

.scheme > p {
  margin: 0 0 18px;
  font-size: 14px;
  opacity: 0.75;
}

.swatches {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.swatch {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.swatch-chip {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 22%, transparent);
}

.swatch-role {
  font-family: var(--mono);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

.copy {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  color: inherit;
  background: transparent;
  border: 1px solid color-mix(in srgb, currentColor 26%, transparent);
  border-radius: 8px;
  padding: 6px 9px;
  cursor: pointer;
}

.copy:hover {
  background: color-mix(in srgb, currentColor 10%, transparent);
}

.css-block {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.css-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--theme-background-alt);
}

.css-block-head span {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--theme-text-muted);
}

.css-block-head div {
  display: flex;
  gap: 6px;
}

.css-block pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
}

/* ---------- hub ---------- */

.band {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  width: min(320px, 60%);
  margin-top: 28px;
}

.band span {
  flex: 1;
}

.companies {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.company {
  --accent: var(--theme-brand);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid var(--line);
  color: var(--theme-text);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s;
}

.company::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--accent);
}

.company:hover {
  border-color: var(--accent);
}

.company.parent {
  grid-column: 1 / -1;
}

.company-mark {
  width: 56px;
  height: 56px;
}

.company h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  font-stretch: 118%;
  line-height: 1.05;
}

.company p {
  margin: 0;
  color: var(--theme-text-muted);
  font-size: 15px;
}

.company-go {
  margin-top: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--theme-text-muted);
}

.company:hover .company-go {
  color: var(--theme-text);
}

.company-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.company-icons img {
  width: 36px;
  height: 36px;
}

.index {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.index a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  color: var(--theme-text);
  text-decoration: none;
  text-align: center;
}

.index a:hover {
  border-color: var(--line-strong);
  background: var(--theme-background-alt);
}

.index img {
  width: 72px;
  height: 72px;
}

.index strong {
  font-size: 15px;
  font-weight: 700;
}

.index span {
  font-size: 12.5px;
  color: var(--theme-text-muted);
}

/* ---------- footer, toast ---------- */

.foot {
  border-top: 1px solid var(--line);
  padding-block: 28px calc(28px + env(safe-area-inset-bottom, 0px));
  color: var(--theme-text-muted);
  font-size: 14px;
}

.foot .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
}

.foot a {
  color: inherit;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 12px);
  background: var(--theme-text);
  color: var(--theme-background);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.15s,
    transform 0.15s;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
