/* oniqengine.com
 *
 * One accent (the cube's blue), a navy ground that elevates by lightness,
 * off-white text in three opacity tiers, a 1.25 type scale and an 8-point
 * spacing grid. Dark is the default look; light follows the brand's light
 * palette. Themes: the system setting, overridden by html[data-theme].
 */

/* Chakra Petch for display: its chamfered corners echo the cut faces of the
 * isometric cube in the mark. Instrument Sans for text. Both OFL, Latin
 * subsets, self-hosted. */
@font-face {
  font-family: "Chakra Petch";
  src: url("/static/assets/fonts/chakra-petch-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Chakra Petch";
  src: url("/static/assets/fonts/chakra-petch-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Chakra Petch";
  src: url("/static/assets/fonts/chakra-petch-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Sans";
  src: url("/static/assets/fonts/instrument-sans-vf.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/static/assets/fonts/jetbrains-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Dark (default) */
  --ground: #0a1020;
  --surface: #0f172b;
  --surface-2: #141e37;
  --line: rgba(227, 236, 250, 0.09);
  --line-strong: rgba(227, 236, 250, 0.16);
  --text: #e3ecfa;
  --text-2: rgba(227, 236, 250, 0.7);
  --text-3: rgba(227, 236, 250, 0.48);
  --accent: #4ea8ff;
  --accent-text: #6cb6ff;
  --accent-ink: #06101f;
  --accent-tint: rgba(78, 168, 255, 0.12);
  --code-bg: #0c1427;
  --grid-line: rgba(227, 236, 250, 0.035);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.28);

  /* Type: 1.25 scale from 16px */
  --fs-small: 0.8125rem;
  --fs-body: 1rem;
  --fs-lead: 1.25rem;
  --fs-h3: 1.25rem;
  --fs-h2: clamp(1.75rem, 1.4rem + 1.4vw, 2.4375rem);
  --fs-h1: clamp(2.4375rem, 1.6rem + 3.6vw, 3.8125rem);
  --font-display: "Chakra Petch", "Bahnschrift", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-ui: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  /* Space: 8-point */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 64px;
  --s9: 96px;

  --radius-s: 6px;
  --radius-m: 10px;
  --wrap: 1120px;
  --gutter: 24px;

  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --ground: #eef3fb;
    --surface: #ffffff;
    --surface-2: #f6f9fe;
    --line: rgba(14, 26, 51, 0.1);
    --line-strong: rgba(14, 26, 51, 0.18);
    --text: #0e1a33;
    --text-2: rgba(14, 26, 51, 0.72);
    --text-3: rgba(14, 26, 51, 0.54);
    --accent: #2a77c8;
    --accent-text: #1f63ab;
    --accent-ink: #ffffff;
    --accent-tint: rgba(42, 119, 200, 0.1);
    --code-bg: #e7eef9;
    --grid-line: rgba(14, 26, 51, 0.05);
    --shadow: 0 1px 2px rgba(14, 26, 51, 0.06), 0 12px 32px rgba(14, 26, 51, 0.08);
    color-scheme: light;
  }
}

:root[data-theme="light"] {
  --ground: #eef3fb;
  --surface: #ffffff;
  --surface-2: #f6f9fe;
  --line: rgba(14, 26, 51, 0.1);
  --line-strong: rgba(14, 26, 51, 0.18);
  --text: #0e1a33;
  --text-2: rgba(14, 26, 51, 0.72);
  --text-3: rgba(14, 26, 51, 0.54);
  --accent: #2a77c8;
  --accent-text: #1f63ab;
  --accent-ink: #ffffff;
  --accent-tint: rgba(42, 119, 200, 0.1);
  --code-bg: #e7eef9;
  --grid-line: rgba(14, 26, 51, 0.05);
  --shadow: 0 1px 2px rgba(14, 26, 51, 0.06), 0 12px 32px rgba(14, 26, 51, 0.08);
  color-scheme: light;
}

@media (max-width: 640px) {
  :root {
    --gutter: 16px;
  }
}

/* Base */

/* The hidden attribute wins over any display a component sets. */
[hidden] {
  display: none !important;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--accent-text);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-h1);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--fs-h2);
  line-height: 1.15;
}

h3 {
  font-size: var(--fs-h3);
  line-height: 1.25;
}

p {
  margin: 0;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--accent-tint);
  color: var(--text);
}

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

.skip {
  position: absolute;
  left: var(--s4);
  top: -48px;
  padding: var(--s2) var(--s4);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-s);
  z-index: 10;
}

.skip:focus {
  top: var(--s4);
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
}

.header-row {
  display: flex;
  align-items: center;
  gap: var(--s5);
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  color: var(--text);
  text-decoration: none;
  margin-right: auto;
}

.mark {
  width: 24px;
  height: 36px;
  fill: currentColor;
}

.mark .mark-edge {
  fill: var(--accent);
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.375rem;
  letter-spacing: 0;
  line-height: 1;
}

.nav {
  display: flex;
  gap: var(--s5);
}

.nav a {
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.9375rem;
  padding-block: var(--s2);
  border-bottom: 1px solid transparent;
  transition: color 150ms ease-out, border-color 150ms ease-out;
}

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

.nav a[aria-current="page"] {
  border-bottom-color: var(--accent);
}

.theme-switch {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
}

.theme-switch button {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: color 150ms ease-out, background-color 150ms ease-out;
}

.theme-switch button:hover {
  color: var(--text);
}

.theme-switch button[aria-pressed="true"] {
  color: var(--text);
  background: var(--accent-tint);
}

.theme-switch svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.theme-switch svg .fill {
  fill: currentColor;
  stroke: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 560px) {
  .nav {
    gap: var(--s4);
  }
  .nav a:first-child {
    display: none;
  }
}

/* Buttons */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
}

.button {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  min-height: 44px;
  padding: 0 var(--s5);
  border-radius: var(--radius-s);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease-out, border-color 150ms ease-out, transform 150ms ease-out;
}

.button svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.button-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.button-primary:hover {
  background: color-mix(in srgb, var(--accent) 88%, var(--text));
  text-decoration: none;
}

.button-quiet {
  color: var(--text);
  border-color: var(--line-strong);
  background: transparent;
}

.button-quiet:hover {
  border-color: var(--text-3);
  text-decoration: none;
}

.button:active {
  transform: translateY(1px);
}

.button:disabled {
  cursor: default;
  opacity: 0.6;
}

/* Hero */

.hero {
  position: relative;
  padding-block: var(--s9) var(--s7);
  isolation: isolate;
}

/* A faint isometric grid: the cube mark's geometry as texture. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    repeating-linear-gradient(30deg, var(--grid-line) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(150deg, var(--grid-line) 0 1px, transparent 1px 48px);
  mask-image: radial-gradient(ellipse 70% 90% at 70% 0%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 90% at 70% 0%, #000 0%, transparent 75%);
}

.hero-copy {
  max-width: 44rem;
  display: grid;
  gap: var(--s5);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.lede {
  font-size: var(--fs-lead);
  line-height: 1.5;
  color: var(--text-2);
  max-width: 40em;
}

.hero .actions {
  margin-top: var(--s2);
}

/* Live viewport */

.live {
  padding-bottom: var(--s9);
}

.live-page {
  padding-bottom: var(--s7);
}

/* The viewport is a screen: dark in either theme, like the scene it shows. */
.viewport {
  --screen: #0a1020;
  --screen-line: rgba(227, 236, 250, 0.045);
  position: relative;
  margin: 0;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-m);
  overflow: hidden;
  background: var(--screen);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.viewport canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  outline: none;
}

.viewport.is-running canvas:focus-visible {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.viewport-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    repeating-linear-gradient(30deg, var(--screen-line) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(150deg, var(--screen-line) 0 1px, transparent 1px 32px),
    var(--screen);
}

.viewport-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.72;
}

.viewport-start {
  position: relative;
  display: grid;
  justify-items: center;
  gap: var(--s3);
  padding: var(--s5) var(--s6);
  border-radius: var(--radius-m);
  background: rgba(10, 16, 32, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(227, 236, 250, 0.12);
  text-align: center;
  color: #e3ecfa;
  max-width: min(32rem, calc(100% - 2 * var(--s5)));
}

.viewport-note {
  font-size: var(--fs-small);
  color: rgba(227, 236, 250, 0.75);
}

.viewport.is-loading .viewport-note::after {
  content: "";
  display: inline-block;
  width: 1.2em;
  text-align: left;
  animation: dots 1.2s steps(4, end) infinite;
}

@keyframes dots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75% { content: "..."; }
}

.viewport.is-unsupported .viewport-poster {
  opacity: 0.85;
}

.live-caption {
  display: grid;
  gap: var(--s3);
  max-width: 46rem;
  margin-top: var(--s5);
  color: var(--text-2);
}

.caption-title {
  font-size: var(--fs-h3);
  color: var(--text);
}

.controls {
  font-size: 0.9375rem;
  color: var(--text-2);
}

.label {
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-right: var(--s2);
}

/* Sections */

.section {
  padding-block: var(--s9);
  border-top: 1px solid var(--line);
}

.section-tight {
  padding-block: var(--s8);
}

.section-alt {
  background: var(--surface);
}

.section-head {
  display: grid;
  gap: var(--s4);
  margin-bottom: var(--s7);
}

.features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  overflow: hidden;
}

.feature {
  background: var(--ground);
  padding: var(--s6) var(--s5);
  display: grid;
  align-content: start;
  gap: var(--s3);
}

.feature p {
  color: var(--text-2);
  font-size: 0.9375rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  color: var(--accent-text);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--s7);
  align-items: center;
}

.split-top {
  align-items: start;
}

.split-copy {
  display: grid;
  gap: var(--s4);
}

.split-copy p:not(.lede) {
  color: var(--text-2);
}

@media (max-width: 860px) {
  .split {
    grid-template-columns: 1fr;
    gap: var(--s6);
  }
}

.code {
  margin: 0;
  padding: var(--s5);
  border-radius: var(--radius-m);
  background: var(--code-bg);
  border: 1px solid var(--line);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--text);
}

.code code {
  padding: 0;
  background: none;
  font-size: inherit;
}

.code .c {
  color: var(--text-3);
}

.code .k {
  color: var(--accent-text);
}

.code .s {
  color: var(--text-2);
}

.code .n {
  color: var(--text-2);
}

.facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: var(--s6) var(--s5);
}

.facts li {
  display: grid;
  gap: var(--s2);
  padding-top: var(--s4);
  border-top: 1px solid var(--line-strong);
}

.facts p {
  color: var(--text-2);
  font-size: 0.9375rem;
}

.products {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: var(--s5);
}

.product {
  display: grid;
  align-content: start;
  gap: var(--s3);
  padding: var(--s5);
  border-radius: var(--radius-m);
  border: 1px solid var(--line);
  background: var(--ground);
}

.product h3 a {
  color: var(--text);
  text-decoration: none;
}

.product h3 a:hover {
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

.product p {
  color: var(--text-2);
  font-size: 0.9375rem;
}

.product .product-meta {
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  color: var(--text-3);
  margin-top: auto;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s6);
}

.cta-row > div:first-child {
  display: grid;
  gap: var(--s3);
}

/* Pages */

.page-head {
  padding-block: var(--s8) var(--s6);
}

.page-head .wrap {
  display: grid;
  gap: var(--s4);
}

.page-head-tall {
  padding-block: var(--s9);
}

.crumbs {
  font-size: 0.9375rem;
}

.crumbs a {
  color: var(--text-2);
  text-decoration: none;
}

.crumbs a::after {
  content: " /";
  color: var(--text-3);
}

.crumbs a:hover {
  color: var(--text);
}

.demo-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
  gap: var(--s5);
}

.demo-cards-small {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  margin-top: var(--s5);
}

.demo-card a {
  display: grid;
  height: 100%;
  border-radius: var(--radius-m);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 150ms ease-out, transform 200ms ease-out;
}

.demo-card a:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.demo-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--surface-2);
}

.demo-card-body {
  display: grid;
  gap: var(--s2);
  padding: var(--s4) var(--s5) var(--s5);
}

.demo-card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-h3);
}

.demo-card-summary {
  color: var(--text-2);
  font-size: 0.9375rem;
}

.note {
  margin-top: var(--s6);
  font-size: var(--fs-small);
  color: var(--text-3);
}

.chips {
  list-style: none;
  margin: var(--s4) 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}

.chips li {
  font-size: 0.875rem;
  padding: var(--s1) var(--s3);
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--text-2);
}

.prose {
  max-width: 46rem;
}

.prose h2 {
  font-size: 1.5625rem;
  margin-top: var(--s7);
  margin-bottom: var(--s3);
}

.prose p {
  color: var(--text-2);
  margin-bottom: var(--s4);
}

.prose .code {
  margin-block: var(--s4) var(--s5);
}

.callout {
  padding: var(--s4) var(--s5);
  border-left: 2px solid var(--accent);
  background: var(--accent-tint);
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
}

.callout p {
  margin: 0;
  color: var(--text);
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: var(--s7) calc(var(--s6) + env(safe-area-inset-bottom, 0px));
  color: var(--text-2);
  font-size: 0.9375rem;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s6);
}

.footer-brand {
  display: grid;
  gap: var(--s2);
  max-width: 28rem;
}

.footer-brand .wordmark {
  color: var(--text);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s5);
}

.footer-nav a {
  color: var(--text-2);
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--text);
}

.footer-legal {
  margin-top: var(--s6);
  font-size: var(--fs-small);
  color: var(--text-3);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
  }
}
