/* The opening of the front page (hero-net.js): the sheet with the goal net and the market behind it, the board's
   roll and pulse, the playhead the goal turns into, the replay button. Loaded after styles.css; everything here is
   the hero's own. */

/* ── the sheet: paper with the net printed on it, in front of the chart. The paper never moves: the goal turns
      edge-on into the chart's playhead, and the chart prints out from it while the paper's grain fades. ── */
.hero-net { --hn-green: #1A6E42; --hn-red: #B5432B;
  /* the tooth of newsprint, as on the body in styles.css: the sheet is the same paper as the page */
  --hn-tooth: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.3' numOctaves='2' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 .1  0 0 0 0 .09  0 0 0 0 .07  0 0 0 .2 -.07'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
  position: absolute; z-index: 3; inset: 0; overflow: hidden; pointer-events: none; }
.hero-net[hidden] { display: none; }
.hero-net-paper { position: absolute; inset: 0; background: var(--paper) var(--hn-tooth); }
/* the face: everything printed on the sheet. It is the face that takes the kick of the shot, not the paper. */
.hero-net-face { position: absolute; inset: 0; will-change: transform; }
.hero-net-face canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* the stamp in the corner of the sheet: the minute, and a lamp */
.hero-net-stamp { position: absolute; left: 12px; top: 11px; margin: 0; display: flex; align-items: center; gap: 6px; font: 600 11px/1 var(--agate); letter-spacing: 0.09em; text-transform: uppercase; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.hero-net-stamp i { width: 7px; height: 7px; background: var(--ink); }
.hero-net-stamp.dim i { opacity: 0.16; }
.hero-net-stamp.hit i { background: var(--hn-green); }
.hero-net-stamp b { font-weight: 600; }
.hero-net-stamp span::before { content: '·'; margin-right: 6px; }

/* the call beside the net: a rule and three lines, each rising into its own line box */
.hero-net-call { position: absolute; left: 12px; bottom: 14%; margin: 0; padding-top: 12px; display: flex; flex-direction: column; align-items: flex-start; color: var(--ink); white-space: nowrap; }
.hero-net-call::before { content: ''; position: absolute; left: 0; top: 0; width: 44px; border-top: 2px solid var(--ink); transform: scaleX(var(--hn-rule, 0)); transform-origin: 0 50%; }
.hero-net-call > span { display: block; overflow: hidden; }
.hero-net-call > span > i { display: block; font-style: normal; transform: translate3d(0, 112%, 0); will-change: transform; }
.hero-net-call .k i { font: 600 12px/1.3 var(--agate); letter-spacing: 0.1em; text-transform: uppercase; }
.hero-net-call .k b { display: inline-block; width: 7px; height: 7px; margin-right: 7px; background: var(--hn-green); }
.hero-net-call .h { margin-top: 5px; }
.hero-net-call .h i { font: 400 38px/1 var(--display); text-transform: uppercase; letter-spacing: 0.01em; padding-top: 1px; }
.hero-net-call .p { margin-top: 4px; }
.hero-net-call .p i { font: 500 15px/1.3 var(--agate); font-variant-numeric: tabular-nums; color: var(--ink-2); }
.hero-net-call .p s { text-decoration: none; margin: 0 1px; }
.hero-net-call .p b { font-weight: 600; color: var(--ink); }
.hero-net-call .p em { font-style: normal; font-weight: 600; color: var(--hn-green); }
.hero-net.small .hero-net-stamp { left: 8px; top: 7px; font-size: 10.5px; }
/* on a phone the call stands above the crop marks at the foot of the sheet, clear of all three */
.hero-net.small .hero-net-call { left: 20px; right: 20px; bottom: 19px; padding-top: 9px; display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: end; justify-items: start; }
.hero-net.small .hero-net-call .k i { font-size: 11px; line-height: 1.55; }
.hero-net.small .hero-net-call .h { margin-top: 0; }
.hero-net.small .hero-net-call .h i { font-size: 25px; }
.hero-net.small .hero-net-call .p { grid-column: 1 / -1; margin-top: 2px; }
.hero-net.small .hero-net-call .p i { font-size: 14px; }

/* the goal's step on the chart itself, from register on: green, with what it was worth, until the playhead moves on */
.hero-net-step { position: absolute; width: 3px; background: var(--hn-green); opacity: 0; }
.hero-net-step b { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); opacity: var(--hn-gain, 0); font: 600 13px/1 var(--agate); font-style: normal; font-variant-numeric: tabular-nums; color: var(--hn-green); white-space: nowrap; }

/* ── the board when the goal goes in: the score snaps, the prices roll over, the one that jumped is green and underlined ── */
#leadMatch .mt-cell { position: relative; }
#leadMatch .mt-cell.fixture .mt-value b { display: inline-block; transform-origin: 0 60%; transform: scale(calc(1 + 0.14 * var(--hn-snap, 0))); }
#leadMatch .mt-cell.home .mt-value { color: color-mix(in srgb, #1A6E42 calc(var(--hn-pulse, 0) * 100%), var(--ink)); }
#leadMatch .mt-cell.away .mt-value { color: color-mix(in srgb, #B5432B calc(var(--hn-fall, 0) * 100%), var(--ink)); }
#leadMatch .mt-cell.home::after { content: ''; position: absolute; bottom: -1px; height: 3px; left: calc(var(--hn-u0, 0) * 100%); right: calc((1 - var(--hn-u1, 0)) * 100%); background: #1A6E42; }
#leadMatch .mt-cell .mt-value.hn-ghost { position: absolute; pointer-events: none; color: var(--ink); }
#leadMatch .hn-ghost[hidden] { display: none; }

/* ── the playhead: a thin rule, a flag on top, a dot on each line ── */
.match-stage .mt-rule { stroke: var(--ink); stroke-width: 1; stroke-dasharray: none; shape-rendering: crispEdges; }
.match-stage .mt-cap { fill: var(--ink); }
.match-stage .mt-dot { fill: var(--ink); stroke: var(--paper-hi); stroke-width: 1.5; }
.match-stage .mt-dot.home { stroke-width: 2; }
.match-stage .match-focus { width: 26px; height: 26px; margin: -13px 0 0 -13px; }

/* ── the caption, with the button that plays the opening again ── */
#leadMatch figcaption { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: start; }
.replay-goal { display: inline-flex; align-items: center; gap: 7px; height: 32px; margin-top: 1px; padding: 0 11px 0 9px; font: 500 13.5px/1 var(--agate); font-style: normal; color: var(--ink); background: transparent; border: 1px solid var(--ink); border-radius: 3px; white-space: nowrap; cursor: pointer; transition: background-color 0.15s, color 0.15s; }
.replay-goal svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: square; }
.replay-goal:hover { background: var(--ink); color: var(--paper); }
.replay-goal:active { background: var(--turf); border-color: var(--turf); color: var(--paper-hi); }
@media (max-width: 700px) {
  #leadMatch figcaption { grid-template-columns: 1fr; }
  .replay-goal { justify-self: start; height: 44px; padding: 0 14px 0 12px; font-size: 14.5px; }
}
/* between the one-column lead and a wide plate the board's cells are too narrow for "Northbridge win": name the side only */
@media (min-width: 1021px) and (max-width: 1180px) { #leadMatch .mt-win { display: none; } }
