/* joltcracker.com: the look of the coming-soon page (joltcracker-landing), grown into an app. */
:root {
  --bg: #14121a;
  --panel: #1f1c27;
  --panel2: #282433;
  --line: #3a3446;
  --ink: #ece6d6;
  --dim: #8e879c;
  --gold: #f2b134;
  --hot: #ff5d5d;
  --ok: #6fcf6f;
  --blue: #6aa8ff;
  --orange: #ff9a3c;
  --mono: ui-monospace, "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% -10%, #2c2440 0%, transparent 60%) no-repeat, var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  display: flex;
  flex-direction: column;
}
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); }
.dim { color: var(--dim); }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* --- top bar ------------------------------------------------------------------------------- */
.top {
  width: 100%; display: flex; align-items: center; gap: 1.2rem;
  padding: .7rem max(4vw, 1rem); border-bottom: 3px solid #000; background: rgba(20, 18, 26, .8);
}
.logo { font-family: var(--mono); font-weight: 700; font-size: 1.25rem; color: var(--ink); letter-spacing: -.03em; }
.logo span { color: var(--gold); }
.logo:hover { text-decoration: none; }
.top nav { display: flex; gap: 1rem; font-family: var(--mono); font-size: .9rem; margin-left: auto; align-items: center; }
.top nav a { color: var(--dim); }
.top nav a:hover, .top nav a.on { color: var(--ink); }
.pill {
  font-family: var(--mono); font-size: .72rem; padding: .05em .5em; border: 2px solid #000;
  background: var(--gold); color: #000; text-transform: uppercase; letter-spacing: .08em;
}

main { width: min(1180px, 94vw); margin: 0 auto; padding: 1.5rem 0 3rem; flex: 1; }
footer { width: min(1180px, 94vw); margin: 0 auto; text-align: center; padding: 1rem 0 2rem; font-size: .85rem; }
footer p { margin: .25rem 0; }

/* --- buttons + inputs (Minecraft buttons) ---------------------------------------------------- */
button, input {
  font: inherit; font-family: var(--mono); border: 3px solid #000; border-radius: 0;
}
button {
  background: #6b6b6b; color: #fff; padding: .3em .9em; cursor: pointer;
  box-shadow: inset -3px -3px 0 #444, inset 3px 3px 0 #a5a5a5; text-shadow: 2px 2px 0 #333;
}
button:hover { background: #7f86c9; box-shadow: inset -3px -3px 0 #4a4f80, inset 3px 3px 0 #b8bdf0; }
button:active { box-shadow: inset 3px 3px 0 #444; }
button:disabled { opacity: .5; cursor: default; }
button.small { font-size: .78rem; padding: .15em .6em; border-width: 2px; }
.seg { display: inline-flex; }
.seg button { font-size: .8rem; padding: .2em .7em; }
.seg button + button { border-left: 0; }
.seg button.on { background: var(--gold); color: #000; text-shadow: none; box-shadow: inset -3px -3px 0 #b07c17, inset 3px 3px 0 #ffd27a; }

/* --- home ------------------------------------------------------------------------------------ */
.hero { text-align: center; padding: 5vh 0 1rem; }
.eyebrow {
  font-family: var(--mono); color: var(--gold); letter-spacing: .25em;
  text-transform: uppercase; font-size: .8rem; margin: 0;
}
.hero h1 {
  font-family: var(--mono); font-size: clamp(2.6rem, 9vw, 5rem);
  line-height: 1; margin: .3em 0 .15em; letter-spacing: -.04em; text-shadow: 4px 4px 0 #000;
}
.hero h1 span { color: var(--gold); }
.tagline { font-size: 1.15rem; color: var(--dim); margin: 0 0 1.6rem; }
.crack { display: flex; margin: 0 auto .5rem; max-width: 620px; }
.crack input {
  flex: 1; min-width: 0; padding: .7em .8em; background: #000; color: var(--ink); border-right: 0;
}
.crack input:focus { outline: 2px solid var(--gold); outline-offset: -5px; }
.crack button { font-size: 1.05rem; }
.msg { color: var(--dim); font-size: .95rem; margin: 0; min-height: 1.6em; }
.msg.hot { color: var(--hot); }
.shake { animation: shake .3s steps(3) 1; }
@keyframes shake { 33% { transform: translateY(-3px); } 66% { transform: translateY(3px); } }

.queue { margin-top: 2rem; display: grid; gap: 1.6rem; }
.queue h2, .section-h {
  font-family: var(--mono); font-size: 1rem; color: var(--gold); margin: 0 0 .6rem;
  text-transform: lowercase; letter-spacing: .02em;
}
.queue h2 .dim { font-weight: 400; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .9rem; }
.card {
  display: flex; flex-direction: column; background: var(--panel); border: 3px solid #000;
  box-shadow: inset 0 0 0 2px var(--line); color: var(--ink); overflow: hidden;
}
.card:hover { text-decoration: none; box-shadow: inset 0 0 0 2px var(--gold); }
.card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: #000; }
.card .body { padding: .55rem .7rem .7rem; display: flex; flex-direction: column; gap: .35rem; }
.card .t { font-size: .92rem; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card .m { font-family: var(--mono); font-size: .75rem; color: var(--dim); display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.empty { color: var(--dim); font-size: .9rem; margin: 0; font-family: var(--mono); }
.prog { height: 8px; background: #000; border: 2px solid #000; position: relative; }
.prog i { position: absolute; inset: 0 auto 0 0; background: var(--gold); }

.badge {
  font-family: var(--mono); font-size: .72rem; font-weight: 700; padding: .05em .45em;
  border: 2px solid #000; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap;
}
.badge.clean { background: var(--ok); color: #000; }
.badge.check { background: var(--gold); color: #000; }
.badge.spliced { background: var(--hot); color: #000; }
.badge.none { background: #555; color: #eee; }
.badge.live { background: var(--blue); color: #000; }

.how {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem; margin: 3rem 0 1.5rem;
}
.how div { background: var(--panel); padding: 1rem 1.1rem; border-left: 4px solid var(--gold); }
.how h2 { font-family: var(--mono); font-size: 1rem; margin: 0 0 .3rem; color: var(--gold); }
.how p { margin: 0; font-size: .93rem; color: #cfc8d8; }
.demo {
  background: var(--panel); border: 3px solid #000; box-shadow: inset 0 0 0 2px var(--line);
  padding: 1.2rem 1rem 1rem; text-align: center; max-width: 560px; margin: 0 auto;
}
#bar { width: min(360px, 100%); height: auto; image-rendering: pixelated; }
.readout {
  font-family: var(--mono); font-size: .88rem; color: var(--dim);
  display: flex; gap: 1.2rem; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: .6rem;
}
.readout b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.readout button { font-size: .78rem; }
.caption { color: var(--dim); font-size: .88rem; margin: .7rem 0 0; min-height: 1.5em; }

/* --- video page ------------------------------------------------------------------------------ */
.vtop { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 1.2rem; align-items: start; }
@media (max-width: 900px) { .vtop { grid-template-columns: 1fr; } }
.player { aspect-ratio: 16 / 9; background: #000; border: 3px solid #000; box-shadow: inset 0 0 0 2px var(--line); position: relative; }
.player iframe, .player > div { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player .ph { display: flex; align-items: center; justify-content: center; color: var(--dim); font-family: var(--mono); font-size: .9rem; padding: 1rem; text-align: center; }
.side { display: flex; flex-direction: column; gap: .8rem; min-width: 0; }
.side h1 { font-size: 1.2rem; line-height: 1.3; margin: 0; word-break: break-word; }
.side h1 a { color: var(--ink); }
.verdict {
  background: var(--panel); border: 3px solid #000; padding: .7rem .85rem;
  border-left: 6px solid #555; display: flex; flex-direction: column; gap: .3rem;
}
.verdict.clean { border-left-color: var(--ok); }
.verdict.check { border-left-color: var(--gold); }
.verdict.spliced { border-left-color: var(--hot); }
.verdict .k { font-family: var(--mono); font-weight: 700; font-size: 1.15rem; text-transform: uppercase; letter-spacing: .04em; }
.verdict.clean .k { color: var(--ok); }
.verdict.check .k { color: var(--gold); }
.verdict.spliced .k { color: var(--hot); }
.verdict .x { color: #cfc8d8; font-size: .92rem; }
.verdict .p { color: var(--dim); font-size: .78rem; font-family: var(--mono); }
.status { font-family: var(--mono); font-size: .85rem; color: var(--dim); margin: 0; display: flex; gap: .5rem; align-items: baseline; }
.status.loud { color: var(--hot); font-weight: 600; }
.status .dot { width: .6em; height: .6em; background: var(--blue); display: inline-block; flex: none; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }

/* live progress: a moving striped bar (clearly busy), steps with times, the minutes being read */
.progress { background: var(--panel); border: 3px solid #000; box-shadow: inset 0 0 0 2px var(--line); padding: .7rem .8rem; display: flex; flex-direction: column; gap: .55rem; }
.phead { display: flex; justify-content: space-between; gap: .8rem; align-items: baseline; flex-wrap: wrap; font-family: var(--mono); font-size: .88rem; }
.phead b { color: var(--blue); font-weight: 600; }
.phead span { color: var(--gold); font-size: .82rem; }
.pbar { height: 16px; background: #000; border: 2px solid #000; box-shadow: inset 0 0 0 1px var(--line); position: relative; overflow: hidden; }
.pbar i, .mini i {
  position: absolute; inset: 0 auto 0 0; background-color: var(--blue);
  background-image: linear-gradient(45deg, rgba(255,255,255,.22) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.22) 50%, rgba(255,255,255,.22) 75%, transparent 75%);
  background-size: 16px 16px; animation: march .8s linear infinite; transition: width .6s;
}
.pbar.indet i, .mini.indet i { background-color: #3d5f94; }
@keyframes march { to { background-position: 16px 0; } }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .15rem; font-family: var(--mono); font-size: .8rem; }
.steps li { display: grid; grid-template-columns: 1.2em 8.5em 1fr; gap: .4rem; align-items: baseline; color: var(--dim); }
.steps li::before { content: "·"; text-align: center; }
.steps li.done::before { content: "✓"; color: var(--ok); }
.steps li.active { color: var(--ink); }
.steps li.active::before { content: "▶"; color: var(--blue); animation: blink 1s steps(2) infinite; }
.steps .sd { color: var(--dim); font-variant-numeric: tabular-nums; }
.steps li.active .sd { color: #cfc8d8; }
.chunks-now { display: grid; gap: .25rem; border-top: 2px solid #000; padding-top: .5rem; }
.chunkrow { display: grid; grid-template-columns: max-content 70px 1fr; gap: .5rem; align-items: center; font-family: var(--mono); font-size: .75rem; color: #cfc8d8; }
.chunkrow .cn { color: var(--dim); font-variant-numeric: tabular-nums; }
.chunkrow .cd { color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini { height: 10px; background: #000; border: 1px solid #000; box-shadow: inset 0 0 0 1px var(--line); position: relative; overflow: hidden; display: block; }
.mini i { background-size: 10px 10px; }
.banner { background: #3a2c10; border: 3px solid #000; padding: .55rem .75rem; font-size: .88rem; display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: .15rem .9rem; font-size: .83rem; margin: 0; }
.facts dt { color: var(--dim); font-family: var(--mono); }
.facts dd { margin: 0; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.changes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; max-height: 340px; overflow-y: auto; }
.changes li {
  background: var(--panel); border: 2px solid #000; padding: .35rem .55rem; cursor: pointer;
  display: grid; grid-template-columns: auto 1fr; gap: .1rem .6rem; align-items: baseline; font-size: .84rem;
}
.changes li:hover { background: var(--panel2); }
.changes li .w { font-family: var(--mono); color: var(--dim); font-size: .78rem; grid-column: 2; }
.changes li.splice .badge, .changes li.restart .badge { background: var(--hot); color: #000; }
.changes li.long-pause .badge { background: var(--orange); color: #000; }
.changes li.pause .badge { background: #555; color: #eee; }
.changes li.lone .badge { background: var(--orange); color: #000; }
.changes .more { cursor: default; background: none; border-style: dashed; color: var(--dim); display: block; }
.changes .more:hover { background: none; }

.graphbox { margin-top: 1.3rem; background: var(--panel); border: 3px solid #000; box-shadow: inset 0 0 0 2px var(--line); padding: .8rem .8rem .6rem; }
.controls { display: flex; flex-wrap: wrap; gap: .6rem 1.1rem; align-items: center; margin-bottom: .5rem; font-size: .85rem; }
.controls label { display: inline-flex; gap: .35rem; align-items: center; cursor: pointer; font-family: var(--mono); font-size: .8rem; color: #cfc8d8; }
.controls input[type=checkbox] { accent-color: var(--gold); width: 1rem; height: 1rem; border: 0; }
.controls .grow { flex: 1; }
.key { width: .75rem; height: .75rem; display: inline-block; border-radius: 50%; border: 2px solid transparent; }
.key.precise { background: var(--ok); }
.key.inferred { background: var(--blue); }
.key.borrowed { background: transparent; border-color: #9a94a6; }
.key.lone { background: var(--orange); border-color: #000; border-radius: 0; transform: rotate(45deg) scale(.85); }
.key.prov { background: transparent; border-color: var(--gold); border-style: dashed; }
.key.change { width: .45rem; height: .75rem; border-radius: 0; background: var(--hot); }
.key.amb { width: 2px; height: .8rem; border-radius: 0; background: var(--hot); }
#graph { position: relative; min-height: 360px; }
#graph .u-legend { display: none; }
.uplot { font-family: var(--mono); }
.playhead { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: rgba(255, 255, 255, .55); pointer-events: none; }
.hoverring { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border: 2px solid #fff; border-radius: 50%; pointer-events: none; }
.tip {
  position: absolute; z-index: 5; pointer-events: none; background: #0c0b10; border: 2px solid #000;
  box-shadow: inset 0 0 0 1px var(--line); padding: .35rem .5rem; font-family: var(--mono); font-size: .75rem;
  line-height: 1.4; white-space: nowrap; color: var(--ink);
}
.tip b { color: var(--gold); font-weight: 600; }
.covwrap { position: relative; margin-top: .25rem; }
#cov { display: block; width: 100%; height: 34px; cursor: pointer; }
.hint { color: var(--dim); font-size: .76rem; margin: .45rem 0 0; font-family: var(--mono); }
.empty-graph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--dim); font-family: var(--mono); font-size: .9rem; pointer-events: none; text-align: center; padding: 1rem; }
details.report { margin-top: 1rem; }
details.report summary { cursor: pointer; font-family: var(--mono); font-size: .85rem; color: var(--dim); }
details.report pre { background: #0c0b10; border: 3px solid #000; padding: .8rem; overflow-x: auto; font-size: .76rem; line-height: 1.45; color: #cfc8d8; }
.notfound { background: var(--panel); border: 3px solid #000; padding: 1.2rem; display: flex; flex-direction: column; gap: .7rem; align-items: flex-start; }
.notfound p { margin: 0; }

/* --- nodes ------------------------------------------------------------------------------------ */
.nodes { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .9rem; }
.node { background: var(--panel); border: 3px solid #000; box-shadow: inset 0 0 0 2px var(--line); padding: .8rem .9rem; display: flex; flex-direction: column; gap: .45rem; }
.node h3 { margin: 0; font-family: var(--mono); font-size: 1.1rem; display: flex; gap: .5rem; align-items: center; }
.node .slots { display: flex; gap: 4px; flex-wrap: wrap; }
.node .slots i { width: 18px; height: 18px; background: #000; border: 2px solid #000; box-shadow: inset 0 0 0 2px var(--line); }
.node .slots i.busy { background: var(--gold); box-shadow: inset -3px -3px 0 #b07c17, inset 3px 3px 0 #ffd27a; }

@media (prefers-reduced-motion: reduce) { .shake, .status .dot, .pbar i, .mini i, .steps li.active::before { animation: none; } }

/* --- how it works (article) -------------------------------------------------------------------- */
.article { max-width: 760px; }
.article h1 { font-family: var(--mono); font-size: clamp(1.7rem, 5vw, 2.5rem); line-height: 1.15; margin: .3em 0 .4em; letter-spacing: -.02em; text-shadow: 3px 3px 0 #000; }
.article h2 { font-family: var(--mono); color: var(--gold); font-size: 1.1rem; margin: 2rem 0 .5rem; }
.article p, .article li { color: #d8d1e2; }
.article code { background: #000; padding: .05em .35em; color: var(--gold); }
.article .lead { font-size: 1.12rem; color: var(--ink); }
.steps-long { padding-left: 1.3rem; display: grid; gap: .6rem; }
.steps-long li::marker { color: var(--gold); font-family: var(--mono); font-weight: 700; }
.defs { list-style: none; padding: 0; display: grid; gap: .55rem; }
.defs li { background: var(--panel); border-left: 4px solid var(--line); padding: .5rem .75rem; }
.defs .badge { margin-right: .4rem; }
.more-link { text-align: center; margin: -.4rem 0 2.2rem; font-size: .95rem; }
.cta { margin-top: 2.5rem; font-family: var(--mono); font-size: 1.1rem; }
.graph { margin: .8rem 0; text-align: center; }
.graph svg { width: min(560px, 100%); }
.axis { stroke: var(--dim); stroke-width: 2; }
.trace { fill: none; stroke: var(--ink); stroke-width: 4; stroke-linejoin: miter; }
.ring { fill: none; stroke: var(--hot); stroke-width: 3; stroke-dasharray: 5 4; }
.lbl { font: 12px var(--mono); fill: var(--ink); }
.lbl.hot { fill: var(--hot); font-weight: 700; }
.lbl.dim { fill: var(--dim); }
.card .el { font-variant-numeric: tabular-nums; }

/* drag-to-zoom selection: uPlot's default (7% black) is invisible on the dark graph */
#graph .u-select {
  background: rgba(242, 177, 52, .22);
  border-left: 2px solid var(--gold); border-right: 2px solid var(--gold);
  box-sizing: border-box;
}
