:root {
  --bg: #100e0b;
  --bg-raised: #17140f;
  --panel: #1c1811;
  --border: #2c2619;
  --border-soft: #221d15;
  --text: #ece6d9;
  --text-dim: #9c9382;
  --text-faint: #6b6455;
  --accent: #c99a4a;
  --accent-soft: #8a6b38;
  --up: #7ea87a;
  --down: #b56a5f;
  --radius: 3px;
  --max-width: 1080px;
  --display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --mono: "Space Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }
  .reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
}

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

h1, h2 {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.005em;
  color: var(--text);
}
h3 { font-family: var(--sans); font-weight: 600; color: var(--text); }

.wrap { max-width: var(--max-width); margin: 0 auto; padding: 0 28px; }
.wrap-narrow { max-width: 660px; }

/* Header */

.site-header {
  border-bottom: 1px solid var(--border-soft);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  padding-bottom: 20px;
  gap: 24px;
}

.brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.35rem;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-accent { color: var(--accent); }

.main-nav { display: flex; gap: 28px; flex-wrap: wrap; }
.main-nav a {
  color: var(--text-dim);
  font-size: 0.88rem;
  letter-spacing: 0.01em;
}
.main-nav a:hover { color: var(--text); text-decoration: none; }

.lang-toggle { display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 0.8rem; color: var(--text-faint); }
.lang-toggle a { color: var(--text-faint); }
.lang-toggle a.active { color: var(--accent); }
.lang-toggle a:hover { text-decoration: none; color: var(--text); }

/* Hero */

.hero { padding: 72px 0 56px; border-bottom: 1px solid var(--border-soft); }

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 0 0 18px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .live-dot { animation: live-pulse 2.4s ease-in-out infinite; }
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(201, 154, 74, 0.5); }
  50% { opacity: 0.55; box-shadow: 0 0 0 4px rgba(201, 154, 74, 0); }
}

.hero h1 {
  font-size: 3.1rem;
  line-height: 1.08;
  margin: 0 0 20px;
}

.hero .subtitle {
  color: var(--text-dim);
  font-size: 1.05rem;
  max-width: 440px;
  margin: 0 0 28px;
}

.hero-cta { display: flex; gap: 28px; flex-wrap: wrap; align-items: center; }

.btn-link {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
}
.btn-link:hover { text-decoration: none; color: var(--accent); }
.btn-link-muted { color: var(--text-dim); border-bottom-color: var(--border); font-weight: 400; }
.btn-link-muted:hover { color: var(--text); border-bottom-color: var(--text-dim); }

.btn-solid {
  display: inline-block;
  background: var(--accent);
  color: #16110a;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 11px 20px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn-solid:hover { background: #dcae5f; text-decoration: none; }

/* Hero image + ticker tape */

.hero-visual {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.hero-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ticker-tape {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, rgba(16, 14, 11, 0.96) 40%, rgba(16, 14, 11, 0));
  padding: 40px 0 14px;
  overflow: hidden;
}

.ticker-track {
  display: flex;
  gap: 32px;
  width: max-content;
  animation: ticker-scroll 26s linear infinite;
}

.ticker-item {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-dim);
  white-space: nowrap;
  padding: 0 16px;
}
.ticker-item strong {
  color: var(--text);
  margin-right: 10px;
  font-weight: 500;
}

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
}

/* Sections */

.section { padding: 64px 0; border-bottom: 1px solid var(--border-soft); }
.section:last-of-type { border-bottom: none; }

.section-index {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-faint);
  letter-spacing: 0.08em;
  margin: 0 0 10px;
}

.section h2 { font-size: 2rem; margin: 0 0 10px; }
.section-lede { color: var(--text-dim); margin: 0 0 28px; max-width: 560px; }

/* Demo widget */

.demo-widget {
  margin-top: 8px;
  padding: 28px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.demo-controls { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.demo-controls label {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-faint);
}
.demo-controls select, .demo-controls input {
  flex: 1;
  min-width: 220px;
  padding: 10px 12px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-family: var(--sans);
}

.demo-status { color: var(--text-dim); margin: 18px 0 0; font-size: 0.9rem; font-family: var(--mono); }
.demo-status.is-error { color: var(--down); }

.demo-result { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border); }
.demo-result-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.demo-result h3 { margin: 0; font-size: 1.25rem; }
.demo-badge { font-family: var(--mono); font-size: 0.75rem; color: var(--text-faint); }

.ledger { width: 100%; border-collapse: collapse; margin-top: 16px; font-family: var(--mono); font-size: 0.9rem; }
.ledger tr { border-bottom: 1px solid var(--border-soft); }
.ledger tr:last-child { border-bottom: none; }
.ledger td { padding: 9px 4px; }
.ledger td:first-child { color: var(--text-faint); text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.04em; }
.ledger td:last-child { text-align: right; color: var(--text); }

@media (prefers-reduced-motion: no-preference) {
  .ledger tr {
    opacity: 0;
    animation: ledger-row-in 0.4s ease forwards;
  }
  .ledger tr:nth-child(1) { animation-delay: 0.02s; }
  .ledger tr:nth-child(2) { animation-delay: 0.06s; }
  .ledger tr:nth-child(3) { animation-delay: 0.1s; }
  .ledger tr:nth-child(4) { animation-delay: 0.14s; }
  .ledger tr:nth-child(5) { animation-delay: 0.18s; }
  .ledger tr:nth-child(6) { animation-delay: 0.22s; }
  .ledger tr:nth-child(7) { animation-delay: 0.26s; }
  .ledger tr:nth-child(8) { animation-delay: 0.3s; }
  .ledger tr:nth-child(9) { animation-delay: 0.34s; }
}
@keyframes ledger-row-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Ledger groups (fiche valeur complète) */

.ledger-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px 32px; margin-top: 8px; }
.ledger-group h4 {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin: 0 0 6px;
  font-weight: 400;
}

/* Compare */

.compare-rows { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.compare-input-row { display: flex; gap: 10px; align-items: center; }
.compare-input-row input {
  flex: 1;
  padding: 10px 12px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-family: var(--sans);
}
.compare-remove {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-faint);
  border-radius: var(--radius);
  width: 34px;
  height: 34px;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 1.1rem;
  line-height: 1;
}
.compare-remove:hover { color: var(--down); border-color: var(--down); }
.compare-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }

.compare-table { margin-top: 0; }
.compare-table thead th { text-align: left; padding: 8px 4px; font-family: var(--sans); font-weight: 600; color: var(--text); font-size: 0.9rem; }
.compare-table thead th span { display: block; font-family: var(--mono); font-weight: 400; color: var(--text-faint); font-size: 0.75rem; margin-top: 2px; }
.compare-table thead th:first-child { width: 1%; }
.compare-table td:first-child { color: var(--text-faint); text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.04em; white-space: nowrap; }
.compare-group-row td {
  padding-top: 16px !important;
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  border-bottom: none !important;
}

/* Market overview */

.market-result { margin-top: 8px; }
.market-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 32px; }
.market-stat { background: var(--bg-raised); padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.market-stat .value { font-family: var(--mono); font-size: 1.3rem; color: var(--text); }
.market-stat .label { font-size: 0.75rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.04em; }
.market-stat.up .value { color: var(--up); }
.market-stat.down .value { color: var(--down); }

.ranking-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-bottom: 32px; }
.ranking-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.ranking-card h4 { font-size: 0.85rem; font-family: var(--sans); font-weight: 600; margin: 0 0 12px; }
.ranking-list { list-style: none; margin: 0; padding: 0; counter-reset: rank; }
.ranking-list li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--border-soft); font-size: 0.85rem; }
.ranking-list li:first-child { border-top: none; }
.rank-symbol { font-family: var(--mono); color: var(--accent); width: 40px; flex-shrink: 0; }
.rank-name { color: var(--text-dim); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-value { font-family: var(--mono); color: var(--text); }

.sector-list { border-top: 1px solid var(--border-soft); }
.sector-row { display: flex; align-items: baseline; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); flex-wrap: wrap; }
.sector-name { font-weight: 600; font-size: 0.9rem; min-width: 180px; }
.sector-count { font-family: var(--mono); color: var(--accent); font-size: 0.8rem; }
.sector-tickers { font-family: var(--mono); color: var(--text-faint); font-size: 0.78rem; }

/* How it works */

.step-list { list-style: none; margin: 24px 0 0; padding: 0; max-width: 640px; }
.step-list li { display: flex; gap: 20px; padding: 22px 0; border-top: 1px solid var(--border-soft); }
.step-list li:first-child { border-top: none; }
.step-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.step-list li:hover .step-icon { border-color: var(--accent-soft); transform: translateY(-2px); }
.step-icon svg { width: 18px; height: 18px; }
.step-num { display: block; font-family: var(--mono); color: var(--text-faint); font-size: 0.75rem; margin-bottom: 6px; }
.step-list h3 { font-size: 1rem; margin: 0 0 6px; font-family: var(--sans); font-weight: 600; }
.step-list p { color: var(--text-dim); margin: 0; font-size: 0.94rem; }

/* Docs */

.doc-block { margin-top: 32px; max-width: 680px; }
.doc-block h3 { font-size: 1rem; margin: 0 0 8px; font-family: var(--sans); font-weight: 600; }
.doc-block h3 code { font-weight: 500; color: var(--accent); }
.doc-block p { color: var(--text-dim); margin: 0 0 12px; font-size: 0.94rem; }
pre {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 0.82rem;
}
code { font-family: var(--mono); }

/* Access */

.section-access {
  position: relative;
  background-image: linear-gradient(to right, rgba(16, 14, 11, 0.94), rgba(16, 14, 11, 0.8)), url("../img/tape-texture.jpg");
  background-size: cover;
  background-position: center;
}

.access-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 24px; }
.access-row > div { max-width: 480px; }

/* About */

.section-about p { color: var(--text-dim); max-width: 640px; }

/* Legal */

.section h1 { font-size: 2.2rem; margin: 0 0 28px; }
.section h3 { font-size: 1rem; margin: 26px 0 6px; font-family: var(--sans); font-weight: 600; color: var(--accent); }
.section p { color: var(--text-dim); font-size: 0.95rem; }
.back-link { margin-top: 32px; }
.back-link a { font-size: 0.9rem; }

/* Footer */

.site-footer { padding: 32px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-links a { color: var(--text-faint); font-size: 0.85rem; }
.footer-links a:hover { color: var(--text-dim); text-decoration: none; }
.footer-copy { color: var(--text-faint); font-size: 0.82rem; font-family: var(--mono); }

@media (max-width: 760px) {
  .main-nav { display: none; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero { padding: 48px 0 40px; }
  .hero h1 { font-size: 2.3rem; }
  .section h2 { font-size: 1.6rem; }
  .access-row { flex-direction: column; align-items: flex-start; }
}
