/********** Trading page - scoped styles **********
 * Loaded only by trading.html. Tokens are sampled from the AristoMax
 * trading-portfolio diagrams so the page matches both the source
 * document and the site's existing cyan primary.
 ***************************************************/

.trading-page {
  --tr-navy: #004860;
  --tr-navy-deep: #00313f;
  --tr-cyan: #0c9cc0;
  --tr-cyan-bright: #38c3e8;
  --tr-line: #00789c;
  --tr-fill: #eaf4f8;
  --tr-border: #bad2de;
  --tr-surface: #f6fafc;
  --tr-ink: #16343f;
  --tr-muted: #5f7b87;
}

.trading-page .section-pad { padding: 5rem 0; }
.trading-page .bg-tint { background: var(--tr-surface); }
.trading-page .lead-narrow { max-width: 760px; }

/* The navbar is sticky, so anchor jumps must clear it */
.trading-page section[id],
.trading-page #main { scroll-margin-top: 90px; }

/* Keyboard focus - visible everywhere on this page */
.trading-page a:focus-visible,
.trading-page button:focus-visible,
.trading-page input:focus-visible,
.trading-page [tabindex]:focus-visible {
  outline: 3px solid var(--tr-cyan-bright);
  outline-offset: 2px;
  border-radius: 4px;
}

/*** Hero ***/
.tr-hero {
  position: relative;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(56, 195, 232, 0.22), transparent 60%),
    linear-gradient(135deg, var(--tr-navy-deep) 0%, var(--tr-navy) 55%, #005a76 100%);
  color: #eaf4f8;
  overflow: hidden;
}

.tr-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
}

.tr-hero > .container { position: relative; z-index: 1; }

.tr-hero .tr-eyebrow {
  display: inline-block;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--tr-cyan-bright);
  border: 1px solid rgba(56, 195, 232, 0.45);
  border-radius: 100px;
  padding: 6px 16px;
}

.tr-hero h1 {
  color: #ffffff;
  font-weight: 700;
  line-height: 1.15;
  font-size: calc(1.7rem + 1.6vw);
}

.tr-hero h1 .accent { color: var(--tr-cyan-bright); }
.tr-hero p.tr-sub { color: #c3dde7; max-width: 620px; }

/* Scoped to the page, not to .tr-hero: the closing CTA reuses both buttons */
.trading-page .btn-cyan {
  background: var(--tr-cyan);
  border-color: var(--tr-cyan);
  color: #fff;
}

.trading-page .btn-cyan:hover,
.trading-page .btn-cyan:focus { background: #0b87a7; border-color: #0b87a7; color: #fff; }

.trading-page .btn-ghost {
  border: 1px solid rgba(234, 244, 248, 0.55);
  color: #eaf4f8;
  background: transparent;
}

.trading-page .btn-ghost:hover,
.trading-page .btn-ghost:focus { background: rgba(234, 244, 248, 0.14); color: #fff; }

/* Hero system panel */
.tr-panel {
  background: rgba(0, 32, 44, 0.55);
  border: 1px solid rgba(56, 195, 232, 0.28);
  border-radius: 10px;
  padding: 1.25rem;
}

.tr-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #8fc4d6;
  border-bottom: 1px solid rgba(56, 195, 232, 0.2);
  padding-bottom: 0.75rem;
  margin-bottom: 0.5rem;
}

.tr-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tr-cyan-bright);
  flex: 0 0 auto;
}

.tr-panel dl { margin: 0; }

.tr-panel-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px dashed rgba(143, 196, 214, 0.18);
  font-size: 0.88rem;
}

.tr-panel-row:last-child { border-bottom: 0; }
.tr-panel-row dt { color: #8fc4d6; font-weight: 500; margin: 0; }
.tr-panel-row dd { color: #ffffff; font-weight: 600; margin: 0; text-align: right; }

.tr-spark { display: block; width: 100%; height: auto; margin-top: 0.75rem; }

/*** Generic card ***/
.tr-card {
  background: #fff;
  border: 1px solid #e2ecf1;
  border-radius: 6px;
  padding: 1.6rem;
  height: 100%;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.tr-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 72, 96, 0.1);
  border-color: var(--tr-border);
}

.tr-card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--tr-fill);
  color: var(--tr-navy);
  font-size: 1.15rem;
  margin-bottom: 1rem;
}

.tr-card h3 { font-size: 1.05rem; color: var(--tr-navy); margin-bottom: 0.5rem; }
.tr-card p { color: var(--tr-muted); font-size: 0.93rem; margin-bottom: 0; }

a.tr-card { text-decoration: none; display: block; }

a.tr-card h3::after {
  content: "\2192";
  margin-left: 8px;
  color: var(--tr-cyan);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  display: inline-block;
}

a.tr-card:hover h3::after { opacity: 1; transform: translateX(3px); }

/*** Gate library ***/
.tr-toolbar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.5rem;
}

.tr-search {
  position: relative;
  max-width: 360px;
  width: 100%;
}

.tr-search input {
  width: 100%;
  border: 1px solid var(--tr-border);
  border-radius: 100px;
  padding: 0.6rem 1rem 0.6rem 2.6rem;
  font-size: 0.92rem;
  background: #fff;
  color: var(--tr-ink);
}

.tr-search .bi {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--tr-muted);
  pointer-events: none;
}

.tr-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.tr-chip {
  border: 1px solid var(--tr-border);
  background: #fff;
  color: var(--tr-navy);
  border-radius: 100px;
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.tr-chip:hover { background: var(--tr-fill); }

.tr-chip[aria-pressed="true"] {
  background: var(--tr-navy);
  border-color: var(--tr-navy);
  color: #fff;
}

.tr-gate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.tr-gate {
  background: #fff;
  border: 1px solid #e2ecf1;
  border-left: 3px solid var(--tr-cyan);
  border-radius: 6px;
  padding: 1.1rem 1.2rem;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.tr-gate:hover { box-shadow: 0 8px 22px rgba(0, 72, 96, 0.09); transform: translateY(-2px); }
.tr-gate[hidden] { display: none; }
.tr-gate h3 { font-size: 0.98rem; color: var(--tr-navy); margin-bottom: 0.4rem; }
.tr-gate p { font-size: 0.88rem; color: var(--tr-muted); margin-bottom: 0.7rem; }

.tr-tag {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--tr-line);
  background: var(--tr-fill);
  border-radius: 100px;
  padding: 3px 10px;
}

.tr-count { color: var(--tr-muted); font-size: 0.88rem; }
.tr-empty { color: var(--tr-muted); padding: 2rem 0; text-align: center; }

/*** Model cards ***/
.tr-model {
  background: #fff;
  border: 1px solid #e2ecf1;
  border-radius: 6px;
  padding: 1.3rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.tr-model:hover { box-shadow: 0 10px 26px rgba(0, 72, 96, 0.09); transform: translateY(-3px); }
.tr-model h3 { font-size: 1rem; color: var(--tr-navy); margin: 0; }
.tr-model p { font-size: 0.89rem; color: var(--tr-muted); margin: 0; flex-grow: 1; }

.tr-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.8rem;
  color: var(--tr-muted);
  border-top: 1px solid #eef4f7;
  padding-top: 0.7rem;
  width: 100%;
}

.tr-meta b { color: var(--tr-ink); font-weight: 600; }

/*** Capability map ***/
.tr-map { border: 1px solid #e2ecf1; border-radius: 6px; overflow: hidden; background: #fff; }

.tr-map-row {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 1.25rem;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid #eef4f7;
}

.tr-map-row:last-child { border-bottom: 0; }
.tr-map-row:nth-child(odd) { background: #fafdfe; }
.tr-map-row dt { color: var(--tr-navy); font-weight: 600; font-size: 0.95rem; }
.tr-map-row dd { color: var(--tr-muted); font-size: 0.9rem; margin: 0; }

/*** Engagement path ***/
.tr-path { counter-reset: step; list-style: none; padding: 0; margin: 0; }

.tr-path li {
  counter-increment: step;
  position: relative;
  padding: 0 0 1.5rem 3.25rem;
  color: var(--tr-muted);
  font-size: 0.94rem;
}

.tr-path li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--tr-fill);
  border: 1px solid var(--tr-border);
  color: var(--tr-navy);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tr-path li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 17px;
  top: 36px;
  bottom: 6px;
  width: 1px;
  background: var(--tr-border);
}

.tr-path li b { color: var(--tr-ink); display: block; margin-bottom: 2px; }

/*** Closing CTA ***/
.tr-cta {
  background:
    radial-gradient(900px 400px at 15% 0%, rgba(56, 195, 232, 0.2), transparent 60%),
    linear-gradient(120deg, var(--tr-navy-deep), var(--tr-navy));
  color: #eaf4f8;
  border-radius: 10px;
  padding: 3rem 2rem;
  text-align: center;
}

.tr-cta h2 { color: #fff; font-weight: 700; }
.tr-cta p { color: #c3dde7; max-width: 640px; margin-left: auto; margin-right: auto; }

/*** Shared note ***/
.tr-note {
  background: var(--tr-fill);
  border: 1px solid var(--tr-border);
  border-radius: 6px;
  padding: 1.25rem 1.4rem;
  color: var(--tr-ink);
  font-size: 0.92rem;
}

.tr-note p { color: var(--tr-muted); margin: 0.9rem 0 0; }
.tr-note p:last-child { margin-bottom: 0; }

/*** Skip link ***/
.tr-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100000;
  background: var(--tr-navy);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 6px 0;
}

.tr-skip:focus {
  left: 0;
  color: #fff;
}

/*** Responsive ***/
@media (max-width: 991.98px) {
  .tr-map-row { grid-template-columns: 1fr; gap: 0.35rem; }
}

@media (max-width: 767.98px) {
  .trading-page .section-pad { padding: 3.25rem 0; }

  /* style.css draws the section-title rules at calc(100% + 120px) / left: -60px.
     This page's eyebrow labels are longer than the rest of the site's, so at phone
     widths those rules push past the container. Shorten the overhang here only. */
  .trading-page .section-title::before {
    width: calc(100% + 24px);
    left: -12px;
  }

  .trading-page .section-title::after {
    width: calc(100% + 36px);
    left: -18px;
  }

  .tr-gate-grid { grid-template-columns: 1fr; }
  .tr-hero { text-align: center; }
  .tr-hero p.tr-sub { margin-left: auto; margin-right: auto; }
  .tr-cta { padding: 2.25rem 1.25rem; }
}

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

  .tr-card:hover,
  .tr-gate:hover,
  .tr-model:hover { transform: none; }
}
