/* CryptoVerse shared design system
   One stylesheet for the home page and all eight tools.
   Colours are design tokens: change them here and every tool follows. */

:root {
  /* Brand (harmonised with the school and BTS logos) */
  /* From the logos: BTS blue #036baa, LGK teal #0093bd, cyan #00a8e6, slate #434c5d, sage #dae8dd */
  --brand: #036baa;
  --brand-strong: #024b78;
  --brand-soft: #e3eff8;
  --accent: #007a9e;      /* LGK teal, darkened for readable links */
  --accent-soft: #dff3fa;
  --cyan: #00a8e6;
  --sage: #dae8dd;

  /* Surfaces and text */
  --bg: #f3f6f5;
  --surface: #ffffff;
  --surface-2: #f7faf9;
  --line: #d3dde0;
  --text: #1c2330;
  --text-muted: #434c5d;  /* logo slate */

  /* Meaning colours: always paired with an icon or a label, never used alone */
  --public: #0f766e;      /* public information, public keys */
  --public-soft: #dcf3ef;
  --private: #b4232a;     /* private keys and private values */
  --private-soft: #fbe3e4;
  --shared: #6d3fc8;      /* shared secret / symmetric keys */
  --shared-soft: #ece4fb;
  --hash: #1d4fbf;        /* hashes, tags, signatures */
  --hash-soft: #e2e9fb;
  --attacker: #b54708;    /* Mallory / Eve */
  --attacker-soft: #fdeacc;
  --ok: #1a7f37;
  --ok-soft: #dcf2e1;
  --bad: #b4232a;
  --bad-soft: #fbe3e4;
  --sim: #8a6100;         /* simulated / illustrative */
  --sim-soft: #fff4cc;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 2px 8px rgba(16, 24, 40, .06);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;
  --fs-base: 1.0625rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #5fb4e8; --brand-strong: #a9d8f5; --brand-soft: #132a3b;
    --accent: #33c3ef; --accent-soft: #0f2c36; --cyan: #33c3ef; --sage: #1e2a24;
    --bg: #0e141b; --surface: #161e28; --surface-2: #1b2531; --line: #2c3a4b;
    --text: #e8edf3; --text-muted: #a7b4c3;
    --public: #4fd1c0; --public-soft: #123430;
    --private: #ff8a8f; --private-soft: #3a1a1d;
    --shared: #b99bff; --shared-soft: #2a2140;
    --hash: #8fb0ff; --hash-soft: #1a2442;
    --attacker: #ffad66; --attacker-soft: #3a2614;
    --ok: #6ee08a; --ok-soft: #133020; --bad: #ff8a8f; --bad-soft: #3a1a1d;
    --sim: #ffd35c; --sim-soft: #3a3010;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 2px 8px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #5fb4e8; --brand-strong: #a9d8f5; --brand-soft: #132a3b;
  --accent: #33c3ef; --accent-soft: #0f2c36; --cyan: #33c3ef; --sage: #1e2a24;
  --bg: #0e141b; --surface: #161e28; --surface-2: #1b2531; --line: #2c3a4b;
  --text: #e8edf3; --text-muted: #a7b4c3;
  --public: #4fd1c0; --public-soft: #123430;
  --private: #ff8a8f; --private-soft: #3a1a1d;
  --shared: #b99bff; --shared-soft: #2a2140;
  --hash: #8fb0ff; --hash-soft: #1a2442;
  --attacker: #ffad66; --attacker-soft: #3a2614;
  --ok: #6ee08a; --ok-soft: #133020; --bad: #ff8a8f; --bad-soft: #3a1a1d;
  --sim: #ffd35c; --sim-soft: #3a3010;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 2px 8px rgba(0,0,0,.3);
  color-scheme: dark;
}

/* Presentation mode: bigger everything for classroom projection */
:root.present { --fs-base: 1.3rem; }

* { box-sizing: border-box; }
html { font-size: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: var(--fs-base); line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; color: var(--text); }
h1 { font-size: 1.9em; letter-spacing: -.01em; }
h2 { font-size: 1.4em; }
h3 { font-size: 1.12em; }
p { margin: 0 0 .8em; }
code, .mono { font-family: var(--mono); font-size: .92em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; }
.skip-link:focus { left: 8px; }

.icon { width: 1.1em; height: 1.1em; vertical-align: -.18em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Header ---------- */
.cv-header { background: var(--surface); border-bottom: 1px solid var(--line); border-top: 4px solid var(--cyan); position: sticky; top: 0; z-index: 50; }
.cv-header-inner { max-width: 1320px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cv-logos { display: flex; align-items: center; gap: 14px; }
.cv-logos img { height: 52px; width: auto; display: block; }
.cv-logos .logo-dark-bg { background: #fff; border-radius: 6px; padding: 2px 4px; }
.cv-brand { display: flex; flex-direction: column; text-decoration: none; color: var(--text); padding-left: 14px; border-left: 1px solid var(--line); }
.cv-brand strong { font-size: 1.25rem; color: var(--brand); letter-spacing: .01em; }
.cv-brand span { font-size: .78rem; color: var(--text-muted); }
.cv-nav { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.cv-nav select { font: inherit; font-size: .95rem; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--text); max-width: 260px; }
.icon-btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: .9rem; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand); }

/* ---------- Page layout ---------- */
main { max-width: 1320px; margin: 0 auto; padding: 20px; }
.tool-hero { display: grid; grid-template-columns: 1fr auto; gap: 12px 24px; align-items: start; margin-bottom: 14px; }
.tool-kicker { color: var(--accent); font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 2px; }
.tool-hero p.lead { font-size: 1.1em; color: var(--text-muted); max-width: 70ch; margin: 0; }
.cycle { display: flex; gap: 4px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.cycle a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: .88rem; font-weight: 600; }
.cycle a:hover { border-color: var(--accent); }
.cycle .n { display: inline-grid; place-items: center; width: 1.4em; height: 1.4em; border-radius: 50%; background: var(--brand); color: var(--surface); font-size: .8em; }

section.block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; scroll-margin-top: 90px; }
.block-title { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.block-title h2 { margin: 0; }
.block-title .phase { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--surface); background: var(--brand); padding: 3px 9px; border-radius: 999px; }
.block-title .spacer { flex: 1; }

.lab { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; }
.lab > * { min-width: 0; }
@media (max-width: 1000px) { .lab { grid-template-columns: 1fr; } .tool-hero { grid-template-columns: 1fr; } }

.stage { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; position: relative; }
.panel { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.panel h3 { font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } main { padding: 12px 16px; } }

/* ---------- Controls ---------- */
label { font-weight: 600; font-size: .92rem; display: block; margin-bottom: 4px; }
.hint { font-size: .85rem; color: var(--text-muted); font-weight: 400; }
textarea, input[type="text"], input[type="password"], select.field {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px;
}
textarea { resize: vertical; min-height: 80px; }
textarea:focus, input:focus, select:focus { border-color: var(--accent); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer;
  padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: var(--brand); color: #fff; text-decoration: none; min-height: 42px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn { background: #036baa; } }
:root[data-theme="dark"] .btn { background: #036baa; }
.btn:hover { filter: brightness(1.1); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn.secondary:hover { background: var(--surface-2); filter: none; }
.btn.danger { background: var(--attacker); color: #fff; }
.btn.small { padding: 5px 10px; min-height: 34px; font-size: .86rem; }
.btn.block { width: 100%; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; flex-wrap: wrap; }
.seg button { font: inherit; font-size: .9rem; padding: 7px 12px; border: 0; background: var(--surface); color: var(--text); cursor: pointer; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--brand); color: #fff; font-weight: 600; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg button[aria-pressed="true"] { background: #036baa; } }
:root[data-theme="dark"] .seg button[aria-pressed="true"] { background: #036baa; }

/* ---------- Badges, chips, values ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; border: 1px solid currentColor; }
.badge.genuine { color: var(--ok); background: var(--ok-soft); }
.badge.simulated { color: var(--sim); background: var(--sim-soft); border-style: dashed; }
.badge.analogy { color: var(--sim); background: var(--sim-soft); border-style: dotted; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 6px; font-weight: 600; font-size: .88rem; border: 2px solid; }
.chip.public { color: var(--public); background: var(--public-soft); border-color: var(--public); }
.chip.private { color: var(--private); background: var(--private-soft); border-color: var(--private); border-style: double; border-width: 3px; }
.chip.shared { color: var(--shared); background: var(--shared-soft); border-color: var(--shared); }
.chip.hash { color: var(--hash); background: var(--hash-soft); border-color: var(--hash); }
.chip.attacker { color: var(--attacker); background: var(--attacker-soft); border-color: var(--attacker); border-style: dashed; }
.chip.plain { color: var(--text); background: var(--surface); border-color: var(--line); }

.value { font-family: var(--mono); font-size: .88rem; background: var(--surface); border: 1px solid var(--line); border-left-width: 5px; border-radius: 6px; padding: 8px 10px; word-break: break-all; overflow-wrap: anywhere; min-height: 2.4em; }
.value.public { border-left-color: var(--public); }
.value.private { border-left-color: var(--private); }
.value.shared { border-left-color: var(--shared); }
.value.hash { border-left-color: var(--hash); }
.value.cipher { border-left-color: var(--text-muted); }
.value.attacker { border-left-color: var(--attacker); }
.value.empty { color: var(--text-muted); font-family: var(--font); font-style: italic; }
.value .diff { background: var(--attacker-soft); color: var(--attacker); font-weight: 700; border-radius: 2px; }
.value-label { display: flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 700; color: var(--text-muted); margin-bottom: 3px; text-transform: uppercase; letter-spacing: .04em; flex-wrap: wrap; }

/* ---------- Result messages ---------- */
.result { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); border: 2px solid; font-weight: 500; }
.result .icon { width: 1.4em; height: 1.4em; margin-top: 1px; }
.result.ok { color: var(--ok); background: var(--ok-soft); }
.result.bad { color: var(--bad); background: var(--bad-soft); border-style: dashed; }
.result.info { color: var(--brand); background: var(--brand-soft); border-color: var(--brand); }
.result.warn { color: var(--sim); background: var(--sim-soft); }
.result > div { color: var(--text); }
.result strong { color: inherit; }

/* ---------- Actors (Alice, Bob, Mallory...) ---------- */
.scene { display: grid; gap: 14px; align-items: stretch; }
.scene.three { grid-template-columns: 1fr minmax(140px, .9fr) 1fr; }
.scene.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 760px) { .scene.three, .scene.two { grid-template-columns: 1fr; } }
.actor { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 10px; transition: border-color .3s, box-shadow .3s; }
.actor.active { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.actor-head { display: flex; align-items: center; gap: 10px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1.15rem; color: #fff; flex: none; }
.avatar.alice { background: #c2410c; background: #2563a6; }
.avatar.bob { background: #15803d; }
.avatar.charlie { background: #6b7280; }
.avatar.mallory, .avatar.eve { background: var(--attacker); border: 2px dashed #fff; outline: 2px solid var(--attacker); }
.avatar.ca { background: #6d3fc8; border-radius: 10px; }
.avatar.server { background: #334155; border-radius: 10px; }
.actor-name { font-weight: 700; font-size: 1.05rem; }
.actor-role { font-size: .82rem; color: var(--text-muted); }
.channel { display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 8px; padding: 10px; border: 2px dashed var(--line); border-radius: var(--radius); background: repeating-linear-gradient(90deg, transparent 0 10px, rgba(127,127,127,.06) 10px 20px); position: relative; }
.channel-label { text-align: center; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.packet { background: var(--surface); border: 2px solid var(--line); border-radius: 8px; padding: 8px; font-size: .85rem; box-shadow: var(--shadow); }
.packet.fly { animation: fly .7s ease-out; }
@keyframes fly { from { transform: translateX(-40px); opacity: 0; } to { transform: none; opacity: 1; } }
.packet.tampered { border-color: var(--attacker); border-style: dashed; background: var(--attacker-soft); }
.arrow-r::after { content: "→"; }
.flow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.flow .op { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 110px; padding: 10px 12px; border-radius: 10px; border: 2px solid var(--brand); background: var(--brand-soft); color: var(--brand-strong); font-weight: 700; text-align: center; }
.flow .op small { font-weight: 500; color: var(--text-muted); }
.flow .to { font-size: 1.5rem; color: var(--text-muted); }

/* ---------- Step-by-step explanation ---------- */
.steps-ui { display: flex; flex-direction: column; gap: 10px; }
.stepper-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stepper-bar .count { font-weight: 700; color: var(--text-muted); font-size: .9rem; margin-left: auto; }
.step-dots { display: flex; gap: 6px; flex-wrap: wrap; }
.step-dots button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); color: var(--text); font-weight: 700; cursor: pointer; font-size: .85rem; }
.step-dots button.done { background: var(--brand-soft); border-color: var(--brand); }
.step-dots button[aria-current="step"] { background: var(--brand); color: #fff; border-color: var(--brand); }
.explain { background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--accent); border-radius: var(--radius-sm); padding: 14px 16px; }
.explain h4 { margin: 0 0 6px; font-size: 1.05rem; }
.explain p:last-child { margin-bottom: 0; }
.log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow: auto; }
.log li { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--accent); border-radius: 6px; padding: 8px 10px; font-size: .93rem; }
.log li.ok { border-left-color: var(--ok); }
.log li.bad { border-left-color: var(--bad); }
.log li.sim { border-left-color: var(--sim); }
.log li .t { font-weight: 700; display: block; margin-bottom: 2px; }
.log li.new { animation: pop .4s ease-out; }
@keyframes pop { from { background: var(--accent-soft); } }

/* ---------- Explain / Apply cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.card { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.card h3 { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.card ul { padding-left: 1.2em; margin: 0 0 .6em; }
.myth { border-left: 6px solid var(--bad); }
.myth .m { font-weight: 700; color: var(--bad); display: flex; gap: 6px; }
.myth .r { margin-top: 6px; display: flex; gap: 6px; }
.myth .r .icon { color: var(--ok); }
.limit { border-left: 6px solid var(--sim); }
details.challenge { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
details.challenge + details.challenge { margin-top: 10px; }
details.challenge summary { cursor: pointer; font-weight: 700; display: flex; gap: 8px; align-items: center; }
details.challenge summary::-webkit-details-marker { display: none; }
details.challenge summary::before { content: "▸"; color: var(--accent); }
details.challenge[open] summary::before { content: "▾"; }
details.challenge .body { margin-top: 10px; }
.answer { margin-top: 8px; padding: 10px 12px; background: var(--ok-soft); border-radius: 8px; border: 1px solid var(--ok); }
table.compare { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.compare th, table.compare td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
table.compare thead th { background: var(--brand-soft); color: var(--brand-strong); }
table.compare tbody th { background: var(--surface-2); }
.table-wrap { overflow-x: auto; }
.yes { color: var(--ok); font-weight: 700; }
.no { color: var(--bad); font-weight: 700; }
.objective { display: flex; gap: 12px; align-items: flex-start; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--radius); padding: 12px 16px; }
.objective .icon { color: var(--accent); width: 1.6em; height: 1.6em; }
.objective strong { display: block; }

.related { display: flex; gap: 12px; flex-wrap: wrap; }
.related a { flex: 1 1 220px; text-decoration: none; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.related a:hover { border-color: var(--accent); }
.related a small { display: block; color: var(--text-muted); font-size: .82rem; }
.related a strong { color: var(--brand); }

/* ---------- Footer ---------- */
.cv-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 30px; }
.cv-footer-inner { max-width: 1320px; margin: 0 auto; padding: 18px 20px; display: flex; gap: 20px; flex-wrap: wrap; justify-content: space-between; font-size: .88rem; color: var(--text-muted); }
.cv-footer-inner p { margin: 0; max-width: 80ch; }

/* ---------- Misc ---------- */
.kbd { font-family: var(--mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font-size: .85em; }
.meter { height: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--attacker); transition: width .5s; }
.muted { color: var(--text-muted); }
.small { font-size: .88rem; }
.center { text-align: center; }
.hidden { display: none !important; }
.pulse { animation: pulse 1s ease-out; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--accent); } 100% { box-shadow: 0 0 0 12px transparent; } }
.fade-in { animation: fadein .45s ease-out; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.dim { opacity: .3; filter: grayscale(.6); transition: opacity .35s, filter .35s; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Home page ---------- */
.home-hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: center; background: linear-gradient(135deg, var(--brand-soft), var(--accent-soft) 60%, var(--sage)); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; margin-bottom: 24px; }
.home-hero h1 { font-size: 2.3em; color: var(--brand-strong); }
@media (max-width: 860px) { .home-hero { grid-template-columns: 1fr; } }
.journey { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; counter-reset: j; }
.journey li a { display: flex; flex-direction: column; gap: 6px; height: 100%; text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.journey li a:hover { transform: translateY(-2px); border-color: var(--accent); }
.journey .num { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .journey .num, :root:not([data-theme="light"]) .cycle .n { background: #036baa; color: #fff; } }
:root[data-theme="dark"] .journey .num, :root[data-theme="dark"] .cycle .n { background: #036baa; color: #fff; }
.journey h3 { margin: 0; color: var(--brand); }
.journey p { margin: 0; color: var(--text-muted); font-size: .95rem; }
.journey .uses { font-size: .85rem; color: var(--text); }

@media print {
  .cv-header, .cv-footer, .btn, .seg, .stepper-bar { display: none !important; }
  section.block { box-shadow: none; break-inside: avoid; }
}
@media (max-width: 700px) { .hide-sm { display: none; } .cv-brand { border-left: 0; padding-left: 0; } .cv-nav { margin-left: 0; width: 100%; } .cv-nav select { flex: 1; max-width: none; } }
.grid-2 > *, .grid-3 > *, .grid-4 > *, .scene > *, .cards > * { min-width: 0; }
@media (max-width: 640px) { .badge { white-space: normal; } .block-title h2 { flex: 1 1 100%; order: 1; } .block-title .badge { order: 2; } }
