/* ============================================================================
   Crypto Signal Lab — shared site design system
   Local-first: no CDN, no webfont fetch, no tracking. Works offline.
   ========================================================================= */

:root {
  color-scheme: dark;

  /* Surfaces */
  --bg: #050d15;
  --bg-soft: #0a1621;
  --bg-deep: #030a11;
  --surface: rgba(15, 29, 42, 0.72);
  --surface-strong: #10202e;
  --surface-muted: #16293a;
  --border: rgba(157, 205, 255, 0.14);
  --border-strong: rgba(157, 205, 255, 0.3);

  /* Ink */
  --text: #eef8ff;
  --text-dim: #c6d8e6;
  --muted: #8ba4b8;
  --faint: #70899c;

  /* Accents */
  --cyan: #43e7f3;
  --cyan-soft: rgba(67, 231, 243, 0.13);
  --violet: #aa8cff;
  --violet-soft: rgba(170, 140, 255, 0.14);
  --lime: #a6f36f;
  --lime-soft: rgba(166, 243, 111, 0.13);
  --amber: #ffc85c;
  --amber-soft: rgba(255, 200, 92, 0.14);
  --red: #ff758d;
  --red-soft: rgba(255, 117, 141, 0.14);
  --blue: #78a9ff;
  --blue-soft: rgba(120, 169, 255, 0.14);

  /* Geometry */
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  --shadow-lg: 0 32px 90px rgba(0, 0, 0, 0.55);
  --shadow-md: 0 18px 46px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 6px 20px rgba(0, 0, 0, 0.28);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --maxw: 1180px;
  --nav-h: 64px;

  --font-sans: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, ui-sans-serif, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "SF Mono", ui-monospace, "JetBrains Mono",
    Menlo, Consolas, monospace;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #eef4f8;
  --bg-soft: #e3edf3;
  --bg-deep: #f7fafc;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-strong: #ffffff;
  --surface-muted: #eaf2f6;
  --border: rgba(24, 62, 84, 0.14);
  --border-strong: rgba(24, 62, 84, 0.28);
  --text: #0d2432;
  --text-dim: #23485c;
  --muted: #4f6b7c;
  --faint: #7690a1;
  --cyan: #007f90;
  --cyan-soft: rgba(0, 127, 144, 0.1);
  --violet: #6550c8;
  --violet-soft: rgba(101, 80, 200, 0.1);
  --lime: #35771f;
  --lime-soft: rgba(53, 119, 31, 0.1);
  --amber: #8d6100;
  --amber-soft: rgba(141, 97, 0, 0.1);
  --red: #bc3653;
  --red-soft: rgba(188, 54, 83, 0.1);
  --blue: #2f61bd;
  --blue-soft: rgba(47, 97, 189, 0.1);
  --shadow-lg: 0 28px 70px rgba(37, 71, 92, 0.16);
  --shadow-md: 0 16px 40px rgba(37, 71, 92, 0.12);
  --shadow-sm: 0 4px 14px rgba(37, 71, 92, 0.1);
}

/* --------------------------------------------------------------------- base */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 20px);
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

a {
  color: var(--cyan);
  text-decoration: none;
  transition: color 0.18s var(--ease);
}
a:hover {
  color: var(--text);
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 640;
  letter-spacing: -0.032em;
  line-height: 1.12;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

code,
kbd,
pre {
  font-family: var(--font-mono);
  font-size: 0.87em;
}

::selection {
  background: var(--cyan);
  color: #04121a;
}

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

/* --------------------------------------------------------------- background */

.aurora {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 60% at 50% -14%, rgba(67, 231, 243, 0.13), transparent 62%),
    radial-gradient(ellipse 70% 50% at 88% 12%, rgba(170, 140, 255, 0.12), transparent 60%),
    radial-gradient(ellipse 80% 55% at 6% 42%, rgba(120, 169, 255, 0.09), transparent 60%),
    linear-gradient(180deg, var(--bg-deep), var(--bg) 34%, var(--bg-soft));
}

.aurora::after {
  content: "";
  position: absolute;
  inset: -40%;
  background:
    conic-gradient(from 210deg at 32% 28%, transparent, rgba(67, 231, 243, 0.1), transparent 42%),
    conic-gradient(from 20deg at 74% 62%, transparent, rgba(170, 140, 255, 0.09), transparent 40%);
  filter: blur(70px);
  animation: drift 44s linear infinite;
}

@keyframes drift {
  0% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(180deg) scale(1.12);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}

.grid-veil {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(157, 205, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(157, 205, 255, 0.045) 1px, transparent 1px);
  background-size: 62px 62px;
  mask-image: radial-gradient(ellipse 78% 62% at 50% 26%, #000 12%, transparent 76%);
  -webkit-mask-image: radial-gradient(ellipse 78% 62% at 50% 26%, #000 12%, transparent 76%);
}

/* ------------------------------------------------------------------ layout */

.wrap {
  width: min(100% - 44px, var(--maxw));
  margin-inline: auto;
}

.wrap-wide {
  width: min(100% - 44px, 1320px);
  margin-inline: auto;
}

section {
  position: relative;
  padding-block: clamp(64px, 8.5vw, 132px);
}

.section-head {
  max-width: 720px;
  margin-bottom: clamp(34px, 4.5vw, 60px);
}

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 16px;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.section-head.center .eyebrow::before {
  display: none;
}

h2.title {
  font-size: clamp(28px, 4.1vw, 47px);
}

.lede {
  margin-top: 18px;
  font-size: clamp(15.5px, 1.35vw, 18.5px);
  color: var(--muted);
  line-height: 1.62;
}

/* ------------------------------------------------------------------- chrome */

.nav {
  position: sticky;
  top: 0;
  z-index: 90;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  background: color-mix(in srgb, var(--bg) 74%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}

.nav.is-stuck {
  border-bottom-color: var(--border);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  width: min(100% - 44px, 1320px);
  margin-inline: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-weight: 620;
  font-size: 15px;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

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

.mark {
  position: relative;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  background: linear-gradient(145deg, rgba(67, 231, 243, 0.9), rgba(170, 140, 255, 0.85));
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 1px rgba(157, 205, 255, 0.28), 0 8px 22px rgba(67, 231, 243, 0.22);
}

.mark svg {
  width: 17px;
  height: 17px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
}

.nav-links a {
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 480;
  transition: color 0.18s var(--ease), background 0.18s var(--ease);
}

.nav-links a:hover {
  color: var(--text);
  background: var(--cyan-soft);
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 9px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 19px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 540;
  letter-spacing: -0.015em;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease),
    background 0.2s var(--ease), box-shadow 0.2s var(--ease), color 0.2s var(--ease);
}

.btn:hover {
  transform: translateY(-2px);
  border-color: var(--cyan);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

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

.btn.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--cyan), #7cd8ff 46%, var(--violet));
  color: #041019;
  font-weight: 620;
  box-shadow: 0 10px 30px rgba(67, 231, 243, 0.24);
}

[data-theme="light"] .btn.primary {
  color: #ffffff;
  background: linear-gradient(135deg, #007f90, #2f61bd 52%, #6550c8);
}

.btn.primary:hover {
  box-shadow: 0 16px 42px rgba(67, 231, 243, 0.34);
  color: #041019;
}

[data-theme="light"] .btn.primary:hover {
  color: #ffffff;
}

.btn.ghost {
  background: transparent;
  border-color: var(--border);
}

.btn.lg {
  padding: 14px 26px;
  font-size: 15px;
}

.btn.icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 11px;
}

.btn.icon svg {
  width: 16px;
  height: 16px;
}

/* -------------------------------------------------------------------- chips */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.03em;
  color: var(--text-dim);
  white-space: nowrap;
}

.chip .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lime);
  flex: none;
}

.chip.cyan {
  color: var(--cyan);
  border-color: color-mix(in srgb, var(--cyan) 34%, transparent);
  background: var(--cyan-soft);
}
.chip.violet {
  color: var(--violet);
  border-color: color-mix(in srgb, var(--violet) 34%, transparent);
  background: var(--violet-soft);
}
.chip.lime {
  color: var(--lime);
  border-color: color-mix(in srgb, var(--lime) 34%, transparent);
  background: var(--lime-soft);
}
.chip.amber {
  color: var(--amber);
  border-color: color-mix(in srgb, var(--amber) 34%, transparent);
  background: var(--amber-soft);
}
.chip.red {
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 34%, transparent);
  background: var(--red-soft);
}
.chip.blue {
  color: var(--blue);
  border-color: color-mix(in srgb, var(--blue) 34%, transparent);
  background: var(--blue-soft);
}

/* -------------------------------------------------------------------- cards */

.card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 26px;
  overflow: hidden;
  transition: border-color 0.28s var(--ease), transform 0.28s var(--ease),
    box-shadow 0.28s var(--ease);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    420px circle at var(--mx, 50%) var(--my, 0%),
    rgba(67, 231, 243, 0.09),
    transparent 62%
  );
  opacity: 0;
  transition: opacity 0.32s var(--ease);
  pointer-events: none;
}

.card.interactive:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.card.interactive:hover::before {
  opacity: 1;
}

.card h3 {
  font-size: 18.5px;
  letter-spacing: -0.024em;
}

.card p {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.62;
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
}

.card-icon svg {
  width: 19px;
  height: 19px;
}

/* --------------------------------------------------------------------- code */

.terminal {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(3, 10, 17, 0.72);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

[data-theme="light"] .terminal {
  background: #0a1621;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(157, 205, 255, 0.12);
  background: rgba(157, 205, 255, 0.04);
}

.terminal-bar i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(157, 205, 255, 0.24);
}
.terminal-bar i:nth-child(1) {
  background: #ff5f57;
}
.terminal-bar i:nth-child(2) {
  background: #febc2e;
}
.terminal-bar i:nth-child(3) {
  background: #28c840;
}

.terminal-bar span {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #8ba4b8;
  letter-spacing: 0.04em;
}

.terminal pre {
  margin: 0;
  padding: 16px 18px;
  font-size: 12.6px;
  line-height: 1.75;
  color: #d7e8f4;
  overflow-x: auto;
  white-space: pre;
  tab-size: 2;
}

.terminal .c-prompt {
  color: var(--cyan);
}
.terminal .c-flag {
  color: var(--violet);
}
.terminal .c-str {
  color: var(--lime);
}
.terminal .c-com {
  color: #70899c;
}
.terminal .c-ok {
  color: var(--lime);
}
.terminal .c-warn {
  color: var(--amber);
}

/* ------------------------------------------------------------ reveal system */

[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.72s var(--ease-out), transform 0.72s var(--ease-out);
  transition-delay: var(--d, 0ms);
  will-change: opacity, transform;
}

[data-reveal].in {
  opacity: 1;
  transform: none;
}

[data-reveal="scale"] {
  transform: translateY(26px) scale(0.975);
}
[data-reveal="scale"].in {
  transform: none;
}

[data-reveal="left"] {
  transform: translateX(-26px);
}
[data-reveal="left"].in {
  transform: none;
}

[data-reveal="right"] {
  transform: translateX(26px);
}
[data-reveal="right"].in {
  transform: none;
}

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

.footer {
  border-top: 1px solid var(--border);
  padding-block: 52px 40px;
  background: color-mix(in srgb, var(--bg-deep) 60%, transparent);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 34px;
}

.footer h3,
.footer h5 {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 620;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 9px;
}

.footer ul a {
  color: var(--muted);
  font-size: 14px;
}
.footer ul a:hover {
  color: var(--text);
}

.footer-note {
  margin-top: 38px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--faint);
}

/* --------------------------------------------------------------- utilities */

.mono {
  font-family: var(--font-mono);
}
.center {
  text-align: center;
}
.muted {
  color: var(--muted);
}
.nowrap {
  white-space: nowrap;
}

.grad-text {
  background: linear-gradient(102deg, var(--cyan) 4%, #9fd6ff 42%, var(--violet) 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hr {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
  margin: 0;
}

/* -------------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
}

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

@media (max-width: 940px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .nav-links {
    display: none;
  }
  .nav-inner {
    gap: 12px;
  }
  .nav-cta {
    margin-left: auto;
  }
  .nav-cta .btn:not(.icon) {
    padding: 9px 13px;
    font-size: 12.5px;
  }
  .brand {
    font-size: 13.5px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .wrap,
  .wrap-wide {
    width: calc(100% - 32px);
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 26px;
  }
}

@media (max-width: 400px) {
  .nav-cta .btn:not(.icon) {
    display: none;
  }
}
