/* SourceLess Chain — Intellectual property of Alexandru Marius Stratulat and the SourceLess team. GitHub: alexccoin · Email: alex@strlabs.io · All rights reserved. No use without written consent. See LICENSE. */

/* Guide 1 on top of the Inside Asgard base: the language switch, the hero vault, real screens in a
   dark bezel, the "what you need" grid, the never list, help cards and the checklist. One dark look. */

html { color-scheme: dark; background: #030408; }
body { background: #030408; }

/* ---------- one page, two languages ---------- */
html:not(.de) [lang="de"]:not(html):not([data-lang-to]),
html.de [lang="en"]:not(html):not([data-lang-to]) { display: none !important; }
[lang="en"] q, q:lang(en) { quotes: "“" "”" "‘" "’"; }
[lang="de"] q, q:lang(de) { quotes: "„" "“" "‚" "‘"; }
q { color: var(--ink); }

.lang-sw {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 3px;
  border-radius: 999px;
  background: var(--glass-sheen), var(--glass-fill);
  border: 1px solid rgba(255, 255, 255, .2);
  box-shadow: var(--glass-bevel);
}
.lang-sw a {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font: 700 12px/1 var(--f-d);
  letter-spacing: .06em;
  color: var(--muted);
  text-decoration: none;
  transition: background .25s var(--ease), color .25s var(--ease);
}
.lang-sw a:hover { color: var(--ink); }
.lang-sw a[aria-current="true"] { background: var(--lime); color: #071003; }
.lang-sw a:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }

/* ---------- hero ---------- */
/* no stacking context here: the hero's labels must rise above the diagram canvas (z 2) */
.hero { z-index: auto; }
.h-guide { font-size: clamp(34px, 4.3vw, 64px); max-width: 15ch; line-height: 1.02; }
html.de .h-guide { font-size: clamp(30px, 3.7vw, 56px); max-width: 17ch; }
.hero-stage {
  position: absolute;
  right: 0;
  top: 4%;
  width: min(44vw, calc(100vw - 800px));
  height: 88%;
  /* above the diagram canvas (z 2), so the hero's labels are not painted over */
  z-index: 3;
  pointer-events: none;
}
.hero-stage .stage { position: absolute; inset: 0; background: none; border: 0; padding: 0; }
.hero-stage .stage.is-3d .s3d { height: 100%; }
.hero-stage .stage::before, .hero-stage .stage::after { display: none !important; }
.hero.hero-3d .hero-fig { display: none; }
.hero-fig {
  position: absolute;
  inset: 8% 4% 6% 4%;
  width: 92%;
  height: auto;
  max-height: 86%;
}
.hero-fig .hf-ring { fill: none; stroke: rgba(167, 255, 82, .28); stroke-width: 6; stroke-dasharray: 1.2 3.2; }
.hero-fig .hf-vault { fill: rgba(191, 233, 255, .06); stroke: #66DCCE; stroke-width: 2; }
.hero-fig .hf-dial { fill: none; stroke: #66DCCE; stroke-width: 2; }
.hero-fig .hf-key { fill: none; stroke: #A7FF52; stroke-width: 3; stroke-linecap: round; }
.hero-fig .hf-coin circle { fill: #A7FF52; }
.hero-fig .hf-coin text { font: 700 10px var(--f-d); fill: #0a1a05; text-anchor: middle; }
.hero-fig .hf-drop { stroke: rgba(167, 255, 82, .55); stroke-width: 2; stroke-dasharray: 3 5; }
.hero-fig .hf-paper rect { fill: #e9eef6; }
.hero-fig .hf-paper path { stroke: #2a3550; stroke-width: 2; }
@media (prefers-reduced-motion: no-preference) {
  .hero-fig .hf-coin { animation: hfDrop 3.2s cubic-bezier(.55, 0, .7, .4) infinite; }
}
@keyframes hfDrop { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 70% { transform: translateY(96px); opacity: 1; } 80%, 100% { transform: translateY(104px); opacity: 0; } }
.hero .facts dd { font-size: clamp(20px, 1.9vw, 28px); }

/* ---------- overview, grouped by stage ---------- */
.ov-parts { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 26px; }
.ov-part-h {
  margin: 0 0 12px;
  font: 700 13px/1.2 var(--f-m);
  letter-spacing: .04em;
  color: var(--lime);
}
.ov-parts .ov-grid { margin: 0; }

/* ---------- words on the screen, buttons, codes ---------- */
.ui-btn {
  display: inline-block;
  padding: 0 .5em;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--lime) 55%, transparent);
  background: color-mix(in srgb, var(--lime) 12%, transparent);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.chap-text code, .chap-more code, .foot code, .trouble code, .g-note code, .promise code {
  font: 400 .92em/1.4 var(--f-m);
  padding: .05em .35em;
  border-radius: 5px;
  background: rgba(102, 220, 206, .1);
  color: #bff3ec;
  overflow-wrap: anywhere;
}
.st-t { display: block; }

/* ---------- what you need ---------- */
.need {
  list-style: none;
  margin: 4px 0 22px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.need li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .03);
  line-height: 1.4;
}
.need svg { width: 30px; height: 30px; fill: none; stroke: var(--aqua); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- if you see / do this ---------- */
.ifsee { display: grid; gap: 8px; margin: 2px 0 20px; }
.ifsee-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .12);
}
.ifsee-row p { margin: 0; padding: 10px 14px; line-height: 1.42; }
.ifsee-row p:first-child { background: rgba(255, 255, 255, .035); }
.ifsee-row p:last-child { color: var(--ink); font-weight: 600; }
.ifsee-row.tone-go p:last-child { background: rgba(167, 255, 82, .1); color: #d9ffb3; }
.ifsee-row.tone-wait p:last-child { background: rgba(154, 136, 255, .12); color: #ded8ff; }
.ifsee small, .trouble small {
  display: block;
  margin-bottom: 3px;
  font: 400 11px/1.2 var(--f-m);
  letter-spacing: .04em;
  color: var(--muted);
}

/* ---------- notes ---------- */
.g-note {
  margin: 18px 0 4px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(102, 220, 206, .28);
  background: rgba(102, 220, 206, .06);
  color: var(--ink3);
}
.g-note p { margin: 0 0 .5em; }
.g-note p:last-child { margin-bottom: 0; }
.g-note .g-note-t { font: 700 15px/1.3 var(--f-u); color: var(--ink); letter-spacing: .01em; }
.g-note.tone-strong { border-color: rgba(167, 255, 82, .42); background: rgba(167, 255, 82, .07); color: var(--ink); font-weight: 600; }
.ex-addr code { display: inline; word-break: break-all; }
.ex-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 8px;
  border-radius: 6px;
  border: 1.5px solid #8a72ff;
  color: #cfc5ff;
  font: 700 11.5px/1.5 var(--f-b);
  white-space: nowrap;
}

/* ---------- the never list ---------- */
.steps-never li::before { color: #FF7A85 !important; }
.steps-never li.now { border-color: rgba(255, 122, 133, .45) !important; background: rgba(255, 122, 133, .07) !important; }
.steps-never b { color: #ffb3ba; }

/* ---------- real screens ---------- */
.screens { position: relative; z-index: 3; padding-bottom: 24px; }
.screens-h {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 4px 0 14px;
  font: 700 clamp(15px, 1.2vw, 17px)/1.3 var(--f-u);
  color: var(--ink);
}
.screens-h .tag {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--lime);
  color: #071003;
  font: 700 10.5px/1.4 var(--f-d);
  letter-spacing: .06em;
}
.screens-note { font: 400 12px/1.3 var(--f-m); color: var(--muted); }
.screens-grid { display: grid; gap: 18px; align-items: start; }
.screens-grid.n1 { grid-template-columns: minmax(0, 760px); }
.screens-grid.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.screens-grid.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.screens-grid.n1 .screen.is-tall { max-width: 520px; }
.screens-grid .screen.is-wide { grid-column: 1 / -1; }
.screens-grid.n2 .screen.is-wide { grid-column: auto; }
.screen { margin: 0; min-width: 0; }
.screen-label { margin: 0 0 6px; font: 700 12px/1.2 var(--f-m); color: var(--lime); }
.screen-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 14px;
  overflow: hidden;
  background: #0b101b;
  cursor: zoom-in;
  box-shadow: 0 22px 50px -26px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .12);
  transition: border-color .25s var(--ease), transform .35s var(--ease);
}
.screen-open:hover { border-color: rgba(167, 255, 82, .5); }
.screen-open:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }
.screen-open img { display: block; width: 100%; height: auto; }
.screen-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  background: linear-gradient(180deg, #151c2c, #0e1422);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.screen-bar i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .18); }
.screen-bar span {
  margin-left: 10px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  font: 400 11px/1.4 var(--f-m);
  color: var(--muted);
}
.screen figcaption { margin: 8px 2px 0; font: 400 13px/1.45 var(--f-b); color: var(--muted); }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- the big moment: depth 12 gets the taller stage ---------- */
.chap-big .stage.is-3d .s3d { height: clamp(320px, 56vh, 540px); }

/* ---------- help ---------- */
.chap-wide .chap-head { margin-bottom: 20px; }
.trouble {
  position: relative;
  z-index: 3;
  list-style: none;
  margin: 0;
  padding-bottom: 28px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.trouble li {
  display: grid;
  grid-template-rows: auto auto;
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .12);
}
.trouble p { margin: 0; padding: 11px 15px; font: 400 14.5px/1.5 var(--f-b); }
.trouble .tr-see { background: rgba(255, 255, 255, .035); color: var(--ink3); }
.trouble .tr-do { background: rgba(167, 255, 82, .07); color: var(--ink); font-weight: 600; }

/* ---------- checklist ---------- */
.check-wrap { position: relative; z-index: 3; padding-bottom: 30px; }
.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  counter-reset: ck;
}
.checklist li {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 4px 10px 4px 4px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .03);
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
.checklist label { flex: 1; display: flex; align-items: center; gap: 12px; padding: 10px 8px; cursor: pointer; font: 600 15.5px/1.35 var(--f-b); color: var(--ink2); }
.checklist input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.checklist .ck {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  border: 2px solid rgba(255, 255, 255, .4);
  display: grid;
  place-items: center;
  transition: background .2s var(--ease), border-color .2s var(--ease);
}
.checklist input:checked + .ck { background: var(--lime); border-color: var(--lime); }
.checklist input:checked + .ck::after { content: ""; width: 10px; height: 6px; border: solid #071003; border-width: 0 0 2.5px 2.5px; transform: translateY(-1px) rotate(-45deg); }
.checklist input:focus-visible + .ck { outline: 2px solid var(--lime); outline-offset: 3px; }
.checklist li:has(input:checked) { border-color: rgba(167, 255, 82, .45); background: rgba(167, 255, 82, .06); }
.checklist li:has(input:checked) .ck-t { color: var(--ink); }
.ck-ch { font: 400 12px/1 var(--f-m); color: var(--muted); text-decoration: none; padding: 6px 8px; border-radius: 6px; }
.ck-ch:hover, .ck-ch:focus-visible { color: var(--lime); background: rgba(167, 255, 82, .08); }
.check-count { margin: 16px 0 0; font: 800 clamp(26px, 3vw, 40px)/1 var(--f-d); color: var(--ink); }
.checklist.all-done ~ .check-count, .check-wrap:has(.all-done) .check-count { color: var(--lime); }

/* ---------- full-size viewer ---------- */
.viewer {
  width: min(96vw, 1400px);
  max-height: 94vh;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .2);
  background: #070b14;
  color: var(--ink2);
}
.viewer::backdrop { background: rgba(0, 0, 0, .78); }
.viewer form { display: flex; justify-content: flex-end; margin: 0 0 10px; }
.viewer img { display: block; width: 100%; height: auto; max-height: calc(94vh - 130px); object-fit: contain; border-radius: 10px; background: #fff; }
.viewer-cap { margin: 10px 2px 0; font: 400 14px/1.45 var(--f-b); color: var(--muted); }

/* ---------- 2D figures: the never cross and text on a filled badge ---------- */
.fig .never circle, .fig .never path { fill: none; stroke: #FF7A85; stroke-width: 3; stroke-linecap: round; }
.fig text.tf { fill: #071003; font-weight: 700; }
.chap-never .stage-cap { color: #ffb3ba; }

/* ---------- footer ---------- */
.foot .lead code { font-size: .9em; }

/* ---------- narrow screens ---------- */
@media (max-width: 900px) {
  .hero-stage { position: relative; inset: auto; right: auto; top: auto; width: 100%; height: auto; aspect-ratio: 44 / 34; max-width: 460px; margin: 6px auto 0; order: 2; }
  .hero-fig { position: static; width: 100%; max-height: none; }
  .hero { display: flex; flex-direction: column; }
  .hero-text { max-width: none; }
  .screens-grid.n2, .screens-grid.n3 { grid-template-columns: minmax(0, 1fr); }
  .trouble, .checklist { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .need { grid-template-columns: minmax(0, 1fr); }
  .ifsee-row { grid-template-columns: minmax(0, 1fr); }
  .lang-sw { height: 34px; }
  .lang-sw a { min-width: 34px; height: 26px; padding: 0 8px; }
  .chap-tab-part { font-size: 10.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .screen-open, .lang-sw a, .checklist li { transition: none; }
}
