/*
 * ============================================================================
 * Meru Technologies Website
 * meru-technologies.com
 *
 * Copyright (c) 2026 Meru Technologies LLC.
 * All Rights Reserved.
 * ============================================================================
 *
 * Author: V.Bandarupalli
 * Date: 2026-10-04
 */

/* "A Trader's Day" story explorer. Tokens only — every colour comes from
   site.css. The page is authored to read top to bottom with no JavaScript;
   story.js collapses it into one beat at a time. */

/* ---------------------------------------------------------------- hero */

.story-hero {
  padding: 72px 0 36px;
  border-bottom: 1px solid var(--meru-line);
  background:
    radial-gradient(900px 340px at 18% -10%, rgba(217, 174, 79, 0.1), transparent 70%),
    var(--meru-canvas);
}

.story-eyebrow {
  margin: 0 0 14px;
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--meru-accent);
}

.story-hero h1 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 5vw, 3.3rem);
  line-height: 1.08;
  color: var(--meru-ink);
}

.story-tagline {
  margin: 0 0 20px;
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  color: var(--meru-accent-bright);
}

.story-intro {
  max-width: 62ch;
  margin: 0;
  color: var(--meru-ink-muted);
  line-height: 1.72;
}

.story-hero-actions { margin: 20px 0 0; }

/* The trade the whole page follows, stated up front like a ticket stub. */
.story-ticket {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1px;
  margin: 34px 0 0;
  overflow: hidden;
  border: 1px solid var(--meru-line);
  border-radius: var(--radius);
  background: var(--meru-line);
}

.story-ticket > div {
  padding: 16px 18px;
  background: var(--meru-card);
}

.story-ticket dt {
  margin: 0 0 6px;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--meru-ink-muted);
}

.story-ticket dd {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--meru-ink);
}

.story-ticket dd span {
  display: block;
  margin-top: 4px;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--meru-ink-muted);
}

.story-ticket .win dd { color: var(--meru-positive); }

/* ---------------------------------------------------------------- rail */

/* The site header is itself sticky at top:0 with a higher z-index, so the
   rail has to stand ON it rather than slide underneath — otherwise the
   rail's first row is hidden behind the nav. story.js measures the header
   and keeps --story-header-h honest (the mobile dropdown changes it); the
   fallback is the 72px bar plus its 1px border. */
.story-rail {
  position: sticky;
  top: var(--story-header-h, 73px);
  z-index: 20;
  border-bottom: 1px solid var(--meru-line);
  background: rgba(12, 10, 7, 0.93);
  backdrop-filter: blur(10px);
}

/* A native hash jump (or a reload on #beat) lands under both sticky bars
   without this. */
.story-beat {
  scroll-margin-top: calc(var(--story-header-h, 73px) + var(--story-rail-h, 88px) + 12px);
}

.rail-phases {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rail-phase {
  padding: 14px 20px 12px;
  border-left: 1px solid var(--meru-line);
}

.rail-phase:first-child { border-left: 0; }

.rail-phase-head {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 8px;
}

.rail-glyph { color: var(--meru-accent); }

.rail-phase-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--meru-ink);
}

.rail-phase-clock {
  font-size: 0.72rem;
  color: var(--meru-ink-muted);
}

.rail-beats {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rail-beat {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 0.82rem;
  color: var(--meru-ink-muted);
  text-decoration: none;
  transition: background 0.16s ease, color 0.16s ease;
}

.rail-beat:hover { background: var(--meru-accent-soft); color: var(--meru-ink); }

.rail-beat.active {
  background: var(--meru-accent-soft);
  color: var(--meru-accent-bright);
  font-weight: 600;
}

.rail-beat.done { color: var(--meru-ink); }

.rail-clock {
  flex: none;
  width: 4.3em;
  font-variant-numeric: tabular-nums;
  font-size: 0.74rem;
  color: var(--meru-accent);
  opacity: 0.8;
  white-space: nowrap;
}

.rail-title { min-width: 0; }

/* ---------------------------------------------------------------- stage */

.story-stage { padding: 40px 0 72px; }

.stage-controls {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
}

.stage-controls button {
  padding: 9px 16px;
  border: 1px solid var(--meru-line);
  border-radius: 999px;
  background: var(--meru-card);
  color: var(--meru-ink);
  font: inherit;
  font-size: 0.86rem;
  cursor: pointer;
  transition: border-color 0.16s ease, color 0.16s ease;
}

.stage-controls button:hover:not(:disabled) {
  border-color: var(--meru-accent);
  color: var(--meru-accent-bright);
}

.stage-controls button:disabled { opacity: 0.35; cursor: default; }

.stage-progress {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--meru-ink-muted);
}

/* Without JS every beat is simply a section of the article. */
.story-beat { padding: 46px 0; border-top: 1px solid var(--meru-line); }
.story-beat:first-of-type { border-top: 0; padding-top: 6px; }

.beat-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: baseline;
  margin: 0 0 10px;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.beat-phase { color: var(--meru-accent); }
.beat-clock { color: var(--meru-ink); font-variant-numeric: tabular-nums; }
.beat-count { color: var(--meru-ink-muted); margin-left: auto; }

.beat-head h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.2vw, 2.1rem);
  line-height: 1.16;
  color: var(--meru-ink);
}

.beat-lede {
  max-width: 64ch;
  margin: 0 0 28px;
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--meru-ink-muted);
}

/* ---------------------------------------------------------------- shot */

.beat-shot { margin: 0 0 26px; }

.shot-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--meru-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  line-height: 0;
}

.shot-frame img { display: block; width: 100%; height: auto; }

.beat-shot figcaption {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--meru-ink-muted);
}

.hotspot {
  position: absolute;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}

.hotspot-dot {
  display: block;
  width: 14px;
  height: 14px;
  margin: 8px;
  border: 2px solid var(--meru-accent-contrast);
  border-radius: 50%;
  background: var(--meru-accent);
  box-shadow: 0 0 0 0 rgba(217, 174, 79, 0.55);
  animation: hotspot-pulse 2.6s ease-out infinite;
}

@keyframes hotspot-pulse {
  70% { box-shadow: 0 0 0 13px rgba(217, 174, 79, 0); }
  100% { box-shadow: 0 0 0 0 rgba(217, 174, 79, 0); }
}

.hotspot:hover .hotspot-dot,
.hotspot[aria-expanded='true'] .hotspot-dot {
  background: var(--meru-accent-bright);
  animation: none;
}

.hotspot-note {
  position: absolute;
  z-index: 3;
  display: none;
  width: min(300px, 62vw);
  margin: 20px 0 0 -16px;
  padding: 12px 14px;
  border: 1px solid var(--meru-accent-deep);
  border-radius: 11px;
  background: var(--meru-canvas-deep);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--meru-ink-muted);
}

.hotspot-note strong { color: var(--meru-accent-bright); }
.hotspot-note.open { display: block; }

/* Flip notes that would run off the right edge back under the dot. */
.hotspot-note.flip { margin-left: 0; transform: translateX(-100%); }

/* No JS: the notes stack under the figure instead of floating on it. */
.no-js-notes .hotspot-note { position: static; display: block; margin: 8px 0 0; width: auto; }

/* ---------------------------------------------------------------- body */

.beat-trade {
  margin: 0 0 26px;
  padding: 16px 18px 16px 16px;
  border-left: 3px solid var(--meru-accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--meru-accent-soft);
  font-size: 0.97rem;
  line-height: 1.72;
  color: var(--meru-ink);
}

.trade-tag {
  display: inline-block;
  margin-right: 10px;
  padding: 2px 8px;
  border-radius: 5px;
  background: var(--meru-accent);
  color: var(--meru-accent-contrast);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  vertical-align: 1px;
}

.beat-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 18px;
}

.beat-col {
  padding: 20px 22px;
  border: 1px solid var(--meru-line);
  border-radius: var(--radius);
  background: var(--meru-card);
}

.beat-col h3 {
  margin: 0 0 14px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.beat-col.you { border-top: 2px solid var(--meru-ink-muted); }
.beat-col.you h3 { color: var(--meru-ink); }
.beat-col.ws { border-top: 2px solid var(--meru-accent); }
.beat-col.ws h3 { color: var(--meru-accent); }

.beat-col ul { margin: 0; padding-left: 1.1em; }

.beat-col li {
  margin-bottom: 9px;
  font-size: 0.92rem;
  line-height: 1.62;
  color: var(--meru-ink-muted);
}

.beat-col li:last-child { margin-bottom: 0; }

.beat-foot { margin-top: 22px; }

.beat-link {
  font-size: 0.86rem;
  color: var(--meru-accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.beat-link:hover { border-bottom-color: var(--meru-accent); }

/* ---------------------------------------------------------------- close */

.story-closing {
  padding: 56px 0 72px;
  border-top: 1px solid var(--meru-line);
  background: var(--meru-canvas-deep);
  text-align: center;
}

.story-closing h2 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  color: var(--meru-ink);
}

.story-closing p {
  max-width: 58ch;
  margin: 0 auto 22px;
  line-height: 1.72;
  color: var(--meru-ink-muted);
}

.story-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.story-disclaimer {
  margin-top: 28px;
  font-size: 0.76rem;
  color: var(--meru-ink-muted);
  opacity: 0.8;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------- small */

@media (max-width: 860px) {
  .rail-phases { grid-template-columns: 1fr; }
  .rail-phase { border-left: 0; border-top: 1px solid var(--meru-line); padding: 10px 16px; }
  .rail-phase:first-child { border-top: 0; }
  /* The rail would eat a phone screen; story.js switches to the compact
     control strip and hides the per-beat lists. */
  .story-rail.compact .rail-beats { display: none; }
  .story-rail.compact .rail-phase { padding: 8px 16px; }
  .story-rail.compact .rail-phases { grid-template-columns: repeat(3, 1fr); }
  .story-rail.compact .rail-phase-clock { display: none; }
  .story-rail.compact .rail-phase.active .rail-phase-label { color: var(--meru-accent-bright); }
  .hotspot-note { width: min(260px, 74vw); }
  .story-beat { padding: 32px 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hotspot-dot { animation: none; }
  .story-beat { scroll-behavior: auto; }
}
