/* ---------------------------------------------------------------------------
   Hero background: a full-width XAUUSD market the headline sits inside.

   One 13.5s loop — the original 15s pacing, 10% faster. The chart runs
   the full width and roughly 70% of the hero height. Rather than carving a
   hole behind the copy, an SVG mask drops the market to roughly 10% there
   while it sits nearer 30-35% out at the sides.

     0-3.6s     consolidation beneath resistance
     3.6-5.4s   approach and retest
     5.4-6.3s   break; BREAKOUT DETECTED
     6.3-7.2s   ENTRY pulse, STOP LOSS drawn
     7.2-11.7s  progression to the upper right
     11.7-13.5s annotations fade, the market resets without a visible jump
--------------------------------------------------------------------------- */
.hero-anim {
  position: absolute; inset: 0; z-index: 0;   /* after .hero-mark in the DOM, so it paints on top */
  pointer-events: none;
  overflow: hidden;
  /* only the outer edges soften, so the chart keeps its full width */
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 9%, #000 91%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 9%, #000 91%, transparent 100%);
}
.hero-anim svg { width: 100%; height: 100%; display: block; }
.hero > .wrap { position: relative; z-index: 1; }

/* Local text protection: a soft navy pool directly behind the copy. Candles
   read through it at roughly 22-28%; only the area right under the letters
   is quieted, rather than the whole middle of the chart. */
.hero > .wrap::before {
  content: ''; position: absolute; z-index: -1; pointer-events: none;
  left: 50%; top: 46%; width: min(880px, 92%); height: 92%;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse 50% 50% at 50% 50%,
    rgba(0, 8, 22, .42) 0%, rgba(0, 8, 22, .3) 45%, rgba(0, 8, 22, 0) 100%);
}

/* ---- watermark: the genuine ASCENT A, stroke only, behind everything ----
   Anchored to the hero's bottom-left rather than drawn inside the chart. The
   chart scales to fill and crops on wide screens; this never does. Same
   footprint as before at desktop widths (385px tall, about 570px wide), its
   lowest point 26px above the hero's bottom divider, and it scales down to
   stay whole on narrower screens. */
.hero-mark {
  position: absolute; z-index: 0; pointer-events: none;
  left: 1.5%; bottom: 26px;
  height: min(385px, calc(100% - 150px));
  aspect-ratio: 1.4853 / 1;
  max-width: 94%;
  overflow: visible;
  /* recede as it reaches the copy, as the market does */
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 52%, rgba(0,0,0,.45) 82%, rgba(0,0,0,.32) 100%);
  mask-image: linear-gradient(90deg, #000 0, #000 52%, rgba(0,0,0,.45) 82%, rgba(0,0,0,.32) 100%);
}
.hero-mark path {
  fill: none; stroke: #2a5aa8; stroke-width: 1.6;
  stroke-linejoin: miter;
  opacity: .25;   /* about 45% stronger than before, same dark navy */
}

/* ---- the market: candles only, no connecting line ----
   Bodies are narrow with fine wicks. Bearish candles are a darker,
   desaturated navy rather than red — red is kept for the stop alone. */
.candle { transform-box: fill-box; transform-origin: center; opacity: 0; }
.candle line { stroke-width: 1.1; }
.candle.bull line, .candle.bull rect { stroke: #3a74c4; fill: #3a74c4; }
.candle.bear line, .candle.bear rect { stroke: #1e3d66; fill: #1e3d66; }
.candle rect { stroke-width: 0; }
/* breakout and run move into ASCENT cobalt */
.candle.brk.bull line, .candle.brk.bull rect,
.candle.post.bull line, .candle.post.bull rect { stroke: #2f7dff; fill: #2f7dff; }
.candle.post.bear line, .candle.post.bear rect { stroke: #24508f; fill: #24508f; }

/* ---- annotations ---- */
.label {
  font-family: var(--font); font-size: 12px; font-weight: 600;
  letter-spacing: .2em; fill: #7f9ec4;
}
.label-hot { fill: #6fa8ff; }
.label-stop { fill: #b97c74; font-size: 11px; }
.res-line { stroke: #4a7bb5; stroke-width: 1; stroke-dasharray: 5 8; opacity: .45;
            animation: resFlare 13.5s linear infinite; }
.ann-res .label { animation: resLabelFlare 13.5s linear infinite; }
.entry-dot { fill: #2f7dff; }
.entry-pulse { fill: none; stroke: #2f7dff; stroke-width: 1.2; }
.stop-drop { stroke: #2f7dff; stroke-width: 1; opacity: .5; }
.stop-line { stroke: #b06a60; stroke-width: 1; stroke-dasharray: 4 7; opacity: .46; }

/* ---- the timeline --------------------------------------------------------
   The clip rectangle is what makes the market *arrive*: it scales from the
   left, unevenly, so consolidation takes the first four seconds and the run
   covers the last third.
--------------------------------------------------------------------------- */
.advance-rect {
  transform-origin: 0 0;
  animation: advance 13.5s linear infinite;
}
@keyframes advance {
  0%     { transform: scaleX(0); }
  26.7%  { transform: scaleX(.46); }   /* 4s  — consolidation done */
  40%    { transform: scaleX(.62); }   /* 6s  — testing resistance */
  46.7%  { transform: scaleX(.70); }   /* 7s  — through it */
  53.3%  { transform: scaleX(.77); }   /* 8s  — entry */
  86.7%  { transform: scaleX(1); }     /* 13s — run complete */
  93%    { transform: scaleX(1); }
  100%   { transform: scaleX(0); }     /* reset while everything is faded out */
}

.ann { opacity: 0; }
.ann-res   { animation: annRes   13.5s linear infinite; }
.ann-break { animation: annBreak 13.5s linear infinite; }
.ann-entry { animation: annEntry 13.5s linear infinite; }
.entry-pulse { animation: pulse 2.52s ease-out infinite; }

/* As the level is introduced it comes up brighter for a moment, so the eye
   knows what's being tested, then eases back to its usual quiet setting. */
@keyframes resFlare {
  0%, 8%    { opacity: .45; }
  15%       { opacity: .82; }
  28%, 100% { opacity: .45; }
}
@keyframes resLabelFlare {
  0%, 8%    { fill: #7f9ec4; }
  15%       { fill: #b7cdec; }
  28%, 100% { fill: #7f9ec4; }
}
@keyframes annRes {
  0%, 6%    { opacity: 0; }
  14%, 80%  { opacity: 1; }
  90%, 100% { opacity: 0; }
}
@keyframes annBreak {
  0%, 44%   { opacity: 0; }
  47%, 54%  { opacity: 1; }
  60%, 100% { opacity: 0; }
}
@keyframes annEntry {
  0%, 50%   { opacity: 0; }
  55%, 84%  { opacity: .87; }   /* present, but a notch below the copy */
  92%, 100% { opacity: 0; }
}
@keyframes pulse {
  0%   { r: 5; opacity: .85; }
  70%  { r: 18; opacity: 0; }
  100% { r: 18; opacity: 0; }
}

/* the stop marker draws downward from the entry */
.stop-drop { stroke-dasharray: 48; stroke-dashoffset: 48; animation: dropIn 13.5s linear infinite; }
@keyframes dropIn {
  0%, 52%   { stroke-dashoffset: 48; }
  58%, 88%  { stroke-dashoffset: 0; }
  100%      { stroke-dashoffset: 0; }
}


/* ---- narrow screens: fewer parts, not smaller ones ---- */
@media (max-width: 48rem) {
  .hero-anim {
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12%, #000 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 12%, #000 100%);
  }
  .ann-break, .ann-entry { display: none; }
  .hero-mark { left: 3%; bottom: 18px; max-width: 88%; }
  .hero-mark path { opacity: .16; }
  .label { font-size: 15px; }
}

/* ---- reduced motion: a quiet still frame, no annotations ---- */
@media (prefers-reduced-motion: reduce) {
  .hero-anim * { animation: none !important; }
  .advance-rect { transform: none; }
  .ann-res { opacity: 1; }
  .ann-break, .ann-entry { opacity: 0; }
}
