/* ============================================================================
   CORTEX / CHAOS LABS — LANDING-PAGE DESIGN TOKENS
   Distilled verbatim from ChaosLabsInc/company-website @ main
   (src/styles/globals.css, keyfeatures.css, tailwind.config.ts).

   This is the MARKETING-SITE token set — distinct from the Chaos AI *app*
   design system. Key differences:
     • Canvas is the dark "space" navy (#0B101C); marketing sections alternate
       dark <-> white. Text default is WHITE on dark.
     • Type roles are swapped vs. the app: INTER is the primary/body face,
       AT AERO is the secondary/display face, AEONIK FONO is the mono/label face.
     • A responsive --cell grid drives the column-rule background pattern.
     • Surfaces are glassy: .card / .browser use layered inset shadows + blur,
       never flat fills.
   ============================================================================ */

/* ----------------------------------------------------------------------------
   FONTS
---------------------------------------------------------------------------- */
@font-face {
  font-family: "AT Aero";
  src: url("/cortex/website/assets/standalone/fonts/aac729e2e2c5d752.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "AT Aero";
  src: url("/cortex/website/assets/standalone/fonts/6c58b6b0b484759a.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Aeonik Fono";
  src: url("/cortex/website/assets/standalone/fonts/85f50ae84f3ed69a.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
/* Inter is loaded from Google Fonts in the host page (weights 400/500/600/700) */

:root {
  /* --- font stacks ------------------------------------------------------- */
  --font-primary-family: "Inter";
  --font-secondary-family: "AT Aero";
  --font-mono-family: "Aeonik Fono";

  --font-primary:
    var(--font-primary-family), Arial, Helvetica, sans-serif; /* body */
  --font-secondary:
    var(--font-secondary-family), Arial, Helvetica, sans-serif; /* display */
  --font-mono: var(--font-mono-family), monospace; /* labels / buttons / nums */

  /* --- color tokens (verbatim from globals.css :root) -------------------- */
  --background: rgba(11, 16, 28, 1); /* #0B101C  page canvas (dark)        */
  --foreground: rgba(36, 51, 66, 1); /* #243342  hairline border on dark   */
  --primary: rgba(255, 255, 255, 1); /* #FFFFFF  default text on dark       */
  --secondary: rgba(152, 169, 179, 1); /* #98A9B3  secondary / lede text      */
  --tertiary: rgba(89, 113, 130, 1); /* #597182  muted labels / captions    */
  --accent: rgba(45, 106, 231, 1); /* #2D6AE7  Chaos brand blue           */
  --hover: rgba(22, 82, 204, 1); /* #1652CC  pressed blue               */
  --muted: rgba(95, 104, 134, 0.65);
  --ui-default: rgba(
    101,
    137,
    158,
    0.05
  ); /* glassy surface (5% grey)          */
  --ui-hover: rgba(101, 137, 158, 0.1); /* glassy surface hover (10% grey)   */

  --color-quaternary: #cddce6; /* hairline border on WHITE sections   */
  --color-faded: #597182;

  /* --- semantic tokens (Cortex master doc §7) ----------------------------
     The color logic carries meaning everywhere: outcome/value = green,
     attention/waste-flag = amber, waste/failure/blocked = red, agents = purple.
     Color is never the ONLY signal — always pair with a label or icon. */
  --affirm: #3dd68c; /* positive outcome, "value observed", success      */
  --affirm-dim: rgba(61, 214, 140, 0.14);
  --caution: #f5a524; /* attention, risk, "pending sign-off", waste flag  */
  --caution-dim: rgba(245, 165, 36, 0.14);
  --deny: #f2667c; /* waste, failure, "no outcome", blocked-at-boundary*/
  --deny-dim: rgba(242, 102, 124, 0.14);
  --agent: #b084ec; /* agents / autonomous activity                     */
  --agent-dim: rgba(176, 132, 236, 0.14);
  --primary-dim: rgba(45, 106, 231, 0.14);

  /* text colors used on WHITE sections */
  --txt-primary: #25354b; /* headings / body on white            */
  --txt-secondary: #98a9b3;
  --txt-ui: #556a87;

  /* --- surface + theme-flip tokens (added for light/dark support) --------- */
  --text-strong: #ffffff; /* headings / strong text              */
  --card-grad: rgba(101, 137, 158, 0.1);
  --opview-grad: rgba(101, 137, 158, 0.05);
  --card-edge: rgba(177, 230, 255, 0.08);
  --shadow-deep: #0b101c;
  --inset-bg: rgba(11, 16, 28, 0.4);
  --hair-soft: rgba(101, 137, 158, 0.08);
  --nav-bg: rgba(11, 16, 28, 0.74);
  --logo-filter: brightness(0) invert(1); /* tint mono logos white on dark    */
  --seal-coin: #ffffff;

  /* the grid cell — width of one column rule in the background pattern */
  --cell: calc(100vw / 9);
}

/* ----------------------------------------------------------------------------
   LIGHT THEME — flips the core palette; deck-visual tokens flip in deck-visuals.css
---------------------------------------------------------------------------- */
:root[data-theme="light"] {
  --background: #ffffff;
  --foreground: #e4eaf0; /* hairline on light */
  --primary: #16202e; /* default body text */
  --secondary: #51607a;
  --tertiary: #7a8a9c;
  --hover: #1652cc;
  --muted: rgba(95, 104, 134, 0.45);
  --ui-default: rgba(101, 137, 158, 0.06);
  --ui-hover: rgba(101, 137, 158, 0.12);
  --color-quaternary: #d7e0e9;
  --affirm: #0e9c6e;
  --affirm-dim: rgba(14, 156, 110, 0.12);
  --caution: #b57514;
  --caution-dim: rgba(181, 117, 20, 0.12);
  --deny: #d6374e;
  --deny-dim: rgba(214, 55, 78, 0.12);
  --agent: #7a47c9;
  --agent-dim: rgba(122, 71, 201, 0.12);
  --primary-dim: rgba(45, 106, 231, 0.1);
  --txt-primary: #16202e;
  --txt-secondary: #51607a;
  --txt-ui: #51607a;
  --text-strong: #0b1018;
  --card-grad: #ffffff;
  --opview-grad: #ffffff;
  --card-edge: #e4eaf0;
  --shadow-deep: rgba(22, 32, 46, 0.1);
  --inset-bg: #f4f7fa;
  --hair-soft: rgba(101, 137, 158, 0.16);
  --nav-bg: rgba(255, 255, 255, 0.78);
  --logo-filter: brightness(0); /* mono logos black on light */
}

@media (min-width: 709px) {
  :root {
    --cell: 20px;
  }
}
@media (min-width: 1024px) {
  :root {
    --cell: calc(100vw / 32);
  }
}
@media (min-width: 1512px) {
  :root {
    --cell: 47px;
  }
}

/* ----------------------------------------------------------------------------
   BASE
---------------------------------------------------------------------------- */
body {
  color: var(--primary);
  background: var(--background);
  font-family: var(--font-primary);
  position: relative;
  /* No bg/color transition: animating theme made nav FOUC (dark→light) obvious. */
  transition: none;
}
body[data-modal-open="true"] {
  overflow: hidden;
}

/* light-theme fixes: tinted alternate sections, mono-logo recolor, white-coin keeps white */
:root[data-theme="light"] section.white {
  background: #f4f7fa;
  border-color: var(--foreground);
}
:root[data-theme="light"] .cred__rail img,
:root[data-theme="light"] .logorail img {
  filter: brightness(0);
}

:root[data-theme="light"] .seal__coin {
  background: #ffffff;
  border: 1px solid var(--foreground);
}

/* ----------------------------------------------------------------------------
   TYPE HELPERS
---------------------------------------------------------------------------- */
.font-primary {
  font-family: var(--font-primary);
}
.font-secondary {
  font-family: var(--font-secondary);
}
.font-mono {
  font-family: var(--font-mono);
}

/* the all-caps mono micro-label used for nav, buttons, tags, eyebrows */
.label-mono {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

/* gradient-clipped headline fill (light reads brighter at the top) */
.bg-headline {
  background-image: linear-gradient(
    0deg,
    rgba(255, 255, 255, 1) -55.33%,
    rgba(255, 255, 255, 0) 31.29%
  );
  background-color: var(--txt-primary);
}

/* ----------------------------------------------------------------------------
   SURFACES — glassy card + browser frame (verbatim shadow recipes)
---------------------------------------------------------------------------- */
.card {
  background: linear-gradient(
    180deg,
    rgba(11, 16, 28, 0.1) -2.23%,
    #1f232d 8.93%
  );
  box-shadow:
    0 1px 2px 0 rgba(177, 230, 255, 0.21) inset,
    7px 11px 11px -6px rgba(109, 128, 246, 0.07) inset,
    0 4px 88px 0 #0b101c;
  backdrop-filter: blur(7px);
}

.browser {
  background: linear-gradient(
    180deg,
    rgba(11, 16, 28, 0.1) -2.23%,
    #1f232d 8.93%
  );
  box-shadow:
    0px 4px 88px #0b101c,
    inset 0px 1px 2px rgba(177, 230, 255, 0.21),
    inset 7px 11px 11px -6px rgba(109, 128, 246, 0.07);
  backdrop-filter: blur(7px);
}

.bg-faded {
  background: linear-gradient(
    0deg,
    rgba(101, 137, 158, 0.05) 0%,
    rgba(101, 137, 158, 0.05) 100%,
    #fff
  );
}

/* translucent overlay chrome that floats over content */
.content-overlay {
  background: linear-gradient(
    180deg,
    rgba(11, 16, 28, 1) 85.48%,
    rgba(11, 16, 28, 0.6) 100%
  );
  backdrop-filter: blur(17px);
}

/* fade the bottom of a tall hero image into the canvas */
.overlay-radial::after {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 839px;
  content: "";
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(11, 16, 28, 0) 63.94%,
    #0b101c 88.46%
  );
}

/* ----------------------------------------------------------------------------
   GRID BACKGROUND PATTERN
   Faithful CSS-only version of <BackgroundPattern> — vertical column rules
   spaced by --cell, centered, capped at the 1224px content width.
---------------------------------------------------------------------------- */
.grid-pattern {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  justify-content: center;
}
.grid-pattern__inner {
  width: 100%;
  max-width: 1224px;
  height: 100%;
  background-image: repeating-linear-gradient(
    to right,
    var(--foreground) 0,
    var(--foreground) 1px,
    transparent 1px,
    transparent var(--cell)
  );
}
.grid-pattern--white .grid-pattern__inner {
  border-color: var(--color-quaternary);
  background-image: repeating-linear-gradient(
    to right,
    var(--color-quaternary) 0,
    var(--color-quaternary) 1px,
    transparent 1px,
    transparent var(--cell)
  );
}

/* the 48px divider strip that separates sections (carries the grid pattern) */
.section-divider {
  position: relative;
  overflow: hidden;
  height: 48px;
  border-top: 1px solid var(--foreground);
  border-bottom: 1px solid var(--foreground);
}
.section-divider--white {
  border-color: var(--color-quaternary);
}

/* ----------------------------------------------------------------------------
   MARQUEE (logo rail) — verbatim keyframe
---------------------------------------------------------------------------- */
.marquee-container:hover .marquee {
  --animation-play-state: paused;
}
.marquee {
  animation: marquee var(--duration, 30s) linear infinite;
  animation-play-state: var(--animation-play-state, running);
  will-change: transform;
}
@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-33.3333333%);
  }
}
.mask-edges {
  mask-image: linear-gradient(
    to right,
    rgba(0, 0, 0, 0) 0%,
    rgb(0, 0, 0) 50px,
    rgb(0, 0, 0) calc(100% - 50px),
    rgba(0, 0, 0, 0) 100%
  );
}

/* ----------------------------------------------------------------------------
   SCROLLBAR
---------------------------------------------------------------------------- */
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

@media (prefers-reduced-motion: reduce) {
  .marquee {
    animation: none;
  }
}

:root[data-theme="light"] .logorail .fx-invert {
  filter: grayscale(1);
}

.nav__menu {
  backdrop-filter: blur(14px);
}

:root[data-theme="dark"] .fx-theme-invert {
  filter: invert(1);
}
