/* ============================================================
   QuantWise Research — Design System v1.0
   Palette: Ink navy foundation · Signal amber · Quant teal
   Type:    Space Grotesk (display) · Inter (body) · IBM Plex Mono (labels/data)
   ============================================================ */

/* ---------- 1. Tokens ---------- */
:root {
  /* Color */
  --ink:        #0D1530;   /* page-dark background */
  --ink-2:      #16204A;   /* elevated surface on dark */
  --ink-3:      #1E2B5E;   /* borders / hover on dark */
  --paper:      #F6F7FA;   /* page-light background */
  --white:      #FFFFFF;
  --line:       #E3E7F0;   /* borders on light */
  --amber:      #F5A300;   /* primary signal / CTA — matches logo wordmark */
  --amber-deep: #D98C00;   /* hover */
  --orange:     #F26310;   /* logo Q gradient start — reserved for gradient accents */
  --teal:       #2DD4BF;   /* secondary / data accent */
  --teal-deep:  #14B8A6;
  --text:       #1B2340;   /* body on light */
  --text-soft:  #545E7E;   /* secondary on light */
  --text-inv:   #EDF0F7;   /* body on dark */
  --text-inv-soft: #9AA5C4;

  /* Type */
  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body:    "Inter", "Segoe UI", sans-serif;
  --font-mono:    "IBM Plex Mono", Consolas, monospace;

  /* Scale (fluid) */
  --fs-hero:  clamp(2.4rem, 5.5vw, 4.2rem);
  --fs-h2:    clamp(1.8rem, 3.4vw, 2.6rem);
  --fs-h3:    clamp(1.15rem, 2vw, 1.35rem);
  --fs-body:  1rem;
  --fs-small: 0.875rem;
  --fs-label: 0.8125rem;

  /* Rhythm */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6.5rem;
  --radius:    12px;
  --radius-lg: 20px;
  --container: 1160px;

  --shadow: 0 8px 30px rgba(13, 21, 48, 0.10);
  --transition: 180ms ease;
}

/* ---------- 2. Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 var(--space-2);
}

h1 { font-size: var(--fs-hero); font-weight: 700; }
h2 { font-size: var(--fs-h2);   font-weight: 700; }
h3 { font-size: var(--fs-h3);   font-weight: 600; }

p { margin: 0 0 var(--space-2); }

a { color: var(--teal-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

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

::selection { background: var(--amber); color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ---------- 3. Layout primitives ---------- */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-3);
}

.section       { padding-block: var(--space-6); }
.section--tight{ padding-block: var(--space-5); }

.section--dark {
  background: var(--ink);
  color: var(--text-inv);
}
.section--dark h1, .section--dark h2, .section--dark h3 { color: var(--white); }
.section--dark p { color: var(--text-inv-soft); }

/* dotted data-grid texture for dark sections */
.grid-bg {
  background-image: radial-gradient(rgba(154, 165, 196, 0.18) 1px, transparent 1px);
  background-size: 26px 26px;
}

/* mono eyebrow label — the QWR structural signature */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-deep);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  margin-bottom: var(--space-2);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--teal);
}
.section--dark .eyebrow { color: var(--teal); }

.lead {
  font-size: 1.15rem;
  color: var(--text-soft);
  max-width: 46rem;
}
.section--dark .lead { color: var(--text-inv-soft); }

/* ---------- 4. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-body);
  padding: 0.8em 1.6em;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), transform var(--transition);
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn--primary { background: var(--amber); color: var(--ink); }
.btn--primary:hover { background: var(--amber-deep); }

.btn--ghost { border-color: var(--ink-3); color: var(--white); background: transparent; }
.btn--ghost:hover { border-color: var(--teal); color: var(--teal); }

.btn--ghost-light { border-color: var(--line); color: var(--text); background: transparent; }
.btn--ghost-light:hover { border-color: var(--teal-deep); color: var(--teal-deep); }

/* ---------- 5. Header / navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(13, 21, 48, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--ink-3);
}

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

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45em;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--white);
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand .brand__mark { color: var(--amber); }
.brand .brand__sub {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--teal);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav__links a {
  color: var(--text-inv-soft);
  font-weight: 500;
  font-size: var(--fs-small);
  padding: 0.4em 0.2em;
}
.nav__links a:hover,
.nav__links a[aria-current="page"] { color: var(--white); text-decoration: none; }
.nav__links a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--amber); }

.nav__toggle {
  display: none;
  background: none;
  border: 0;
  color: var(--white);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.3em;
}

@media (max-width: 760px) {
  .nav__toggle { display: block; }
  .nav__links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--ink);
    border-bottom: 1px solid var(--ink-3);
    display: none;
    padding: var(--space-2) var(--space-3) var(--space-3);
  }
  .nav__links.is-open { display: flex; }
  .nav__links a { display: block; padding: 0.8em 0.2em; font-size: 1rem; }
  .nav__cta { margin-top: var(--space-2); }
}

.brand img { height: 40px; width: auto; }
.site-footer .brand img { height: 34px; }

/* ---------- 5b. Page hero (interior pages) ---------- */
.page-hero { padding-block: var(--space-5); }
.page-hero .lead { margin-bottom: 0; }

/* ---------- 5c. Timeline (company story) ---------- */
.timeline {
  list-style: none;
  margin: var(--space-4) 0 0;
  padding: 0;
  border-left: 2px solid var(--ink-3);
}
.timeline li {
  position: relative;
  padding: 0 0 var(--space-4) var(--space-4);
}
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 0.4em;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(245, 163, 0, 0.2);
}
.timeline .timeline__year {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.14em;
  color: var(--teal);
  display: block;
  margin-bottom: 0.3em;
}
.timeline h3 { margin-bottom: 0.4em; }
.timeline p { max-width: 42rem; }

/* ---------- 5d. Case studies ---------- */
.case {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-2);
}
.case__tag {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal-deep);
}
.case__result {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text);
  border-left: 3px solid var(--amber);
  padding-left: var(--space-2);
}

/* ---------- 6. Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: var(--space-6);
}

.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: var(--space-5);
  align-items: center;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.hero__chart { width: 100%; height: auto; }

/* signal line draw-in */
.signal-path {
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: draw 2.6s ease-out forwards 0.3s;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

.signal-dot {
  animation: pulse 2s ease-in-out infinite 2.4s;
  transform-origin: center;
  transform-box: fill-box;
}
@keyframes pulse {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(1.5); }
}

@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__chart { max-width: 520px; margin-inline: auto; }
}

/* ---------- 6b. Image hero (full-bleed render) ---------- */
.hero--image {
  /* layered: contrast gradient -> chart render -> base color.
     The render is anchored right at natural aspect (height-fit), never
     cover-scaled: on wide screens it stays pinned to the right edge and
     the matching base color fills the rest seamlessly. */
  background:
    linear-gradient(90deg, rgba(0, 8, 30, 0.9) 0%, rgba(0, 8, 30, 0.45) 46%, rgba(0, 8, 30, 0) 70%),
    url("../assets/hero-chart.webp") right center / auto 100% no-repeat,
    #00081E;
  min-height: clamp(500px, 64vh, 680px);
  display: flex;
  align-items: center;
}
.hero--image .hero__content { max-width: 36rem; }

@media (max-width: 900px) {
  .hero--image {
    background:
      linear-gradient(rgba(0, 8, 30, 0.78), rgba(0, 8, 30, 0.78)),
      url("../assets/hero-chart-960.webp") 70% center / cover no-repeat,
      #00081E;
    min-height: 480px;
  }
}

/* ---------- 7. Ticker (methods strip) ---------- */
.ticker {
  border-block: 1px solid var(--ink-3);
  background: var(--ink-2);
  overflow: hidden;
  padding-block: 0.9rem;
}
.ticker__track {
  display: flex;
  gap: 3rem;
  width: max-content;
  animation: ticker 36s linear infinite;
}
.ticker span {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-inv-soft);
  white-space: nowrap;
}
.ticker span::before { content: "▸ "; color: var(--amber); }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- 8. Cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-3);
  transition: transform var(--transition), box-shadow var(--transition),
              border-color var(--transition);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--teal);
}

.card__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--amber);
  margin-bottom: var(--space-2);
}
.card__icon svg { width: 24px; height: 24px; }

.card p { color: var(--text-soft); font-size: var(--fs-small); margin-bottom: 0; }

/* dark variant */
.section--dark .card {
  background: var(--ink-2);
  border-color: var(--ink-3);
}
.section--dark .card:hover { border-color: var(--teal); box-shadow: none; }
.section--dark .card p { color: var(--text-inv-soft); }

/* ---------- 8b. Split layout (text + visual) ---------- */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-4);
  align-items: center;
}
@media (max-width: 760px) {
  .split { grid-template-columns: 1fr; }
}

/* ---------- 9. Industry tabs ---------- */
.tabs { margin-top: var(--space-4); }

.tabs__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0;
  margin-bottom: var(--space-3);
}

.tabs__btn {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-small);
  color: var(--text-soft);
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 0.7em 1em;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}
.tabs__btn:hover { color: var(--text); }
.tabs__btn[aria-selected="true"] {
  color: var(--text);
  border-bottom-color: var(--amber);
}

.tabs__panel { display: none; }
.tabs__panel.is-active {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-4);
  align-items: center;
}
.tabs__panel h3 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }

.tabs__visual {
  border-radius: var(--radius-lg);
  background: var(--ink);
  color: var(--teal);
  min-height: 220px;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.12em;
}

@media (max-width: 760px) {
  .tabs__panel.is-active { grid-template-columns: 1fr; }
}

/* ---------- 10. Process steps (real sequence) ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-4);
  counter-reset: step;
}
.step {
  border-left: 2px solid var(--ink-3);
  padding-left: var(--space-2);
}
.step::before {
  counter-increment: step;
  content: "0" counter(step);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  color: var(--amber);
  letter-spacing: 0.14em;
  display: block;
  margin-bottom: var(--space-1);
}
.step h3 { font-size: 1.1rem; margin-bottom: var(--space-1); }
.step p { font-size: var(--fs-small); margin: 0; }

/* ---------- 11. CTA band ---------- */
.cta-band {
  background: linear-gradient(120deg, var(--ink) 0%, var(--ink-2) 100%);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-4);
  text-align: center;
  color: var(--text-inv);
  position: relative;
  overflow: hidden;
}
.cta-band h2 { color: var(--white); }
.cta-band p { color: var(--text-inv-soft); max-width: 38rem; margin-inline: auto; }
.cta-band .btn { margin-top: var(--space-2); }

/* ---------- 12. Footer ---------- */
.site-footer {
  background: var(--ink);
  color: var(--text-inv-soft);
  padding-block: var(--space-5) var(--space-3);
  font-size: var(--fs-small);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}
.site-footer h4 {
  color: var(--white);
  font-size: var(--fs-small);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: var(--font-mono);
  font-weight: 500;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.6em; }
.site-footer a { color: var(--text-inv-soft); }
.site-footer a:hover { color: var(--white); }
.footer-legal {
  border-top: 1px solid var(--ink-3);
  padding-top: var(--space-2);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2);
}
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ---------- 13. Forms (contact page) ---------- */
.form-grid { display: grid; gap: var(--space-2); max-width: 540px; }
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 0.4em;
}
.field input, .field textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.75em 1em;
  transition: border-color var(--transition);
}
/* ---------- 14. Cookie consent banner ---------- */
.consent {
  position: fixed;
  inset-inline: var(--space-2);
  bottom: var(--space-2);
  z-index: 100;
  max-width: 720px;
  margin-inline: auto;
  background: var(--ink-2);
  color: var(--text-inv);
  border: 1px solid var(--ink-3);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.consent__text {
  margin: 0;
  flex: 1 1 320px;
  font-size: var(--fs-small);
  color: var(--text-inv-soft);
}
.consent__actions {
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
}
.consent .btn { font-size: var(--fs-small); padding: 0.6em 1.2em; }

/* ============================================================
   QWT THEME OVERRIDES — QuantWise Trading
   Sibling identity: same system, inverted accents.
   QWR signs in amber with teal support; QWT signs in teal
   with amber support.
   ============================================================ */
.btn--primary { background: var(--teal); color: var(--ink); }
.btn--primary:hover { background: var(--teal-deep); }

.eyebrow, .section--dark .eyebrow { color: var(--amber); }
.eyebrow::before { background: var(--amber); }

.brand .brand__mark { color: var(--teal); }
.brand .brand__sub  { color: var(--amber); }

.nav__links a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--teal); }

.card:hover { border-color: var(--amber); }
.card__icon { color: var(--teal); }

.step::before { color: var(--teal); }
.tabs__btn[aria-selected="true"] { border-bottom-color: var(--teal); }
.tabs__visual { color: var(--amber); }
.ticker span::before { color: var(--teal); }
.timeline li::before { background: var(--teal); box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.2); }
.case__result { border-left-color: var(--teal); }
::selection { background: var(--teal); color: var(--ink); }

/* product card: library-style tool presentation */
.product__name {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
  display: block;
  margin-bottom: var(--space-1);
}

/* legal / risk disclaimer block */
.disclaimer {
  border-top: 1px solid var(--ink-3);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--text-inv-soft);
  opacity: 0.85;
}

/* ---------- QWT additions v2: screenshots + platform logos ---------- */
.screenshot {
  border: 1px solid var(--ink-3);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  background: var(--ink-2);
}
.section:not(.section--dark) .screenshot { border-color: var(--line); background: var(--white); }

.platform-logos {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  margin-top: var(--space-1);
}
.platform-logos a {
  background: var(--white);
  border-radius: var(--radius);
  padding: 0.5rem 0.9rem;
  display: inline-flex;
  align-items: center;
}
.platform-logos img { height: 30px; width: auto; }

.testimonial-note {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--text-inv-soft);
  opacity: 0.8;
  margin-top: var(--space-3);
  text-transform: uppercase;
}
