:root {
  --navy: #0b0e14;
  --navy-deep: #05070b;
  --gold: #c9a24b;
  --white: #ffffff;
  --muted: rgba(255,255,255,0.75);
  --serif: Georgia, 'Times New Roman', serif;
  --sans: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--navy);
  color: var(--white);
  font-family: var(--sans);
  scroll-behavior: smooth;
}

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

a { color: inherit; text-decoration: none; }

/* Header: a market-ticker style strip (symbol row + bid/ask row) — nav lives in the
   right-side scale, this is purely the "what am I looking at" readout. */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  padding: 16px 0 0 16px;
}

.ticker {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: calc(100vw - 32px);
}

/* Hamburger toggle for the right-side scale nav — desktop has room for it fixed in
   place, but on narrow screens it would sit on top of the chart, so it collapses
   behind this button instead. */
.nav-toggle {
  display: none;
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 110;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(11,14,20,0.85);
  border: 1px solid rgba(255,255,255,0.18);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
}

.nav-toggle span {
  width: 16px;
  height: 2px;
  background: var(--white);
  display: block;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.ticker-row1 {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(11,14,20,0.85);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 7px 16px 7px 7px;
  backdrop-filter: blur(6px);
  width: max-content;
}

.logo-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #0a0c12;
  border: 1px solid rgba(255,255,255,0.18);
  font-family: var(--serif);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--white);
  flex: 0 0 auto;
}

.ticker-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
}

.ticker-sep { color: rgba(255,255,255,0.35); font-size: 12px; }

.ticker-tf, .ticker-exch {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.ticker-status {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--up);
  flex: 0 0 auto;
  margin-left: 2px;
  box-shadow: 0 0 6px var(--up);
}

.ticker-glyph {
  color: var(--gold);
  font-size: 13px;
  opacity: 0.85;
}

.ticker-ohlc {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 13px;
  margin-left: 4px;
  white-space: nowrap;
}

.ohlc-label {
  color: var(--muted);
  font-size: 11px;
  margin-right: 1px;
}

.ohlc-val { font-weight: 600; margin-right: 7px; color: var(--white); }
.ohlc-val.up { color: var(--up); }
.ohlc-val.down { color: var(--down); }

.ohlc-change { font-weight: 600; margin-left: 2px; }
.ohlc-change.up { color: var(--up); }
.ohlc-change.down { color: var(--down); }

.ticker-row2 {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.ticker-price {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 76px;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1.5px solid;
  background: rgba(11,14,20,0.85);
  backdrop-filter: blur(6px);
}

.ticker-price.sell { border-color: var(--down); }
.ticker-price.sell .price { color: var(--down); }
.ticker-price.buy { border-color: #3a7bd5; }
.ticker-price.buy .price { color: #3a7bd5; }

.ticker-price .price { font-size: 14px; font-weight: 700; }
.ticker-price .price-label { font-size: 8px; letter-spacing: 1.2px; color: var(--muted); }

.ticker-spread {
  display: flex;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
}

/* Right-side vertical "price scale" nav, TradingView-style: labels sit to the left
   of a vertical axis line, with a short tick connecting each label to the axis. */
.scale-nav {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 190px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: flex-end;
  padding: 16vh 22px;
  pointer-events: none;
}

.scale-axis {
  position: absolute;
  top: 14vh;
  bottom: 14vh;
  right: 22px;
  width: 1px;
  background: rgba(255,255,255,0.16);
}

.scale-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.scale-label {
  font-size: 12px;
  letter-spacing: 0.5px;
  color: var(--muted);
  white-space: nowrap;
  padding: 4px 9px;
  border-radius: 3px;
  background: rgba(11,14,20,0.7);
  border: 1px solid rgba(255,255,255,0.12);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.scale-tick {
  width: 10px;
  height: 1px;
  background: rgba(255,255,255,0.35);
  flex: 0 0 auto;
}

.scale-item:hover .scale-label {
  color: var(--white);
  border-color: rgba(255,255,255,0.35);
  background: rgba(20,24,32,0.9);
}

.scale-join-us { cursor: pointer; }
.scale-join-us .caret { font-size: 9px; }

/* The outer .scale-dropdown box touches the trigger with NO margin (right: 100%,
   zero gap) and instead uses padding-right to push its visible content away — that
   padding strip is still part of the box's hoverable area, so the cursor never
   crosses a dead zone between the trigger and the menu while moving toward it. */
.scale-dropdown {
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  padding-right: 14px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
}

.scale-join-us:hover .scale-dropdown {
  opacity: 1;
  visibility: visible;
}

.scale-dropdown-inner {
  background: var(--navy-deep);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  min-width: 190px;
  padding: 8px 0;
}

.scale-dropdown a {
  display: block;
  padding: 10px 16px;
  font-size: 13px;
  white-space: nowrap;
}

.scale-dropdown a:hover { background: rgba(255,255,255,0.06); }

.btn {
  display: inline-block;
  padding: 15px 38px;
  border: 1px solid var(--white);
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: background 0.25s ease, color 0.25s ease;
}

.btn:hover {
  background: var(--white);
  color: var(--navy-deep);
}

/* ===== Candlestick scroll chart ===== */
:root {
  --candle-w: 112px;
  --candle-gap: 38px;
  --candle-step: 150px; /* width + gap */
  --up: #1c7a44;
  --down: #a3342f;
}

.chart-scroll {
  position: relative;
  height: 4200vh; /* long scroll runway: story candles + full placements wall, paced by JS weights */
}

.chart-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--navy-deep);
}

.chart-stage {
  position: relative;
  flex: 1 1 100%;
  overflow: hidden;
  background-image:
    linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: center;
}

.chart-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 40%, rgba(201,162,75,0.06), transparent 60%);
}

.candle-track {
  position: absolute;
  left: 0;
  bottom: 10%;
  display: flex;
  align-items: flex-end;
  gap: var(--candle-gap);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.candle {
  width: var(--candle-w);
  flex: 0 0 auto;
  position: relative; /* lets .featured raise z-index above its neighbors when it widens */
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  transform: translateY(16px) scaleY(0.85);
  transform-origin: bottom;
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.candle.visible {
  opacity: 1;
  transform: translateY(0) scaleY(1);
}

/* The current candle: its border (body box) is resized by JS to match the source
   image's real aspect ratio, so the full image shows with no cropping and no
   letterboxing — the border itself becomes the image's true shape, not a uniform
   zoom of the normal candle box. Only z-index and a highlight live here in CSS; the
   actual width/height are set inline per-candle since they depend on each image. */
.candle.featured {
  z-index: 20;
}

.candle .wick {
  width: 2px;
  background: currentColor;
  transition: height 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.candle .body {
  width: 100%;
  border-radius: 3px;
  position: relative;
  overflow: hidden;
  /* `cover` fits the top/bottom bounds first; if that would leave empty space on the
     left/right (image narrower than the candle at that height), it automatically
     re-fits against the left/right bounds instead, cropping top/bottom — whichever
     axis avoids gaps. no-repeat is a hard guarantee against tiling either way. Once a
     candle is featured its box matches the image's own aspect ratio exactly, so cover
     shows the full image edge-to-edge with no actual cropping happening. */
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15);
  transition: height 0.5s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease;
}

.candle.featured .body {
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.3), 0 12px 32px rgba(0,0,0,0.5);
}

.candle .body::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--tint, rgba(28,122,68,0.5));
  mix-blend-mode: multiply;
  opacity: 0.6;
}

.candle.up { color: var(--up); }
.candle.down { color: var(--down); }
.candle.up .body { box-shadow: inset 0 0 0 1px var(--up); }
.candle.down .body { box-shadow: inset 0 0 0 1px var(--down); }

/* Logo candles (placements): logo fills and crops the candle, same zoomed-in treatment as the photos.
   Most source logos are dark marks on a transparent background, so the panel behind them
   has to be light to actually contrast — a dark panel (the old choice here) made dark logos
   nearly disappear. A neutral off-white works against virtually every brand color we have. */
.candle.logo .body {
  background: #f3f0ea;
}

.candle.logo .body::after { display: none; }

.candle.logo .body img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* object-fit: cover already scales+crops to fill the box exactly; a further
     transform: scale() here would upscale past that and blur the source. */
}

.chart-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
  padding: 0 32px 64px;
  pointer-events: none; /* text floats over the chart; clicks pass through except on the CTA */
}

.caption-inner {
  max-width: 620px;
  pointer-events: auto;
}

.caption-inner h4 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 34px;
  margin: 0 0 18px;
  text-shadow: 0 2px 16px rgba(0,0,0,0.85), 0 1px 4px rgba(0,0,0,0.9);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.caption-inner p {
  color: var(--muted);
  line-height: 1.8;
  font-size: 15px;
  margin: 0 0 20px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.9), 0 1px 3px rgba(0,0,0,0.95);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.45s ease 0.05s, transform 0.45s ease 0.05s;
}

.caption-inner.active h4,
.caption-inner.active p {
  opacity: 1;
  transform: translateY(0);
}

.caption-inner .btn {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.45s ease 0.1s, transform 0.45s ease 0.1s;
}

.caption-inner.active .btn { opacity: 1; transform: translateY(0); }

.scroll-hint {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  animation: bob 1.8s ease-in-out infinite;
  transition: opacity 0.4s ease;
}

@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, -6px); }
}

/* Footer */
footer {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 40px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
}

footer a.rights { text-decoration: underline; color: var(--muted); }

.social-bar {
  display: flex;
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.social-bar img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

@media (max-width: 900px) {
  :root {
    --candle-w: 68px;
    --candle-gap: 24px;
    --candle-step: 92px;
  }
  .caption-inner h4 { font-size: 26px; }
  .chart-scroll { height: 3100vh; }

  /* Ticker: constrained to the viewport and allowed to wrap onto a second line
     instead of running off the right edge. */
  .ticker-name { display: none; }
  .ticker-ohlc { font-size: 11px; }
  .ticker-row1 {
    padding: 6px 10px 6px 6px;
    gap: 5px;
    flex-wrap: wrap;
    row-gap: 6px;
    width: auto;
    max-width: 100%;
  }
  .ticker-price { min-width: 60px; padding: 4px 7px; }

  /* Nav: the right-side "price scale" needs real horizontal room to sit clear of
     the chart — there isn't any on a narrow screen, so it collapses into a
     hamburger-triggered dropdown panel instead of staying pinned open. */
  .nav-toggle { display: flex; }

  .scale-nav {
    top: 60px;
    right: 16px;
    bottom: auto;
    left: auto;
    width: auto;
    max-width: calc(100vw - 32px);
    height: auto;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 8px;
    padding: 10px;
    background: rgba(8,10,15,0.96);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    pointer-events: none;
  }

  .scale-nav.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }

  .scale-axis { display: none; }
  .scale-item { justify-content: flex-start; gap: 6px; }
  .scale-tick { display: none; }
  .scale-label {
    background: none;
    border: none;
    padding: 8px 6px;
    font-size: 14px;
    width: 100%;
  }

  .scale-join-us { flex-direction: column; align-items: stretch; }
  .scale-dropdown {
    position: static;
    transform: none;
    padding: 0 0 0 16px;
    opacity: 1;
    visibility: visible;
  }
  .scale-dropdown-inner {
    background: none;
    border: none;
    min-width: 0;
    padding: 0 0 4px;
  }
  .scale-dropdown a { padding: 8px 6px; font-size: 13px; }
}
