/* ==========================================================================
   KAPM / Dragon Lab — design tokens
   ========================================================================== */

:root {
  --bg: #05060a;
  --bg-alt: #0b0d14;
  --card: #11141f;

  --accent: #ff6a2e;
  --accent-soft: #ff9a4b;
  --accent-blue: #2ea8ff;
  --accent-blue-soft: #7cc9ff;
  --green: #3dd68c;

  --text: #f5f7ff;
  --muted: #9aa0c2;
  --muted-soft: #6d7295;

  --border: #1b2030;
  --border-soft: rgba(255, 255, 255, 0.08);

  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.55);
  --shadow-card: 0 20px 50px rgba(0, 0, 0, 0.45);

  --radius-xl: 22px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --ease: cubic-bezier(0.16, 0.84, 0.44, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --transition: 200ms var(--ease);

  --header-h: 116px;
  --header-h-scrolled: 84px;

  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", var(--font-sans);
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;

  color-scheme: dark;
}

/* ==========================================================================
   Base / reset
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
}

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

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
}

body {
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 14% -8%, rgba(46, 168, 255, 0.1), transparent 42%),
    radial-gradient(circle at 92% 2%, rgba(255, 106, 46, 0.08), transparent 40%),
    radial-gradient(circle at top, #15192a 0, #05060a 55%);
}

/* Fine film-grain overlay — a cheap, image-free texture that keeps large flat
   dark panels from reading as "digital-flat"; imperceptible on its own. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

header,
main,
footer {
  position: relative;
  z-index: 1;
}

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

::selection {
  background: rgba(255, 106, 46, 0.35);
  color: #fff;
}

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

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: #262c42;
  border-radius: 999px;
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: #333c5c;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.4rem;
}

.section {
  position: relative;
  padding: clamp(3.2rem, 6vw, 5.5rem) 0;
  scroll-margin-top: calc(var(--header-h) + 10px);
}

.section-alt {
  background: radial-gradient(circle at top left, #14182a 0, #05060a 62%);
}

.section-alt::before,
.section-alt::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-soft) 50%, transparent);
}

.section-alt::before {
  top: 0;
}

.section-alt::after {
  bottom: 0;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-blue-soft);
  margin-bottom: 0.8rem;
}

.kicker::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--accent-blue-soft);
  opacity: 0.75;
}

.section h2 {
  font-size: clamp(1.55rem, 2.6vw, 2.05rem);
  margin: 0 0 0.7rem;
}

.section-lead {
  max-width: 640px;
  color: var(--muted);
  margin: 0 auto 1.7rem;
  font-size: 1.02rem;
}

/* Modern-tech convention: every section opens on a centered intro block —
   kicker, headline, lead — rather than a left-anchored one. */
.section-head {
  max-width: 720px;
  margin: 0 auto clamp(2.2rem, 4vw, 3.2rem);
  text-align: center;
}

.section-head .section-lead {
  margin-bottom: 0;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-h);
  display: flex;
  align-items: center;
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  background: rgba(5, 6, 10, 0.72);
  border-bottom: 1px solid transparent;
  transition: height 260ms var(--ease), background 260ms var(--ease),
    border-color 260ms var(--ease), box-shadow 260ms var(--ease);
}

.site-header.is-scrolled {
  height: var(--header-h-scrolled);
  background: rgba(5, 6, 10, 0.92);
  border-bottom-color: var(--border-soft);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

/* Grid, not space-between flex — a 1fr/auto/1fr track keeps the nav links
   genuinely centered in the header regardless of how wide the logo or the
   language-select + Contact button happen to be, matching the modern
   logo-left / nav-center / actions-right convention. */
.nav-container {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  gap: 1rem;
}

.logo-link {
  display: flex;
  align-items: center;
  justify-self: start;
}

.logo-img {
  height: 92px;
  width: auto;
  filter: drop-shadow(0 0 14px rgba(46, 168, 255, 0.18));
  transition: height 260ms var(--ease);
}

.site-header.is-scrolled .logo-img {
  height: 68px;
}

.nav {
  display: flex;
  gap: 1.6rem;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 500;
}

.nav a {
  position: relative;
  color: var(--muted);
  text-decoration: none;
  padding: 0.3rem 0.05rem;
  transition: color var(--transition);
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -2px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent));
  transition: right 280ms var(--ease);
}

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

.nav a:hover::after {
  right: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-self: end;
}

.language-select {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.language-select label {
  font-size: 0.9rem;
  opacity: 0.85;
}

.language-select select {
  appearance: none;
  -webkit-appearance: none;
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-soft);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  padding: 0.32rem 1.7rem 0.32rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 55%, calc(100% - 9px) 55%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.language-select select:hover,
.language-select select:focus-visible {
  border-color: var(--accent-blue);
}

.language-select select option {
  background: var(--bg-alt);
  color: var(--text);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.68rem 1.35rem;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: transform 220ms var(--ease), box-shadow 220ms var(--ease),
    background 220ms var(--ease), border-color 220ms var(--ease), color 220ms var(--ease);
}

.btn-sm {
  padding: 0.42rem 0.95rem;
  font-size: 0.82rem;
}

.btn .btn-icon {
  display: inline-flex;
  transition: transform 220ms var(--ease);
}

.btn:hover .btn-icon {
  transform: translateX(3px);
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  color: #17090b;
  box-shadow: 0 10px 26px rgba(255, 106, 46, 0.3);
}

.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(255, 106, 46, 0.42);
}

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

.btn.ghost {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  border-color: var(--border-soft);
}

.btn.ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.24);
  transform: translateY(-2px);
}

/* ==========================================================================
   Hero — DragonAI decision network as the full-section background
   ========================================================================== */

.hero-split {
  position: relative;
  overflow: hidden;
  min-height: min(72vh, 640px);
  padding: 2.4rem 0 2.8rem;
}

.hero-network-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-network-bg canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* A centered radial vignette rather than a left-to-right wash — the hero
   copy now sits centered over the network, so it needs a dark pool behind
   the middle of the section with the network still visible at the edges. */
.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(
    ellipse 62% 68% at 50% 42%,
    rgba(5, 6, 10, 0.93) 0%,
    rgba(5, 6, 10, 0.78) 45%,
    rgba(5, 6, 10, 0.4) 78%,
    rgba(5, 6, 10, 0.2) 100%
  );
  pointer-events: none;
}

/* Soft fade at the foot of the hero so it dissolves into the next section
   rather than cutting off hard against the network background. */
.hero-split::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 110px;
  z-index: 1;
  background: linear-gradient(180deg, transparent, var(--bg));
  pointer-events: none;
}

.hero-split-inner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: inherit;
}

.hero-split-text {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.36rem 0.85rem 0.36rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(46, 168, 255, 0.28);
  background: rgba(46, 168, 255, 0.07);
  color: var(--accent-blue-soft);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin-bottom: 1.15rem;
}

.hero-eyebrow .pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-blue);
  animation: pulse-ring 2.2s ease-out infinite;
}

@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(46, 168, 255, 0.55);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(46, 168, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(46, 168, 255, 0);
  }
}

.hero-split-text h1 {
  font-size: clamp(2.15rem, 3.6vw, 3.05rem);
  line-height: 1.1;
  margin: 0 0 0.9rem;
}

.hero-split-text p {
  color: var(--muted);
  margin: 0 auto 1.6rem;
  max-width: 560px;
  font-size: 1.03rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 2rem;
}

.hero-caps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}

.hero-cap {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  font-size: 0.78rem;
  color: var(--muted);
  padding: 0.42rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.02);
}

.hero-cap svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  color: var(--accent-blue-soft);
}

/* Entrance animation — pure CSS so it can never flash unstyled content while
   waiting for GSAP to load, and degrades cleanly with no JS at all. */
.hero-reveal {
  opacity: 0;
  transform: translateY(16px);
  animation: hero-in 0.85s var(--ease-out) forwards;
}

.hero-eyebrow.hero-reveal {
  animation-delay: 0.05s;
}

h1.hero-reveal {
  animation-delay: 0.16s;
}

.hero-split-text > p.hero-reveal {
  animation-delay: 0.3s;
}

.hero-actions.hero-reveal {
  animation-delay: 0.42s;
}

.hero-caps.hero-reveal {
  animation-delay: 0.54s;
}

@keyframes hero-in {
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-reveal {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* ==========================================================================
   Cards & grids
   ========================================================================== */

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
}

.card {
  background: linear-gradient(160deg, #12162599, #0a0c1599);
  background-color: #0d1020;
  border-radius: var(--radius-lg);
  padding: 1.7rem 1.5rem;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-card);
  text-align: center;
  transition: transform 280ms var(--ease), border-color 280ms var(--ease),
    box-shadow 280ms var(--ease);
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.5);
}

.icon-badge {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  margin: 0 auto 1.1rem;
}

.icon-badge svg {
  width: 20px;
  height: 20px;
}

.icon-badge.blue {
  background: rgba(46, 168, 255, 0.12);
  color: var(--accent-blue);
}

.icon-badge.orange {
  background: rgba(255, 106, 46, 0.12);
  color: var(--accent);
}

.icon-badge.green {
  background: rgba(61, 214, 140, 0.12);
  color: var(--green);
}

.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.02rem;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* At a Glance */

.at-a-glance {
  margin: 2.4rem auto 0;
  max-width: 900px;
  padding: 1.35rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.015);
  text-align: center;
}

.at-a-glance h3 {
  margin: 0 0 0.85rem;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--font-mono);
}

.at-a-glance ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.8rem 1.5rem;
}

.at-a-glance li {
  padding: 0;
  font-size: 0.92rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.18rem;
}

.at-a-glance li strong {
  color: var(--muted-soft);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

.at-a-glance li span {
  color: var(--text);
  font-weight: 500;
}

/* ==========================================================================
   Dragon Lab — stacked, centered feature blocks (modern-tech convention:
   a centered intro, then a rhythm of centered content blocks, rather than
   a persistent left/right split)
   ========================================================================== */

.feature-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(2rem, 4vw, 2.8rem);
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.feature-stack-wide {
  max-width: 780px;
}

.feature-block {
  width: 100%;
}

.feature-block h3,
.highlight-card h3 {
  font-size: 1.08rem;
  margin: 0 0 0.6rem;
}

.feature-block p {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
}

.highlight-card {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 620px;
  background: radial-gradient(circle at top, #181c30 0, #05060a 65%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  padding: 1.8rem 1.7rem;
  text-align: center;
}

.highlight-card::before {
  content: "";
  position: absolute;
  top: -35%;
  right: -18%;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(255, 106, 46, 0.16), transparent 70%);
  pointer-events: none;
}

.highlight-tag {
  position: relative;
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(255, 106, 46, 0.1);
  border: 1px solid rgba(255, 106, 46, 0.28);
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.highlight-card p {
  position: relative;
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

/* Checklist — a centered, wrapped row of check-badge + label pairs, rather
   than a left-aligned vertical list, to match the centered content rhythm. */

.checklist {
  list-style: none;
  padding: 0;
  margin: 0.9rem 0 0;
  font-size: 0.92rem;
  color: var(--text);
  display: flex;
  flex-flow: row wrap;
  justify-content: center;
  gap: 0.6rem 1.4rem;
}

.checklist li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.checklist li::before {
  content: "\2713";
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  border-radius: 50%;
  background: rgba(61, 214, 140, 0.14);
  color: var(--green);
}

/* ==========================================================================
   Dashboard / Code‑Dragon
   ========================================================================== */

.dash-preview {
  width: 100%;
  background: radial-gradient(circle at top, #181c30 0, #05060a 60%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  text-align: left;
  transition: box-shadow 320ms var(--ease), border-color 320ms var(--ease);
}

.dash-preview:hover {
  border-color: rgba(46, 168, 255, 0.22);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(46, 168, 255, 0.06);
}

.dash-copy {
  width: 100%;
  max-width: 620px;
}

/* Dashboard bar — macOS-style window chrome, purely decorative UI framing */

.dash-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 0.95rem;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.015);
}

.dash-bar .traffic {
  display: flex;
  gap: 0.4rem;
}

.dash-bar .traffic span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: block;
}

.dash-bar .traffic .r {
  background: #ff5f57;
}

.dash-bar .traffic .a {
  background: #febc2e;
}

.dash-bar .traffic .g {
  background: #28c840;
}

.dash-bar .dash-label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--font-mono);
  margin-left: 0.3rem;
}

.dash-bar .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 9px var(--green);
  margin-left: auto;
  animation: status-pulse 2.4s ease-in-out infinite;
}

@keyframes status-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

/* Methodology slideshow — formulas, decision gate, illustrative uptrend charts.
   All notation is symbolic / illustrative — deliberately not the live
   strategy's real parameters. */

.dash-body {
  padding: 0;
}

.slideshow {
  position: relative;
  min-height: 380px;
  overflow: hidden;
}

.slide {
  position: absolute;
  inset: 1rem 1.1rem 3rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.6rem;
  opacity: 0;
  transform: scale(0.985) translateY(8px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
  pointer-events: none;
}

.slide.is-active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.slide-head {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.slide-note {
  margin: 0;
  font-size: 0.76rem;
  color: var(--muted);
}

/* Formula list */

.formula-list {
  display: grid;
  gap: 0.4rem;
}

.formula {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.4rem 0.7rem;
  background: rgba(255, 255, 255, 0.03);
  border-left: 2px solid var(--accent-blue);
  border-radius: var(--radius-sm);
  transition: background 220ms var(--ease), border-color 220ms var(--ease);
}

.formula:hover {
  background: rgba(255, 255, 255, 0.05);
  border-left-color: var(--accent-blue-soft);
}

.formula .f-label {
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.formula .f-math {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text);
}

.formula .f-math.f-sub {
  font-size: 0.76rem;
  color: var(--muted);
}

.formula .f-math sub {
  font-size: 0.7em;
}

/* Decision-gate flow */

.gate-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.3rem;
}

.gate-node {
  display: inline-block;
  padding: 0.32rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.78rem;
  white-space: nowrap;
  transition: border-color 220ms var(--ease), background 220ms var(--ease);
}

.gate-node.in {
  border-color: var(--accent-blue);
  color: #cfe9ff;
}

.gate-node.out {
  border-color: var(--green);
  color: #c9f5df;
}

.gate-node.aside {
  border-style: dashed;
  border-color: var(--accent);
  color: #ffd6c2;
}

.gate-arrow {
  color: var(--muted);
  font-size: 0.9rem;
}

.gate-offramp {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: 1.3rem;
}

/* Illustrative charts */

.slide-chart-wrap {
  flex: 1;
  min-height: 130px;
  display: flex;
}

.slide-chart {
  width: 100%;
  height: 100%;
}

.slide-chart .grid-line {
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 1;
}

.slide-chart .area {
  fill: url(#priceFill);
}

.slide-chart .price {
  fill: none;
  stroke: var(--text);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.slide-chart .ma-fast {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.4;
  opacity: 0.9;
}

.slide-chart .ma-slow {
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.4;
  opacity: 0.65;
}

.slide-chart .cone {
  fill: rgba(255, 106, 46, 0.14);
  stroke: rgba(255, 106, 46, 0.5);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.slide-chart .cone-b {
  fill: rgba(46, 168, 255, 0.12);
  stroke: none;
}

.slide-chart .proj {
  fill: none;
  stroke-width: 1.3;
  stroke-dasharray: 4 3;
}

.slide-chart .mk-entry {
  fill: var(--green);
}

.slide-chart .mk-exit {
  fill: var(--accent);
}

.slide-chart .regime-band {
  fill: rgba(61, 214, 140, 0.06);
}

.slide-chart .regime-label {
  fill: var(--green);
  font-size: 9px;
  letter-spacing: 0.12em;
  font-family: var(--font-mono);
}

.slide-chart .draw {
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
}

.slide.is-active .slide-chart .draw {
  animation: chart-draw 1.6s ease forwards;
}

@keyframes chart-draw {
  to {
    stroke-dashoffset: 0;
  }
}

/* Auto-advance progress bar — a CSS keyframe animation (not a JS timer) so it
   can be paused/resumed natively via animation-play-state on hover. */

.slide-progress {
  position: absolute;
  left: 1.1rem;
  right: 1.1rem;
  bottom: 2.15rem;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.slide-progress-fill {
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--accent-blue), var(--accent));
  border-radius: 2px;
  animation-name: progress-fill;
  animation-duration: 6.5s;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
  animation-play-state: paused;
}

.slide-progress-fill.running {
  animation-play-state: running;
}

@keyframes progress-fill {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

/* Carousel dots */

.slide-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.9rem;
  display: flex;
  justify-content: center;
  gap: 0.4rem;
}

.slide-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.slide-dot.is-active {
  background: var(--accent);
  transform: scale(1.3);
}

@media (prefers-reduced-motion: reduce) {
  .slide {
    transition: none;
  }

  .slide.is-active .slide-chart .draw {
    animation: none;
  }

  .slide-chart .draw {
    stroke-dashoffset: 0;
  }

  .slide-progress-fill {
    animation: none;
  }
}

@media (max-width: 900px) {
  .slideshow {
    min-height: 400px;
  }

  .formula .f-math {
    font-size: 0.8rem;
  }
}

/* ==========================================================================
   Contact
   ========================================================================== */

.contact-card {
  margin: 1.2rem auto 0;
  padding: 1.9rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
  background: radial-gradient(circle at top left, #14182a 0, #0a0c15 70%);
  box-shadow: var(--shadow-card);
  max-width: 620px;
  text-align: center;
}

.contact-card .section-lead {
  margin-bottom: 1.4rem;
}

.contact-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.1rem;
}

.contact-email {
  color: var(--muted);
  font-size: 0.9rem;
}

.contact-email strong {
  color: var(--text);
  font-weight: 500;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  position: relative;
  border-top: 1px solid var(--border-soft);
  padding: 1.5rem 0 1.7rem;
  background: var(--bg);
}

.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(46, 168, 255, 0.35),
    rgba(255, 106, 46, 0.35),
    transparent
  );
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-split {
    min-height: 52vh;
  }
}

@media (max-width: 860px) {
  .site-header {
    height: auto;
  }

  .site-header.is-scrolled {
    height: auto;
  }

  .nav-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    row-gap: 0.7rem;
    padding: 0.75rem 0;
  }

  .logo-img,
  .site-header.is-scrolled .logo-img {
    height: 60px;
  }

  .nav {
    order: 3;
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1rem;
    padding-top: 0.6rem;
    margin-top: 0.15rem;
    border-top: 1px solid var(--border-soft);
    font-size: 0.86rem;
  }

  .header-actions {
    gap: 0.7rem;
  }
}
