/* ============================================================================
   Cortex — base styles
   Requires /css/tokens.css. Reset, type scale, layout primitives, components,
   nav, footer, voxel cube, utilities, reduced-motion.
   ========================================================================== */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  overflow-x: hidden;
  background: var(--c-bg);
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

img,
video {
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

a {
  color: var(--c-accent);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}

a:hover {
  color: var(--c-accent-hover);
}

ul,
ol {
  padding-inline-start: 1.25em;
}

ul[role="list"],
ol[role="list"],
.list-reset {
  list-style: none;
  padding: 0;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

hr {
  border: 0;
  border-top: 1px solid var(--c-border);
}

::selection {
  background: var(--c-accent);
  color: var(--c-text-on-accent);
}

/* ---- Typography ----------------------------------------------------------- */
h1,
h2,
h3,
h4,
.display {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--c-text);
  text-wrap: balance;
}

h1,
.h1 { font-size: var(--fs-3xl); font-weight: 700; }
h2,
.h2 { font-size: var(--fs-2xl); }
h3,
.h3 { font-size: var(--fs-xl); }
h4,
.h4 { font-size: var(--fs-lg); line-height: var(--lh-snug); }
h5,
.h5 { font-size: var(--fs-md); line-height: var(--lh-snug); }

.lead {
  font-size: var(--fs-md);
  font-weight: 300;
  color: var(--c-text-muted);
  line-height: var(--lh-normal);
  text-wrap: pretty;
}

small,
.small { font-size: var(--fs-sm); }

.mono,
code,
kbd,
pre,
samp {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.92em;
  font-feature-settings: "liga" 0;
}

pre {
  overflow-x: auto;
  padding: var(--sp-4) var(--sp-5);
  background: var(--c-bg-deep);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  line-height: 1.55;
  font-size: var(--fs-sm);
}

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

code {
  padding: 0.12em 0.4em;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xs);
  color: var(--c-accent-hover);
}

.kbd,
kbd {
  display: inline-block;
  padding: 0.1em 0.5em;
  font-family: var(--font-mono);
  font-size: 0.85em;
  font-weight: 500;
  line-height: 1.5;
  color: var(--c-text);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border-hover);
  border-bottom-width: 2px;
  border-radius: var(--r-sm);
  white-space: nowrap;
}

/* ---- Layout --------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

@media (min-width: 640px) {
  .container { --gutter: 1.5rem; }
}

@media (min-width: 1024px) {
  .container { --gutter: 2rem; }
}

.container--narrow { max-width: 820px; }
.container--wide { max-width: 1400px; }

.section {
  position: relative;
  padding-block: var(--section-pad);
}

.section--tight { padding-block: calc(var(--section-pad) * 0.6); }
.section--flush-top { padding-block-start: 0; }
.section--deep { background: var(--c-bg-deep); }

.section__header {
  max-width: 720px;
  margin-block-end: clamp(2.5rem, 4vw, 4rem);
}

.section__header--center {
  margin-inline: auto;
  text-align: center;
}

.section__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin-block-end: var(--sp-4);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--c-accent);
}

.section__eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 1px;
  box-shadow: 0 0 10px var(--c-accent-glow);
}

.section__title {
  font-size: var(--fs-2xl);
  margin-block-end: var(--sp-4);
}

.section__lead {
  font-size: var(--fs-md);
  font-weight: 300;
  color: var(--c-text-muted);
  text-wrap: pretty;
}

.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  gap: var(--sp-6);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .grid-2,
  .grid-3,
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
}

/* ---- Glass panels --------------------------------------------------------- */
.glass {
  position: relative;
  background: var(--c-glass);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-md), var(--sh-inset-top);
  -webkit-backdrop-filter: blur(var(--blur-glass));
  backdrop-filter: blur(var(--blur-glass));
  transition:
    border-color var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out);
}

.glass--raised {
  background: var(--c-glass-raised);
  box-shadow: var(--sh-lg), var(--sh-inset-top);
}

.glass--pad {
  padding: clamp(1.25rem, 2.5vw, 2rem);
}

.glass--accent {
  border-color: var(--c-border-accent);
  box-shadow: var(--glow-accent), var(--sh-inset-top);
}

.glass--hover:hover,
.glass--hover:focus-within {
  border-color: var(--c-border-hover);
  box-shadow: var(--sh-lg), var(--sh-inset-top), 0 0 32px -10px var(--c-accent-glow);
  transform: translateY(-3px);
}

/* ---- Buttons -------------------------------------------------------------- */
.btn {
  --btn-bg: var(--c-surface-2);
  --btn-fg: var(--c-text);
  --btn-border: var(--c-border-hover);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 44px;
  padding: 0.7rem 1.25rem;
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  color: var(--btn-fg);
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  border-radius: var(--r-md);
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition:
    background-color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out);
}

.btn:hover {
  color: var(--btn-fg);
  border-color: var(--c-border-strong);
  background: var(--c-surface-3);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn--primary {
  --btn-bg: var(--c-accent);
  --btn-fg: var(--c-text-on-accent);
  --btn-border: var(--c-accent);
  box-shadow: 0 0 0 0 var(--c-accent-glow);
}

.btn--primary:hover {
  --btn-fg: var(--c-text-on-accent);
  background: var(--c-accent-hover);
  border-color: var(--c-accent-hover);
  box-shadow: 0 0 28px -6px var(--c-accent-glow);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--c-text);
  --btn-border: var(--c-border-hover);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--c-border-accent);
}

.btn--mono {
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.02em;
  --btn-bg: var(--c-bg-deep);
  --btn-border: var(--c-border);
}

.btn--mono:hover {
  border-color: var(--c-border-accent);
  color: var(--c-accent-hover);
}

.btn--lg {
  min-height: 52px;
  padding: 0.9rem 1.75rem;
  font-size: var(--fs-base);
  border-radius: var(--r-lg);
}

.btn--sm {
  min-height: 36px;
  padding: 0.45rem 0.9rem;
  font-size: var(--fs-xs);
}

.btn--block {
  width: 100%;
}

.btn__icon {
  width: 1.1em;
  height: 1.1em;
  flex: none;
}

/* ---- Chips, badges, status ----------------------------------------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.35rem 0.8rem;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--c-text-muted);
  background: var(--c-surface-1);
  border: 1px solid var(--c-border);
  border-radius: var(--r-pill);
  white-space: nowrap;
}

.chip--accent {
  color: var(--c-accent-hover);
  background: var(--c-accent-soft);
  border-color: var(--c-border-accent);
}

.chip--cyan {
  color: var(--c-cyan);
  background: var(--c-cyan-soft);
  border-color: rgba(34, 211, 238, 0.35);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.18em 0.6em;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.5;
  color: var(--c-text);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border-hover);
  border-radius: var(--r-xs);
  white-space: nowrap;
}

.badge--accent  { color: var(--c-accent-hover); background: var(--c-accent-soft);  border-color: var(--c-border-accent); }
.badge--cyan    { color: var(--c-cyan);         background: var(--c-cyan-soft);    border-color: rgba(34, 211, 238, 0.35); }
.badge--danger  { color: #fb7185;               background: var(--c-danger-soft);  border-color: rgba(244, 63, 94, 0.4); }
.badge--warning { color: #fbbf24;               background: var(--c-warning-soft); border-color: rgba(245, 158, 11, 0.4); }
.badge--muted   { color: var(--c-text-muted); }

.status-dot {
  --dot: var(--c-accent);
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--dot);
  box-shadow: 0 0 8px var(--dot);
}

.status-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--dot);
  opacity: 0;
  animation: dot-pulse var(--dur-pulse) var(--ease-out) infinite;
}

.status-dot--cyan    { --dot: var(--c-cyan); }
.status-dot--danger  { --dot: var(--c-danger); }
.status-dot--warning { --dot: var(--c-warning); }
.status-dot--muted   { --dot: var(--c-text-faint); box-shadow: none; }
.status-dot--muted::after,
.status-dot--static::after { animation: none; }

@keyframes dot-pulse {
  0%   { transform: scale(0.6); opacity: 0.9; }
  70%  { transform: scale(1.6); opacity: 0; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* ---- Reveal on scroll ---------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity var(--dur-reveal) var(--ease-out),
    transform var(--dur-reveal) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.reveal--left  { transform: translateX(-24px); }
.reveal--right { transform: translateX(24px); }
.reveal--scale { transform: scale(0.96); }

.reveal--left.is-visible,
.reveal--right.is-visible,
.reveal--scale.is-visible { transform: none; }

/* Stagger children: <div class="reveal-stagger"> children get .reveal + delay */
.reveal-stagger > .reveal:nth-child(1) { --reveal-delay: 0ms; }
.reveal-stagger > .reveal:nth-child(2) { --reveal-delay: 80ms; }
.reveal-stagger > .reveal:nth-child(3) { --reveal-delay: 160ms; }
.reveal-stagger > .reveal:nth-child(4) { --reveal-delay: 240ms; }
.reveal-stagger > .reveal:nth-child(5) { --reveal-delay: 320ms; }
.reveal-stagger > .reveal:nth-child(6) { --reveal-delay: 400ms; }
.reveal-stagger > .reveal:nth-child(n+7) { --reveal-delay: 480ms; }

/* No-JS fallback: if main.js never runs, everything stays visible */
.no-js .reveal {
  opacity: 1;
  transform: none;
}

/* ---- Accessibility -------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: var(--sp-3);
  left: var(--sp-3);
  z-index: var(--z-skip);
  padding: 0.6rem 1rem;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--c-text-on-accent);
  background: var(--c-accent);
  border-radius: var(--r-md);
  transform: translateY(-160%);
  opacity: 0;
  transition: transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast);
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: none;
  opacity: 1;
  outline: none;
  box-shadow: var(--ring-focus);
}

:focus {
  outline: none;
}

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

.btn:focus-visible,
.glass:focus-visible {
  outline: none;
  box-shadow: var(--ring-focus);
}

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

/* ---- Navigation ----------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: rgba(15, 17, 21, 0.72);
  border-bottom: 1px solid var(--c-border);
  -webkit-backdrop-filter: blur(var(--blur-nav)) saturate(140%);
  backdrop-filter: blur(var(--blur-nav)) saturate(140%);
  transition: background-color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}

.nav.is-scrolled {
  background: rgba(15, 17, 21, 0.88);
  border-bottom-color: var(--c-border-hover);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  min-height: 68px;
}

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  color: var(--c-text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: var(--tracking-tight);
  flex: none;
}

.nav__brand:hover { color: var(--c-text); }

.nav__brand img,
.nav__brand svg {
  width: 30px;
  height: 30px;
  flex: none;
  filter: drop-shadow(0 0 10px var(--c-accent-glow));
}

.nav__brand-sub {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: var(--fs-xs);
  color: var(--c-text-faint);
  letter-spacing: 0.04em;
  margin-inline-start: 2px;
}

.nav__links {
  display: none;
  align-items: center;
  gap: var(--sp-1);
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav__link {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.8rem;
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--c-text-muted);
  border-radius: var(--r-sm);
  transition: color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}

.nav__link:hover,
.nav__link.is-active {
  color: var(--c-text);
  background: rgba(255, 255, 255, 0.04);
}

.nav__actions {
  display: none;
  align-items: center;
  gap: var(--sp-2);
}

.nav__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--c-text);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-surface-1);
  transition: border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}

.nav__toggle:hover {
  border-color: var(--c-border-hover);
  background: var(--c-surface-2);
}

.nav__toggle-bars {
  position: relative;
  display: block;
  width: 18px;
  height: 12px;
}

.nav__toggle-bars::before,
.nav__toggle-bars::after,
.nav__toggle-bars span {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-fast) var(--ease-out);
}

.nav__toggle-bars::before { top: 0; }
.nav__toggle-bars span    { top: 5px; }
.nav__toggle-bars::after  { top: 10px; }

.nav__toggle[aria-expanded="true"] .nav__toggle-bars::before { transform: translateY(5px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] .nav__toggle-bars::after  { transform: translateY(-5px) rotate(-45deg); }
.nav__toggle[aria-expanded="true"] .nav__toggle-bars span    { opacity: 0; transform: scaleX(0); }

/* Mobile panel: dialog-like, sits under the bar */
.nav__panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: var(--z-overlay);
  display: grid;
  gap: var(--sp-2);
  padding: var(--sp-4) var(--gutter) var(--sp-6);
  background: rgba(15, 17, 21, 0.96);
  border-bottom: 1px solid var(--c-border-hover);
  box-shadow: var(--sh-xl);
  -webkit-backdrop-filter: blur(var(--blur-nav));
  backdrop-filter: blur(var(--blur-nav));
  max-height: calc(100dvh - 68px);
  overflow-y: auto;
  transform-origin: top;
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out), visibility 0s;
}

.nav__panel[hidden] {
  display: none;
}

.nav__panel .nav__link {
  display: flex;
  padding: 0.85rem 1rem;
  font-size: var(--fs-base);
  border: 1px solid transparent;
}

.nav__panel .nav__link:hover {
  border-color: var(--c-border);
}

.nav__panel-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
  margin-block-start: var(--sp-3);
  padding-block-start: var(--sp-4);
  border-top: 1px solid var(--c-border);
}

@media (min-width: 900px) {
  .nav__links,
  .nav__actions { display: flex; }
  .nav__toggle,
  .nav__panel { display: none !important; }
}

/* ---- Footer --------------------------------------------------------------- */
.footer {
  position: relative;
  padding-block: var(--sp-16) var(--sp-10);
  background: var(--c-bg-deep);
  border-top: 1px solid var(--c-border);
  color: var(--c-text-muted);
  font-size: var(--fs-sm);
}

.footer__grid {
  display: grid;
  gap: var(--sp-10) var(--sp-8);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .footer__grid { grid-template-columns: 1.6fr repeat(3, minmax(0, 1fr)); }
}

.footer__brand {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  max-width: 340px;
}

.footer__brand .nav__brand { font-size: 1.2rem; }

.footer__tagline {
  color: var(--c-text-muted);
  font-weight: 300;
}

.footer__by {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--c-text-faint);
  letter-spacing: 0.04em;
}

.footer__by a { color: var(--c-text-muted); }
.footer__by a:hover { color: var(--c-accent-hover); }

.footer__heading {
  margin-block-end: var(--sp-4);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--c-text);
}

.footer__list {
  display: grid;
  gap: var(--sp-3);
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer__list a {
  color: var(--c-text-muted);
}

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

.footer__soon {
  margin-inline-start: var(--sp-2);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-text-faint);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xs);
  padding: 0.05em 0.4em;
  vertical-align: middle;
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-block-start: var(--sp-12);
  padding-block-start: var(--sp-6);
  border-top: 1px solid var(--c-border);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--c-text-faint);
}

.footer__bottom a { color: var(--c-text-muted); }
.footer__bottom a:hover { color: var(--c-accent-hover); }

/* ---- Voxel cube (CSS 3D) --------------------------------------------------
   <div class="voxel-cube" style="--voxel-size:64px">
     <i class="voxel-cube__face voxel-cube__face--top"></i>
     <i class="voxel-cube__face voxel-cube__face--left"></i>
     <i class="voxel-cube__face voxel-cube__face--right"></i>
   </div>
   Isometric projection: three clip-path rhombi on a sqrt(3)s x 2s box.
   Faces stack in one box, so it composes cleanly in flex/grid and scales
   with --voxel-size alone. Optional .voxel-cube__edge draws the seams.
   ------------------------------------------------------------------------- */
.voxel-cube {
  --s: var(--voxel-size);
  position: relative;
  width: calc(var(--s) * 1.732);        /* sqrt(3) * s */
  height: calc(var(--s) * 2);
  flex: none;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.45));
}

.voxel-cube__face {
  position: absolute;
  inset: 0;
  display: block;
}

.voxel-cube__face--top {
  background: var(--voxel-top);
  clip-path: polygon(50% 0, 100% 25%, 50% 50%, 0 25%);
}

.voxel-cube__face--left {
  background: var(--voxel-left);
  clip-path: polygon(0 25%, 50% 50%, 50% 100%, 0 75%);
}

.voxel-cube__face--right {
  background: var(--voxel-right);
  clip-path: polygon(50% 50%, 100% 25%, 100% 75%, 50% 100%);
}

/* Vertical seam between the two side faces */
.voxel-cube::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  bottom: 0;
  width: 1px;
  margin-left: -0.5px;
  background: var(--voxel-outline);
  pointer-events: none;
}

.voxel-cube--sm { --voxel-size: 24px; }
.voxel-cube--lg { --voxel-size: 96px; }

.voxel-cube--cyan {
  --voxel-top: #67e8f9;
  --voxel-left: #22d3ee;
  --voxel-right: #0891b2;
}

.voxel-cube--stone {
  --voxel-top: #2a303b;
  --voxel-left: #1a1e26;
  --voxel-right: #14171d;
  --voxel-outline: rgba(255, 255, 255, 0.08);
}

.voxel-cube--float {
  animation: voxel-float 6s var(--ease-in-out) infinite;
}

@keyframes voxel-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

/* ---- Toast (Cortex.toast) ------------------------------------------------- */
.toast-region {
  position: fixed;
  inset-inline: var(--gutter);
  bottom: var(--sp-6);
  z-index: var(--z-toast);
  display: grid;
  justify-items: center;
  gap: var(--sp-2);
  pointer-events: none;
}

.toast {
  --toast-accent: var(--c-accent);
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  max-width: min(480px, 100%);
  padding: 0.75rem 1rem 0.75rem 0.9rem;
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 400;
  color: var(--c-text);
  background: var(--c-glass-raised);
  border: 1px solid var(--c-border-hover);
  border-left: 3px solid var(--toast-accent);
  border-radius: var(--r-md);
  box-shadow: var(--sh-lg), var(--sh-inset-top);
  -webkit-backdrop-filter: blur(var(--blur-glass));
  backdrop-filter: blur(var(--blur-glass));
  pointer-events: auto;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}

.toast.is-visible {
  opacity: 1;
  transform: none;
}

.toast--success { --toast-accent: var(--c-accent); }
.toast--info    { --toast-accent: var(--c-cyan); }
.toast--warning { --toast-accent: var(--c-warning); }
.toast--error   { --toast-accent: var(--c-danger); }

/* ---- Utilities ------------------------------------------------------------ */
.text-muted  { color: var(--c-text-muted); }
.text-faint  { color: var(--c-text-faint); }
.text-accent { color: var(--c-accent); }
.text-cyan   { color: var(--c-cyan); }
.text-danger { color: var(--c-danger); }
.text-center { text-align: center; }
.text-balance { text-wrap: balance; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }

.mt-0  { margin-block-start: 0; }
.mt-1  { margin-block-start: var(--sp-1); }
.mt-2  { margin-block-start: var(--sp-2); }
.mt-3  { margin-block-start: var(--sp-3); }
.mt-4  { margin-block-start: var(--sp-4); }
.mt-6  { margin-block-start: var(--sp-6); }
.mt-8  { margin-block-start: var(--sp-8); }
.mt-12 { margin-block-start: var(--sp-12); }
.mt-16 { margin-block-start: var(--sp-16); }

.mb-0  { margin-block-end: 0; }
.mb-2  { margin-block-end: var(--sp-2); }
.mb-4  { margin-block-end: var(--sp-4); }
.mb-6  { margin-block-end: var(--sp-6); }
.mb-8  { margin-block-end: var(--sp-8); }

.hide-mobile { display: none; }
@media (min-width: 640px) { .hide-mobile { display: initial; } }
.hide-desktop { display: initial; }
@media (min-width: 900px) { .hide-desktop { display: none !important; } }

.scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--c-border-hover) transparent;
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .status-dot::after,
  .voxel-cube--float {
    animation: none;
  }
}
