@font-face {
  font-family: "Orbitron"; font-weight: 900; font-style: normal; font-display: swap;
  src: url("/fonts/orbitron-900-latin.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("/fonts/jetbrains-mono-400-latin.woff2") format("woff2");
}
:root {
  --bg: #04050a;
  --violet: #7c5cff;
  --cyan: #00e5ff;
  --pink: #ff3d81;
  --dim: rgba(255,255,255,.45);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; background: var(--bg); color: #fff; }
body { font-family: system-ui, sans-serif; cursor: crosshair; user-select: none; }
#c { position: fixed; inset: 0; display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* vignette + scanlines */
.overlay { position: fixed; inset: 0; pointer-events: none; }
.vignette { background: radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,.75) 100%); }
/* plain alpha, no blend mode: a full-screen mix-blend-mode over the animating canvas costs a recomposite every frame */
.scan { background: repeating-linear-gradient(to bottom, rgba(255,255,255,.018) 0 1px, transparent 1px 3px); }

/* divider under the domain */
#sub { position: fixed; left: 0; right: 0; pointer-events: none; padding: 0 16px; }
#sub .line {
  width: 0; height: 1px; margin: 0 auto;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--violet), var(--pink), transparent);
  box-shadow: 0 0 12px rgba(0,229,255,.6);
  transition: width 1.2s cubic-bezier(.2,.8,.2,1);
}
#sub .en {
  margin-top: 20px; text-align: center;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: clamp(11px, 1.3vw, 14px); letter-spacing: .45em; padding-left: .45em; color: rgba(255,255,255,.62);
  opacity: 0; transform: translateY(10px);
  transition: opacity 1s .5s, transform 1s .5s cubic-bezier(.2,.8,.2,1);
}
#sub .en b { font-weight: 400; background: linear-gradient(90deg, var(--cyan), var(--violet), var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; }
#sub.show .line { width: min(480px, 72vw); }
/* market event line: briefly takes the tagline's place */
#sub .evt {
  position: absolute; left: 16px; right: 16px; top: 21px; text-align: center;
  font-family: "JetBrains Mono", ui-monospace, monospace; font-size: clamp(11px, 1.3vw, 14px);
  letter-spacing: .45em; padding-left: .45em; color: rgba(255,255,255,.85); white-space: nowrap;
  opacity: 0; transition: opacity .5s;
}
#sub .evt i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: .9em; vertical-align: 1px; background: rgba(255,255,255,.4); }
#sub .evt.open i { background: #19f5a0; box-shadow: 0 0 8px #19f5a0; }
#sub .evt.lunch i { background: #ffc857; box-shadow: 0 0 8px #ffc857; }
#sub.show.alt .en { opacity: 0; transition: opacity .4s; }
#sub.show.alt .evt { opacity: 1; transition: opacity .5s .3s; }
#sub.show .en { opacity: 1; transform: none; }

/* shown only when JS is off */
.nojs { position: fixed; inset: 0; display: grid; place-items: center; font: 900 clamp(32px, 9vw, 120px) "Orbitron", sans-serif;
        background: linear-gradient(90deg, var(--cyan), var(--violet), var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* corner HUD */
.hud {
  position: fixed; font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px; letter-spacing: .18em; color: var(--dim);
  opacity: 0; transition: opacity 1.2s; pointer-events: none; text-transform: uppercase;
}
.hud.show { opacity: 1; }
.tl { top: 20px; left: 20px; } .tr { top: 20px; right: 20px; text-align: right; }
.bl { bottom: 20px; left: 20px; } .br { bottom: 20px; right: 20px; display: flex; align-items: center; }
.hud .sep { margin: 0 12px; opacity: .5; }
.hud i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--cyan);
         box-shadow: 0 0 8px var(--cyan); margin-right: 8px; vertical-align: 1px; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .15; } }
.hud-btn { all: unset; cursor: pointer; color: inherit; font: inherit; letter-spacing: inherit; transition: color .2s; }
.hud.show .hud-btn { pointer-events: auto; }
.hud-btn:hover { color: var(--cyan); }
.hud-btn:focus-visible { outline: 1px solid var(--cyan); outline-offset: 4px; }

/* contact pill: gradient border + sheen + breathing halo */
#contact {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  padding: 9px 16px 9px 14px; border-radius: 999px;
  color: #fff; letter-spacing: .24em; font-size: 11px; text-transform: uppercase;
  border: 1px solid transparent;
  background:
    linear-gradient(110deg, transparent 35%, rgba(255,255,255,.22) 50%, transparent 65%) 0 0 / 250% 100% no-repeat padding-box,
    linear-gradient(90deg, rgba(0,229,255,.16), rgba(124,92,255,.12), rgba(255,61,129,.12)) padding-box,
    linear-gradient(#0a0b14, #0a0b14) padding-box,
    linear-gradient(90deg, var(--cyan), var(--violet), var(--pink)) border-box;
  animation: sheen 3.6s ease-in-out infinite;
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s;
}
#contact::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  border: 1px solid rgba(0,229,255,.7); animation: halo 2.8s ease-out infinite;
}
#contact.on::before { animation: none; opacity: 0; }
#contact .dot { width: 6px; height: 6px; border-radius: 50%; background: #3dff8a; box-shadow: 0 0 8px #3dff8a; animation: blink 1.6s infinite; }
#contact .arr { color: var(--cyan); transition: transform .25s cubic-bezier(.2,.8,.2,1); }
@media (hover: hover) {
  #contact:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 6px 24px rgba(0,229,255,.3); }
  #contact:hover .arr { transform: translateX(4px); }
}
#contact:active { transform: scale(.97); transition-duration: .08s; }
#contact.on { letter-spacing: .08em; text-transform: none; }
#contact.on .lbl { font-size: 12px; }
@keyframes sheen { 0%, 55% { background-position: 160% 0, 0 0, 0 0, 0 0; } 100% { background-position: -60% 0, 0 0, 0 0, 0 0; } }
@keyframes halo { 0% { transform: scale(1); opacity: .9; } 70%, 100% { transform: scale(1.12, 1.6); opacity: 0; } }
#contact[data-tip]::after {
  content: attr(data-tip); position: absolute; right: 0; bottom: calc(100% + 8px);
  padding: 4px 8px; background: var(--cyan); color: #04050a; letter-spacing: .1em;
  white-space: nowrap; font-size: 10px; border-radius: 4px; animation: tip .2s ease-out;
}
@keyframes tip { from { opacity: 0; transform: translateY(4px); } }

/* global sessions panel */
#mk {
  position: fixed; left: 50%; bottom: 68px; transform: translate(-50%, 12px);
  width: min(940px, calc(100% - 32px));
  font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px;
  opacity: 0; pointer-events: none;
  transition: opacity .8s, transform .8s cubic-bezier(.2,.8,.2,1);
}
#mk.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#mk.off { display: none; }
#mk .head, #mk .foot { display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  color: var(--dim); letter-spacing: .18em; font-size: 10px; white-space: nowrap; }
#mk .head { padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,.1); }
#mk .head b { color: rgba(255,255,255,.75); font-weight: 400; }
#mk .head b::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan); box-shadow: 0 0 8px var(--cyan); margin-right: 8px; vertical-align: 1px; animation: blink 1.4s infinite; }
#mk .stat em { font-style: normal; color: var(--cyan); font-size: 12px; letter-spacing: .06em; }
#mk .stat em.g { color: #19f5a0; }
#mk .list { padding: 2px 0 6px; }
#mk .row {
  display: grid; grid-template-columns: 4.4em 9.6em minmax(0, 1fr) 16em; gap: 16px; align-items: center;
  padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.04); color: rgba(255,255,255,.85);
  opacity: 0; transform: translateY(6px); transition: opacity .5s, transform .5s;
}
#mk.show .row { opacity: 1; transform: none; }
/* keep the row at 12px so its em-based grid columns line up with the data rows; shrink only the labels */
#mk .row.ticks { padding: 6px 0 2px; border: 0; color: rgba(255,255,255,.28); letter-spacing: .1em; }
#mk .ticks .tk span { font-size: 9px; }
#mk .cd { color: var(--violet); letter-spacing: .06em; }
#mk .ct { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#mk .ct small { margin-left: 8px; color: rgba(255,255,255,.4); font-size: 11px; }
#mk .tk { position: relative; height: 8px; border-radius: 2px; background: rgba(255,255,255,.045); }
#mk .ticks .tk { height: 10px; background: none; }
#mk .ticks .tk span { position: absolute; top: 0; transform: translateX(-50%); }
#mk .seg { position: absolute; top: 0; bottom: 0; border-radius: 2px; background: rgba(124,92,255,.38); }
#mk .seg.past { background: rgba(255,255,255,.1); }
#mk .ticks .tk span.nowlab { color: rgba(255,255,255,.75); }
#mk .seg.live { background: linear-gradient(90deg, var(--cyan), var(--violet), var(--pink), var(--cyan)); background-size: 300% 100%;
  animation: flow 4s linear infinite; box-shadow: 0 0 10px rgba(0,229,255,.45); }
@keyframes flow { to { background-position: -300% 0; } }
#mk .tk .idle { position: absolute; left: calc(25% + 8px); right: 0;   /* 25% = the NOW cursor (6 h back of a 24 h track) */ top: 50%; transform: translateY(-50%); text-align: center;
  font-size: 9px; letter-spacing: .3em; line-height: 1; color: rgba(255,255,255,.22); white-space: nowrap; overflow: hidden; }
#mk .cur { position: absolute; top: -4px; bottom: -4px; width: 1px; margin-left: -.5px; background: #fff; box-shadow: 0 0 6px #fff, 0 0 12px var(--cyan); }
#mk .st { text-align: right; white-space: nowrap; }
#mk .st i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; background: rgba(255,255,255,.25); }
#mk .st b { font-weight: 400; margin-right: 10px; letter-spacing: .12em; color: rgba(255,255,255,.4); }
#mk .st small { font-size: 11px; color: rgba(255,255,255,.5); }
#mk .st .lab { color: rgba(255,255,255,.3); }
#mk .row.open .st i { background: #19f5a0; box-shadow: 0 0 8px #19f5a0; animation: blink 1.6s infinite; }
#mk .row.open .st b { color: #19f5a0; }
#mk .row.open .cd { color: var(--cyan); }
#mk .row.lunch .st i { background: #ffc857; box-shadow: 0 0 8px #ffc857; }
#mk .row.lunch .st b { color: #ffc857; }
#mk .row.flash { animation: rowflash 2s ease-out; }
@keyframes rowflash { 0% { background: rgba(0,229,255,.18); } }
#mk .lg { display: inline-block; width: 12px; height: 4px; border-radius: 1px; margin: 0 6px 0 0; vertical-align: 2px; background: rgba(124,92,255,.5); }
#mk .lg + .lg, #mk .legend .lg:not(:first-child) { margin-left: 14px; }
#mk .lg.live { background: linear-gradient(90deg, var(--cyan), var(--violet), var(--pink)); }
#mk .lg.nowmk { width: 1px; height: 10px; vertical-align: -1px; background: #fff; box-shadow: 0 0 6px #fff; }
#mk .fl { display: flex; align-items: baseline; gap: 18px; }
#mk .tz { all: unset; cursor: pointer; color: rgba(255,255,255,.3); letter-spacing: inherit; font: inherit; transition: color .2s; }
#mk .tz:hover { color: rgba(255,255,255,.6); }
#mk .tz:focus-visible { outline: 1px solid var(--cyan); outline-offset: 3px; }
#mk .tz .on { color: var(--cyan); }
#mk .foot { padding-top: 8px; border-top: 1px solid rgba(255,255,255,.06); color: rgba(255,255,255,.3); }

@media (max-height: 760px) { #mk .row { padding: 4px 0; } }
@media (max-width: 640px) {
  #mk { bottom: 62px; }
  #mk .row { grid-template-columns: 3.8em minmax(0, 1fr) 8.2em; gap: 10px; }
  #mk .ct, #mk .st b, #mk .st .lab, #mk .head .ttl, #mk .foot .legend, #mk .foot .rh { display: none; }
  #sub .evt { letter-spacing: .22em; padding-left: .22em; }
  #sub .en { letter-spacing: .22em; padding-left: .22em; }
  #mk .stat .tot, #mk .stat .nx { display: none; }
}

@media (max-width: 600px) {
  #contact { padding: 7px 12px 7px 11px; font-size: 10px; gap: 8px; }
  .hud { font-size: 9px; letter-spacing: .12em; }
  .bl, .tr .pre { display: none; }
  .tl, .tr { top: 16px; } .tl, .bl { left: 16px; } .tr, .br { right: 16px; } .bl, .br { bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; transition-delay: 0s !important; animation: none !important; }
}
