/* AvidQuant foundation: the one design system for avidquant.com,
   optiondesk.avidquant.com and riskdesk.avidquant.com.
   Each site serves its own copy of this file and of the two Geist fonts.
   Structure comes from type, space and hairlines. No card grids, no boxed
   sections. One framed product view per page at most. */

@font-face {
  font-family: "Geist";
  src: url("fonts/geist-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("fonts/geist-mono-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --ground: #08090a;
  --ground-raised: #0e0f11;
  --ground-sunken: #050506;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f2f3f5;
  --text-muted: #8a8f98;
  --text-faint: #6b717c;
  --accent: #8ab4ff;
  --signal: #e2e800;
  --signal-ink: #000000;
  --loss: #ff6b6b;
  --gain: #3ddc84;
  --synthetic: #c4b5fd;
  --synthetic-ground: rgba(196, 181, 253, 0.1);
  --degraded: #fdba74;
  --degraded-ground: rgba(253, 186, 116, 0.1);
  --glow-a: rgba(59, 91, 219, 0.22);
  --glow-b: rgba(124, 77, 255, 0.12);

  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --page: 72rem;
  --narrow: 44rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section: clamp(5rem, 10vw, 8.5rem);
  --radius: 14px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --ground: #ffffff;
    --ground-raised: #f7f7f8;
    --ground-sunken: #f1f1f3;
    --line: rgba(0, 0, 0, 0.08);
    --line-strong: rgba(0, 0, 0, 0.16);
    --text: #0b0c0e;
    --text-muted: #5b616b;
    --text-faint: #6e747e;
    --accent: #1d4ed8;
    --signal: #5c5f00;
    --signal-ink: #ffffff;
    --loss: #c81e1e;
    --gain: #15803d;
    --synthetic: #5b21b6;
    --synthetic-ground: rgba(91, 33, 182, 0.08);
    --degraded: #9a3412;
    --degraded-ground: rgba(154, 52, 18, 0.08);
    --glow-a: rgba(59, 91, 219, 0.1);
    --glow-b: rgba(124, 77, 255, 0.06);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  scrollbar-color: var(--line-strong) var(--ground);
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  font-feature-settings: "ss01", "cv11";
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--accent);
  color: var(--ground);
}

h1,
h2,
h3,
h4,
p,
dl,
dd,
ul,
ol,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

.prose a,
a.link {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
  transition: text-decoration-color 0.2s var(--ease);
}

.prose a:hover,
a.link:hover {
  text-decoration-color: var(--text);
}

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

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

.wrap {
  width: min(100% - 2 * var(--gutter), var(--page));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 50;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: var(--text);
  color: var(--ground);
  font-weight: 500;
}

.skip:focus {
  top: 0.75rem;
}

/* ---- Header ---- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--ground) 72%, transparent);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 3.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  font-size: 0.975rem;
  letter-spacing: -0.01em;
}

.brand svg {
  width: 1.375rem;
  height: 1.375rem;
  flex: none;
}

.brand-sep {
  color: var(--line-strong);
  font-weight: 300;
}

.brand-product {
  font-weight: 500;
  color: var(--text);
}

.site-nav {
  margin-left: auto;
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: clamp(0.25rem, 1.2vw, 0.75rem);
}

.site-nav a {
  display: inline-block;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.875rem;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}

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

.site-nav a.nav-cta {
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.site-nav a.nav-cta:hover {
  background: var(--ground-raised);
}

/* ---- Buttons ---- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.65rem 1.2rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}

.button:hover {
  background: var(--ground-raised);
}

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

.button--primary {
  background: var(--text);
  color: var(--ground);
  box-shadow: none;
}

.button--primary:hover {
  background: color-mix(in srgb, var(--text) 86%, var(--ground));
}

.button svg {
  width: 0.95rem;
  height: 0.95rem;
  flex: none;
  transition: transform 0.25s var(--ease);
}

.button:hover svg {
  transform: translate(2px, -2px);
}

/* ---- Type scale ---- */

.display {
  font-size: clamp(2.5rem, 1.2rem + 5vw, 4.75rem);
  line-height: 1.02;
  font-weight: 600;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.title {
  font-size: clamp(1.875rem, 1.2rem + 2.4vw, 3rem);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.subtitle {
  font-size: clamp(1.25rem, 1.05rem + 0.7vw, 1.5rem);
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.lede {
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  line-height: 1.55;
  color: var(--text-muted);
  text-wrap: pretty;
}

.label {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  text-transform: uppercase;
}

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

/* ---- Sections ---- */

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

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

.section-head {
  max-width: 40rem;
}

.section-head .lede {
  margin-top: 1rem;
}

/* Hairline lists: the replacement for card grids. */
.rule-list > li,
.rule-list > div {
  border-top: 1px solid var(--line);
}

.rule-list > li:last-child,
.rule-list > div:last-child {
  border-bottom: 1px solid var(--line);
}

/* ---- Flags ---- */

.flag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--synthetic-ground);
  color: var(--synthetic);
}

.flag::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: currentColor;
}

.flag--degraded {
  background: var(--degraded-ground);
  color: var(--degraded);
}

/* ---- The one framed product view ---- */

.screen {
  position: relative;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--ground-raised), var(--ground));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 0 1px var(--line), 0 40px 120px -40px var(--glow-a);
}

/* ---- Forms ---- */

.field {
  display: grid;
  gap: 0.45rem;
}

.field > span {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.8rem 0.95rem;
  border: 0;
  border-radius: 10px;
  background: var(--ground-raised);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  transition: box-shadow 0.2s var(--ease);
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 1px var(--text), 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent);
}

.field textarea {
  min-height: 10rem;
  resize: vertical;
}

/* ---- Footer: the same on all three sites ---- */

.site-footer {
  padding-block: 3.5rem 4rem;
  border-top: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.site-footer .wrap {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 2rem 4rem;
}

.footer-note p {
  max-width: 64ch;
}

.footer-note p + p {
  margin-top: 0.85rem;
}

.footer-note strong {
  color: var(--text);
  font-weight: 500;
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 2rem;
  align-content: start;
}

.footer-nav li + li {
  margin-top: 0.5rem;
}

.site-footer a {
  color: var(--text-muted);
  transition: color 0.2s var(--ease);
}

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

@media (max-width: 48rem) {
  .site-footer .wrap {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-nav .nav-hide-small {
    display: none;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
