/*
 * Zx website chrome.
 *
 * The marketing surfaces follow the ZeyOS visual language (www.zeyos.com): Inter, deep slate-to-
 * black bands, the ZeyOS green as the single accent, heavy tightly-tracked headings, uppercase
 * eyebrow labels, and translucent cards. The documentation application uses
 * the themeable `--zx-*` component tokens instead so they follow the light/dark switch.
 *
 * Site-only colours live in the `--site-*` namespace below and are deliberately fixed: the
 * marketing bands are always dark, exactly like zeyos.com.
 */
:root {
  --site-content-width: 1200px;
  --site-night: #0f172a;
  --site-night-deep: #080e1a;
  --site-black: #05070c;
  --site-brand: #21cc75;
  --site-brand-strong: #16a75d;
  --site-mist: #e2e8f0;
  --site-header-height: 64px;
}

html {
  scroll-padding-block-start: calc(var(--site-header-height) + var(--zx-space-4));
}

body.site-page {
  min-block-size: 100dvh;
  display: flex;
  flex-direction: column;
}

body.site-page > main {
  flex: 1 0 auto;
}

/* ---------------------------------------------------------------- header -- */

.site-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 30;
  border-block-end: 1px solid var(--zx-color-border);
  background: color-mix(in srgb, var(--zx-color-bg-surface) 85%, transparent);
  backdrop-filter: blur(14px);
}

/* Home page: the header shares the hero's top colour so the two read as one dark surface, then
   picks up a border and a blur once the page scrolls past the hero. (A sticky header stays in
   flow, so a transparent background would show the page colour, not the hero.) */
.site-header--overlay {
  border-block-end-color: transparent;
  background: var(--site-night);
  backdrop-filter: none;
  color: #fff;
}

.site-header--overlay[data-scrolled] {
  border-block-end-color: rgb(255 255 255 / 10%);
  background: color-mix(in srgb, var(--site-night) 88%, transparent);
  backdrop-filter: blur(14px);
}

.site-header__inner,
.site-section,
.site-footer__inner {
  inline-size: min(100% - (2 * var(--zx-space-6)), var(--site-content-width));
  margin-inline: auto;
}

.site-header__inner {
  display: flex;
  min-block-size: var(--site-header-height);
  align-items: center;
  gap: var(--zx-space-6);
}

.site-brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  border-radius: var(--zx-radius-md);
}

.site-brand img {
  display: block;
  block-size: 30px;
  inline-size: auto;
}

.brand-logo--dark {
  display: none !important;
}

[data-zx-theme="dark"] .brand-logo--light,
.site-header--overlay .brand-logo--light {
  display: none !important;
}

[data-zx-theme="dark"] .brand-logo--dark,
.site-header--overlay .brand-logo--dark {
  display: block !important;
}

.site-nav {
  display: flex;
  min-inline-size: 0;
  align-items: center;
  gap: var(--zx-space-1);
  margin-inline-start: auto;
}

.site-nav a {
  padding: var(--zx-space-2) var(--zx-space-3);
  border-radius: var(--zx-radius-md);
  color: var(--zx-color-text-muted);
  font-size: var(--zx-text-md);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: var(--zx-color-bg-hover);
  color: var(--zx-color-text);
}

.site-header--overlay .site-nav a {
  color: rgb(255 255 255 / 72%);
}

.site-header--overlay .site-nav a:hover,
.site-header--overlay .site-nav a[aria-current="page"] {
  background: rgb(255 255 255 / 10%);
  color: #fff;
}

/* Square, label-free chrome buttons. The glyph is an SVG mask filled with currentColor, so it
   follows the theme and the overlay header without a second asset. */
.site-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: var(--zx-space-2);
}

.site-icon-btn {
  display: inline-grid;
  place-items: center;
  inline-size: 34px;
  block-size: 34px;
  min-block-size: 0;
  padding: 0;
  border: 1px solid var(--zx-color-border);
  border-radius: var(--zx-radius-lg);
  background: none;
  color: var(--zx-color-text-muted);
  cursor: pointer;
}

.site-icon-btn::before {
  content: "";
  inline-size: 17px;
  block-size: 17px;
  background: currentColor;
  mask: var(--site-icon) center / contain no-repeat;
}

.site-icon-btn:hover {
  background: var(--zx-color-bg-hover);
  color: var(--zx-color-text);
}

.site-icon-btn[data-site-icon="github"] {
  --site-icon: url("assets/github.svg");
}

/* The theme button shows the theme it switches *to*. */
.site-icon-btn[data-theme-toggle] {
  --site-icon: url("assets/moon.svg");
}

[data-zx-theme="dark"] .site-icon-btn[data-theme-toggle] {
  --site-icon: url("assets/sun.svg");
}

.site-header--overlay .site-icon-btn {
  border-color: rgb(255 255 255 / 22%);
  background: rgb(255 255 255 / 6%);
  color: rgb(255 255 255 / 85%);
}

.site-header--overlay .site-icon-btn:hover {
  background: rgb(255 255 255 / 14%);
  color: #fff;
}

/* -------------------------------------------------------- marketing bands -- */

.site-band {
  position: relative;
  color: #fff;
  background: var(--site-night);
}

.site-band--deep {
  background: var(--site-black);
}

.site-band--gradient {
  background: linear-gradient(180deg,
    var(--site-night) 0%,
    var(--site-night) 45%,
    var(--site-night-deep) 78%,
    var(--site-black) 100%);
}

.site-band--light {
  border-block: 1px solid var(--zx-color-border);
  background: var(--zx-color-bg-surface);
  color: var(--zx-color-text);
}

.site-section {
  padding-block: clamp(var(--zx-space-8), 7vw, 88px);
}

.band-eyebrow {
  display: flex;
  align-items: center;
  gap: var(--zx-space-3);
  margin: 0 0 var(--zx-space-4);
  color: var(--site-brand);
  font-size: var(--zx-text-sm);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.band-eyebrow::before {
  content: "";
  inline-size: 28px;
  block-size: 2px;
  flex: none;
  border-radius: var(--zx-radius-full);
  background: currentColor;
}

.site-band--light .band-eyebrow {
  color: var(--zx-color-accent);
}

.section-heading {
  max-inline-size: 720px;
  margin-block-end: var(--zx-space-7);
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(30px, 4.4vw, 44px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.section-heading p {
  margin: var(--zx-space-4) 0 0;
  color: rgb(226 232 240 / 62%);
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.65;
}

.site-band--light .section-heading p {
  color: var(--zx-color-text-muted);
}

/* --------------------------------------------------------------- buttons -- */

.site-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--zx-space-2);
  padding: 13px 26px;
  border: 1px solid transparent;
  border-radius: var(--zx-radius-lg);
  font-size: var(--zx-text-lg);
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--zx-dur-fast) var(--zx-ease),
    border-color var(--zx-dur-fast) var(--zx-ease),
    transform var(--zx-dur-fast) var(--zx-ease);
}

.site-btn--primary {
  background: var(--site-brand);
  color: #06210f;
}

.site-btn--primary:hover {
  background: var(--site-brand-strong);
}

.site-btn--ghost {
  border-color: rgb(255 255 255 / 22%);
  background: rgb(255 255 255 / 6%);
  color: rgb(255 255 255 / 88%);
  font-weight: 600;
}

.site-btn--ghost:hover {
  border-color: rgb(255 255 255 / 34%);
  background: rgb(255 255 255 / 12%);
}

.site-btn--sm {
  padding: 8px 16px;
  font-size: var(--zx-text-md);
}

.site-btn:active {
  transform: translateY(1px);
}

.site-btn:focus-visible {
  outline: 2px solid var(--site-brand);
  outline-offset: 3px;
}

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

.hero__inner {
  display: grid;
  justify-items: center;
  padding-block: clamp(84px, 13vw, 148px) clamp(64px, 9vw, 104px);
  text-align: center;
}

.hero__logo {
  inline-size: clamp(148px, 22vw, 216px);
  block-size: auto;
  margin-block-end: var(--zx-space-6);
}

.hero__eyebrow {
  justify-content: center;
}

.hero h1 {
  max-inline-size: 15ch;
  margin: 0;
  font-size: clamp(38px, 6.6vw, 68px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.hero h1 em {
  color: var(--site-brand);
  font-style: normal;
}

.hero__subhead {
  max-inline-size: 62ch;
  margin: var(--zx-space-6) 0 0;
  color: rgb(226 232 240 / 62%);
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.6;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--zx-space-3);
  margin-block-start: var(--zx-space-7);
}

.hero__tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--zx-space-2);
  margin-block-start: var(--zx-space-7);
  padding: 0;
  list-style: none;
}

.hero__tags li {
  padding: 4px 12px;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: var(--zx-radius-full);
  background: rgb(255 255 255 / 4%);
  color: rgb(226 232 240 / 70%);
  font-size: var(--zx-text-xs);
}

.zeyos-lockup {
  display: inline-flex;
  align-items: center;
  gap: var(--zx-space-3);
  margin-block-start: var(--zx-space-8);
  color: rgb(226 232 240 / 50%);
  font-size: var(--zx-text-sm);
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
}

.zeyos-lockup:hover {
  color: rgb(226 232 240 / 80%);
}

.zeyos-lockup img {
  display: block;
  inline-size: 96px;
  block-size: auto;
}

/* -------------------------------------------------------------- features -- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--zx-space-4);
}

.feature-card {
  padding: var(--zx-space-6);
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: var(--zx-radius-xl);
  background: rgb(255 255 255 / 3%);
}

.feature-card__icon {
  display: inline-grid;
  inline-size: 38px;
  block-size: 38px;
  place-items: center;
  border: 1px solid rgb(33 204 117 / 24%);
  border-radius: var(--zx-radius-lg);
  background: rgb(33 204 117 / 12%);
  color: var(--site-brand);
}

.feature-card h3 {
  margin: var(--zx-space-5) 0 var(--zx-space-2);
  font-size: var(--zx-text-lg);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.feature-card p {
  margin: 0;
  color: rgb(226 232 240 / 60%);
  line-height: 1.6;
}

/* -------------------------------------------------------------- showcase -- */

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--zx-space-4);
}

.showcase-card {
  display: grid;
  align-content: start;
  min-inline-size: 0;
  gap: var(--zx-space-4);
  padding: var(--zx-space-5);
  border: 1px solid var(--zx-color-border);
  border-radius: var(--zx-radius-xl);
  background: var(--zx-color-bg-page);
}

.showcase-card[data-wide] {
  grid-column: 1 / -1;
}

.showcase-card h3 {
  margin: 0;
  font-size: var(--zx-text-md);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--zx-color-text-muted);
}

.showcase-card output {
  min-block-size: 1.5em;
  color: var(--zx-color-text-muted);
  font-size: var(--zx-text-sm);
}

.showcase-card .zx-table {
  min-inline-size: 0;
}

/* ----------------------------------------------------------- quick start -- */

.quick-start-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--zx-space-4);
}

.code-card {
  min-inline-size: 0;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: var(--zx-radius-xl);
  background: rgb(255 255 255 / 3%);
}

.code-card h3 {
  margin: 0;
  padding: var(--zx-space-3) var(--zx-space-5);
  border-block-end: 1px solid rgb(255 255 255 / 8%);
  color: rgb(226 232 240 / 70%);
  font-family: var(--zx-font-mono);
  font-size: var(--zx-text-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.code-card pre {
  margin: 0;
  overflow: auto;
  padding: var(--zx-space-5);
  color: var(--site-mist);
  font-family: var(--zx-font-mono);
  font-size: var(--zx-text-sm);
  line-height: 1.7;
  tab-size: 2;
  white-space: pre;
}

/* ---------------------------------------------------------------- footer -- */

.site-footer {
  background: var(--site-black);
  color: rgb(226 232 240 / 60%);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--zx-space-4) var(--zx-space-6);
  padding-block: var(--zx-space-6);
}

.site-footer__brand {
  display: flex;
  align-items: center;
  gap: var(--zx-space-4);
}

.site-footer__brand img {
  display: block;
  block-size: 26px;
  inline-size: auto;
}

.site-footer p {
  margin: 0;
  font-size: var(--zx-text-sm);
}

.site-footer a {
  color: inherit;
  font-size: var(--zx-text-sm);
  text-decoration: none;
  border-block-end: 1px solid rgb(255 255 255 / 25%);
}

.site-footer a:hover {
  border-block-end-color: currentColor;
  color: #fff;
}

.site-footer__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--zx-space-5);
}

.site-footer__meta a {
  border-block-end: 0;
}

.site-footer__meta a:hover {
  color: #fff;
}

/* ------------------------------------------------------------ responsive -- */

@media (max-width: 900px) {
  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-footer__inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .site-header__inner {
    flex-wrap: wrap;
    gap: var(--zx-space-2);
    padding-block: var(--zx-space-2);
  }

  .site-nav {
    order: 3;
    inline-size: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .site-nav a {
    padding-inline: var(--zx-space-2);
  }

  .theme-toggle {
    margin-inline-start: auto;
  }

  .feature-grid,
  .showcase-grid,
  .quick-start-grid {
    grid-template-columns: 1fr;
  }

  .showcase-card[data-wide] {
    grid-column: auto;
  }
}

@media (max-width: 520px) {
  .site-header__inner,
  .site-section,
  .site-footer__inner {
    inline-size: min(100% - (2 * var(--zx-space-4)), var(--site-content-width));
  }

  .site-brand img {
    inline-size: 84px;
  }

  .site-nav {
    font-size: var(--zx-text-sm);
  }

  .hero__actions {
    inline-size: 100%;
  }

  .hero__actions .site-btn {
    flex: 1 1 190px;
  }

  .site-footer__inner {
    grid-template-columns: 1fr;
    gap: var(--zx-space-6);
  }

}
