/* ═══ HELHEIMRS — pages: Valhalla, auth, 404, dust, style guide ═══ */

/* ───────────────────────── VALHALLA ───────────────────────── */
/* Locked state: the same split the login page uses — scene on one side,
   a sealed ledger page on the other. An empty screen would say nothing;
   this says exactly what is behind the seal. */
.pg-valhalla--locked { padding: 0; }
.pg-valhalla .vh-gate { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - 68px); }
.pg-valhalla .vh-gate__scene { position: relative; overflow: hidden; display: grid; place-items: center; align-content: center; gap: var(--s-5); padding: var(--gutter); background: radial-gradient(ellipse at 50% 58%, rgba(15,107,79,.32), transparent 62%), var(--bg); border-inline-end: 1px solid var(--line); }
.pg-valhalla .vh-gate__scene::before { content: ""; position: absolute; inset: -20%; background: radial-gradient(ellipse at 32% 68%, rgba(var(--fog-color), .12), transparent 55%), radial-gradient(ellipse at 68% 32%, rgba(var(--fog-color), .1), transparent 55%); animation: authFog 46s ease-in-out infinite alternate; }
.pg-valhalla .vh-gate__mark { position: relative; }
.pg-valhalla .vh-gate__mark::before { content: ""; position: absolute; left: 18%; right: 18%; top: 13%; bottom: 9%; z-index: -1; clip-path: var(--clip-hex); box-shadow: 0 0 60px 18px rgba(47,211,154,.26); }
.pg-valhalla .vh-gate__mark svg { width: min(340px, 54vw); height: auto; }
.pg-valhalla .vh-gate__scene .rune-band { position: relative; margin: 0; }
.pg-valhalla .vh-gate__ledger { display: grid; place-items: center; padding: var(--s-8) var(--gutter); }
.pg-valhalla .vh-gate__in { width: min(100%, 480px); position: relative; padding: var(--s-6); background: var(--stone-grad); border: 1px solid var(--line-strong); clip-path: var(--clip-facet); box-shadow: var(--shadow-stone); }
.pg-valhalla .vh-gate__in .rune { margin: 0 0 var(--s-2); font-size: var(--rune-sm); }
.pg-valhalla .vh-gate__in h1 { margin: 0 0 var(--s-2); }
.pg-valhalla .vh-gate__in > p { margin: 0; }
.pg-valhalla .vh-sealed { list-style: none; padding: 0; margin: var(--s-5) 0; display: grid; gap: 1px; background: var(--line); border-block: 1px solid var(--line); }
.pg-valhalla .vh-sealed li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--s-3); padding: var(--s-3) 0; background: var(--stone-grad); }
.pg-valhalla .vh-sealed__rune { width: 34px; height: 38px; clip-path: var(--clip-hex); display: grid; place-items: center; font-family: var(--font-rune); font-size: var(--rune-md); color: var(--ornament); background: var(--bg); }
.pg-valhalla .vh-sealed__txt { display: grid; gap: 1px; min-width: 0; }
.pg-valhalla .vh-sealed__txt b { color: var(--fg-strong); }
.pg-valhalla .vh-sealed__txt small { font-size: var(--fs-2xs); }
.pg-valhalla .vh-sealed__seal { flex: none; }
.pg-valhalla .vh-gate__actions { display: flex; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-3); }
.pg-valhalla .vh-gate__actions .btn--primary { flex: 1; }
@media (max-width: 900px) {
  .pg-valhalla .vh-gate { grid-template-columns: 1fr; min-height: 0; }
  .pg-valhalla .vh-gate__scene { min-height: 240px; padding-block: var(--s-6); border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .pg-valhalla .vh-gate__mark svg { width: 190px; }
  .pg-valhalla .vh-gate__ledger { padding-block: var(--s-6) var(--s-8); }
}
@media (prefers-reduced-motion: reduce) { .pg-valhalla .vh-gate__scene::before { animation: none; } }

.pg-valhalla .vh-hero { position: relative; padding-block: var(--s-8) var(--s-6); border-bottom: 1px solid var(--line); background: radial-gradient(ellipse at 18% 62%, rgba(47,211,154,.13), transparent 46%), linear-gradient(180deg, var(--bg-elev), var(--bg)); overflow: hidden; }
.pg-valhalla .vh-hero::before { content: "ᚹᚨᛚᚺᚨᛚᛚ ᛫ ᚺᛖᛚᚺᛖᛁᛗᚱᛊ"; position: absolute; top: 10px; inset-inline-end: -10px; font-family: var(--font-rune); font-size: 120px; letter-spacing: .2em; color: rgba(255,255,255,.025); white-space: nowrap; pointer-events: none; user-select: none; direction: ltr; }
:root[data-theme="light"] .pg-valhalla .vh-hero::before { color: rgba(0,0,0,.035); }
.pg-valhalla .vh-hero__in { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--s-6); position: relative; }
.pg-valhalla .vh-avatar { filter: drop-shadow(0 0 18px rgba(47,211,154,.45)); }
.pg-valhalla .vh-id h1 { margin: 0 0 var(--s-1); font-size: var(--fs-3xl); }
.pg-valhalla .vh-id p { margin: 0; }
.pg-valhalla .vh-id__line { max-width: none; font-size: var(--fs-sm); }
.pg-valhalla .vh-id__title { color: var(--accent-text); font-weight: 700; }
.pg-valhalla .vh-level { display: flex; align-items: center; gap: var(--s-4); }
.pg-valhalla .vh-level__num { display: grid; place-items: center; width: 72px; height: 82px; position: relative; isolation: isolate; }
.pg-valhalla .vh-level__num::before { content: ""; position: absolute; inset: 0; clip-path: var(--clip-hex); background: var(--emerald-grad); z-index: -2; }
.pg-valhalla .vh-level__num::after { content: ""; position: absolute; inset: 2px; clip-path: var(--clip-hex); background: var(--stone-grad-2); z-index: -1; }
.pg-valhalla .vh-level__num small { font-size: var(--fs-xs); color: var(--fg-muted); line-height: 1; }
.pg-valhalla .vh-level__num b { font-family: var(--font-display); font-weight: 900; font-size: var(--fs-2xl); color: var(--emerald); line-height: 1.1; text-shadow: 0 0 12px rgba(47,211,154,.6); }
:root[data-theme="light"] .pg-valhalla .vh-level__num b { color: var(--jade); text-shadow: none; }
.pg-valhalla .vh-xp { width: min(300px, 70vw); display: grid; gap: var(--s-2); }
.pg-valhalla .vh-xp__bar { position: relative; height: 16px; background: var(--bg); border: 1px solid var(--line-strong); clip-path: var(--clip-facet); --facet: 6px; overflow: hidden; box-shadow: inset 0 2px 6px rgba(0,0,0,.6); }
.pg-valhalla .vh-xp__bar i { display: block; height: 100%; width: var(--p, 0%); background: var(--emerald-grad); background: linear-gradient(90deg, var(--jade), var(--emerald)); box-shadow: 0 0 14px rgba(47,211,154,.7); transition: width 1.4s var(--ease-out); }
.pg-valhalla .vh-xp__runes { position: absolute; inset: 0; display: flex; justify-content: space-between; padding: 0 6px; font-family: var(--font-rune); font-size: var(--fs-2xs); line-height: 14px; color: var(--ornament); text-shadow: 0 0 2px rgba(0,0,0,.85); direction: ltr; pointer-events: none; }
:root[data-theme="light"] .pg-valhalla .vh-xp__runes { color: var(--ornament); text-shadow: 0 0 2px rgba(255,255,255,.9); }
.pg-valhalla .vh-xp__label { display: flex; justify-content: space-between; gap: var(--s-3); font-size: var(--fs-xs); }
:root[data-theme="light"] @media (max-width: 900px) {
  .pg-valhalla .vh-hero__in { grid-template-columns: auto 1fr; }
  .pg-valhalla .vh-level { grid-column: 1 / -1; }
  .pg-valhalla .vh-xp { width: 100%; }
  }
@media (max-width: 480px) {
  .pg-valhalla .vh-hero__in { grid-template-columns: 1fr; justify-items: start; }
  }

.pg-valhalla .vh-tabs { margin-bottom: var(--s-5); }
.pg-valhalla .vh-tabs .tab { display: inline-flex; align-items: center; gap: 6px; }
.pg-valhalla .vh-tabs .ico { width: 16px; height: 16px; }
.pg-valhalla .vh-panel { min-height: 240px; }
.pg-valhalla .vh-note { font-size: var(--fs-sm); margin-top: var(--s-4); }

.pg-valhalla .vh-badges { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-3); }
.pg-valhalla .vh-badge { display: grid; grid-template-columns: 56px 1fr; gap: var(--s-3); align-items: center; padding: var(--s-3) var(--s-4); border: 1px solid var(--line); background: var(--bg-elev); clip-path: var(--clip-facet); --facet: 8px; transition: border-color var(--t-ui), transform var(--t-ui) var(--ease-stone); }
.pg-valhalla .vh-badge:hover, .pg-valhalla .vh-badge:focus-visible { border-color: var(--line-glow); }
.pg-valhalla .vh-badge__rune { width: 56px; height: 64px; clip-path: var(--clip-hex); display: grid; place-items: center; font-family: var(--font-rune); font-size: 28px; background: var(--emerald-grad); color: var(--accent-fg); }
.pg-valhalla .vh-badge.is-earned .vh-badge__rune { animation: breathe 3.4s ease-in-out infinite; filter: drop-shadow(0 0 10px rgba(47,211,154,.6)); }
.pg-valhalla .vh-badge__txt { display: grid; gap: 2px; }
.pg-valhalla .vh-badge__txt b { color: var(--fg-strong); }
.pg-valhalla .vh-badge__txt small { color: var(--fg-muted); font-size: var(--fs-xs); }
.pg-valhalla .vh-badge__txt .tag { justify-self: start; margin-top: 4px; }
.pg-valhalla .vh-badge.is-locked .vh-badge__rune { opacity: .55; }
.pg-valhalla .vh-badge.is-locked .vh-badge__rune { background: var(--bg-elev-3); color: var(--fg-faint); }
@media (prefers-reduced-motion: reduce) { .pg-valhalla .vh-badge.is-earned .vh-badge__rune { animation: none; } }

.pg-valhalla .vh-chars { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-4); }
.pg-valhalla .vh-char { display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: var(--s-3); padding: var(--s-4) var(--s-5); color: var(--fg); text-decoration: none; }
.pg-valhalla .vh-char:hover { text-decoration: none; }
.pg-valhalla .vh-char__rune { width: 56px; height: 64px; clip-path: var(--clip-hex); display: grid; place-items: center; font-family: var(--font-rune); font-size: 26px; color: var(--accent-text); background: var(--bg); box-shadow: inset 0 0 0 1px var(--line-glow); }
.pg-valhalla .vh-char__meta { display: grid; gap: 2px; }
.pg-valhalla .vh-char__meta b { color: var(--fg-strong); font-size: var(--fs-lg); font-family: var(--font-display); font-weight: 700; }
.pg-valhalla .vh-char__meta span { font-size: var(--fs-sm); }
.pg-valhalla .vh-char__go { color: var(--fg-faint); transition: transform var(--t-ui) var(--ease-stone), color var(--t-ui); }
.pg-valhalla .vh-char:hover .vh-char__go { color: var(--accent-text); transform: translateX(-4px); }
.pg-valhalla .vh-char--new { grid-template-columns: auto 1fr; border: 1px dashed var(--line-strong); clip-path: var(--clip-facet); color: var(--fg-muted); min-height: 96px; }
.pg-valhalla .vh-char--new:hover { color: var(--accent-text); border-color: var(--line-glow); }

.pg-valhalla .vh-history td:first-child { max-width: 260px; }
.pg-valhalla .vh-saved { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); }
.pg-valhalla .vh-saved__card { display: block; color: var(--fg); text-decoration: none; }
.pg-valhalla .vh-saved__card:hover { text-decoration: none; }
.pg-valhalla .vh-saved__cover { display: block; aspect-ratio: 16 / 9; overflow: hidden; }
.pg-valhalla .vh-saved__meta { display: grid; gap: 4px; padding: var(--s-3) var(--s-4) var(--s-4); }
.pg-valhalla .vh-saved__meta .tag { justify-self: start; }
.pg-valhalla .vh-saved__meta b { color: var(--fg-strong); }
.pg-valhalla .vh-treasure { display: grid; place-items: center; gap: var(--s-2); min-height: 160px; border: 1px dashed var(--line-strong); clip-path: var(--clip-facet); font-size: var(--fs-xs); }
@media (max-width: 900px) { .pg-valhalla .vh-saved { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .pg-valhalla .vh-badges, .pg-valhalla .vh-chars, .pg-valhalla .vh-saved { grid-template-columns: 1fr; } }

.pg-valhalla .vh-settings { margin-top: var(--s-8); }
.pg-valhalla .vh-sets { display: grid; gap: 0; padding: 0 var(--s-5); }
.pg-valhalla .vh-set { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding: var(--s-4) 0; border-bottom: 1px solid var(--line); }
.pg-valhalla .vh-set:last-child { border-bottom: 0; }
.pg-valhalla .vh-set__txt { display: grid; gap: 2px; }
.pg-valhalla .vh-set__txt b { color: var(--fg-strong); }
.pg-valhalla .vh-set__txt small { font-size: var(--fs-xs); }
.pg-valhalla .vh-set--logout { padding-top: var(--s-5); }

/* ───────────────────────── AUTH ───────────────────────── */
.pg-auth { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - 68px); }
.pg-auth .auth-scene { position: relative; overflow: hidden; display: grid; place-items: center; align-content: center; gap: var(--s-5); padding: var(--gutter); background: radial-gradient(ellipse at 50% 60%, rgba(15,107,79,.35), transparent 55%), radial-gradient(ellipse at 50% 100%, rgba(47,211,154,.12), transparent 50%), var(--bg-elev); border-inline-start: 1px solid var(--line); }
.pg-auth .auth-scene::before, .pg-auth .auth-scene::after { content: ""; position: absolute; inset: -20%; background: radial-gradient(ellipse at 30% 70%, rgba(var(--fog-color), .12), transparent 55%), radial-gradient(ellipse at 70% 40%, rgba(var(--fog-color), .09), transparent 50%); animation: authFog 26s ease-in-out infinite alternate; pointer-events: none; }
.pg-auth .auth-scene::after { animation-duration: 38s; animation-direction: alternate-reverse; opacity: .7; }
@keyframes authFog { from { transform: translate(-3%, 1%) scale(1); } to { transform: translate(3%, -2%) scale(1.08); } }
.pg-auth .auth-scene__mark { position: relative; animation: breathe 4.2s ease-in-out infinite; }
.pg-auth .auth-scene__mark::before { content: ""; position: absolute; left: 18%; right: 18%; top: 13%; bottom: 9%; z-index: -1; clip-path: var(--clip-hex); box-shadow: 0 0 60px 20px rgba(47,211,154,.3); }
.pg-auth .auth-scene__mark svg { width: min(380px, 60vw); height: auto; }
.pg-auth .auth-scene__kicker { position: relative; margin: 0; color: var(--fg-muted); text-align: center; max-width: 34ch; }
.pg-auth .auth-scene .rune-band { position: relative; margin: 0; }
.pg-auth .auth-ledger { display: grid; place-items: center; padding: var(--s-8) var(--gutter); }
.pg-auth .auth-ledger__in { width: min(100%, 460px); position: relative; padding: var(--s-6) var(--s-6) var(--s-5); background: var(--stone-grad); border: 1px solid var(--line-strong); clip-path: var(--clip-facet); box-shadow: var(--shadow-stone); }
.pg-auth .auth-ledger__in::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(180deg, transparent 0 31px, rgba(255,255,255,.035) 31px 32px); mask-image: linear-gradient(180deg, transparent 0 120px, #000 160px); -webkit-mask-image: linear-gradient(180deg, transparent 0 120px, #000 160px); }
:root[data-theme="light"] .pg-auth .auth-ledger__in::before { background: repeating-linear-gradient(180deg, transparent 0 31px, rgba(0,0,0,.05) 31px 32px); }
.pg-auth .auth-ledger__in > * { position: relative; }
.pg-auth .auth-ledger__in .rune { margin: 0 0 var(--s-2); font-size: .95rem; }
.pg-auth .auth-ledger__in h1 { font-size: var(--fs-2xl); margin-bottom: var(--s-1); }
.pg-auth .auth-form { display: grid; gap: var(--s-4); margin-top: var(--s-5); transition: opacity var(--t-slow); }
.pg-auth .auth-form.is-signing { opacity: .3; pointer-events: none; }
.pg-auth .auth-row { font-size: var(--fs-sm); }
.pg-auth .auth-forgot { font-size: var(--fs-xs); color: var(--fg-muted); display: inline-flex; align-items: center; min-height: 44px; padding-inline: var(--s-2); }
.pg-auth .auth-actions { display: flex; gap: var(--s-3); flex-wrap: wrap; margin-top: var(--s-2); }
.pg-auth .auth-actions .btn--primary { flex: 1; }
.pg-auth .auth-nick { display: flex; gap: var(--s-2); }
.pg-auth .auth-nick .input { flex: 1; }
.pg-auth .auth-nick .btn { flex: none; }
.pg-auth .auth-alt { margin: var(--s-5) 0 0; font-size: var(--fs-sm); color: var(--fg-muted); }
.pg-auth .auth-sign { position: absolute; inset-inline: var(--s-6); top: 50%; transform: translateY(-40%); display: grid; gap: var(--s-2); justify-items: center; text-align: center; pointer-events: none; }
.pg-auth .auth-sign__label { font-size: var(--fs-xs); color: var(--fg-muted); }
.pg-auth .auth-sign__name { font-family: var(--font-display); font-weight: 900; font-size: var(--fs-2xl); line-height: 1.3; color: var(--fg-strong); display: flex; flex-wrap: wrap; justify-content: center; }
.pg-auth .auth-sign__ch { display: inline-block; opacity: 0; animation: engrave .7s var(--ease-out) forwards; animation-delay: calc(320ms + var(--i) * 85ms); }
@keyframes engrave { 0% { opacity: 0; transform: translateY(-6px) scale(1.25); color: var(--emerald); text-shadow: 0 0 18px var(--emerald), 0 0 40px rgba(47,211,154,.8); } 45% { opacity: 1; color: var(--emerald); text-shadow: 0 0 12px var(--emerald); } 100% { opacity: 1; transform: none; color: var(--fg-strong); text-shadow: 0 1px 0 rgba(255,255,255,.06), 0 -1px 0 rgba(0,0,0,.8); } }
.pg-auth .auth-sign__line { display: block; width: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--emerald), transparent); box-shadow: var(--glow); animation: signLine 1.4s .4s var(--ease-out) forwards; }
@keyframes signLine { to { width: 80%; } }
@media (max-width: 900px) {
  .pg-auth { grid-template-columns: 1fr; min-height: 0; }
  .pg-auth .auth-scene { min-height: 260px; padding-block: var(--s-6); border-inline-start: 0; border-bottom: 1px solid var(--line); order: -1; }
  .pg-auth .auth-scene__mark svg { width: 200px; }
  .pg-auth .auth-scene__kicker { display: none; }
  .pg-auth .auth-ledger { padding-block: var(--s-6) var(--s-8); }
}
@media (prefers-reduced-motion: reduce) { .pg-auth .auth-scene::before, .pg-auth .auth-scene::after, .pg-auth .auth-scene__mark { animation: none; } }

/* ───────────────────────── 404 · NIFLHEIM ───────────────────────── */
.pg-404 { position: relative; min-height: calc(100vh - 68px); overflow: hidden; display: grid; place-items: center; padding: var(--s-9) var(--gutter); text-align: center; background: radial-gradient(ellipse at 50% 120%, rgba(15,107,79,.22), transparent 55%), var(--bg); }
.pg-404 .nf-fog { position: absolute; inset: -30%; pointer-events: none; background: radial-gradient(ellipse at 20% 60%, rgba(var(--fog-color), .16), transparent 45%), radial-gradient(ellipse at 75% 35%, rgba(var(--fog-color), .12), transparent 45%), radial-gradient(ellipse at 55% 85%, rgba(var(--fog-color), .1), transparent 40%); animation: nfDrift 40s ease-in-out infinite alternate; }
.pg-404 .nf-fog--2 { animation-duration: 58s; animation-direction: alternate-reverse; opacity: .8; }
.pg-404 .nf-fog--3 { animation-duration: 74s; opacity: .55; filter: blur(20px); }
@keyframes nfDrift { from { transform: translate(-4%, 2%) rotate(0deg); } to { transform: translate(5%, -3%) rotate(2deg); } }
.pg-404 .nf-ghost { position: absolute; top: 18%; inset-inline-start: 10%; opacity: .32; filter: blur(.6px) drop-shadow(0 0 22px rgba(200,225,215,.35)); animation: nfWander 28s ease-in-out infinite alternate; pointer-events: none; }
.pg-404 .nf-ghost svg { width: 180px; height: auto; }
/* One of Huginn's pair, perched and watching — the hints say the ravens
   claim this path was never built, so one of them is here to say so. */
.pg-404 .nf-raven { position: absolute; top: 12%; inset-inline-end: 9%; opacity: .5; pointer-events: none;
  filter: drop-shadow(0 0 14px rgba(47,211,154,.3)); animation: nfPerch 9s ease-in-out infinite; }
.pg-404 .nf-raven svg { width: 92px; height: auto; }
@keyframes nfPerch { 0%, 84%, 100% { transform: none; } 88% { transform: translateY(-3px) rotate(-3deg); } 93% { transform: translateY(0) rotate(2deg); } }
@keyframes nfWander { 0% { transform: translate(0, 0) scale(.9); opacity: .18; } 30% { opacity: .38; } 50% { transform: translate(-30vw, 14vh) scale(1.05); } 80% { opacity: .3; } 100% { transform: translate(-64vw, -4vh) scale(.95); opacity: .14; } }
.pg-404 .nf-body { position: relative; z-index: 1; display: grid; justify-items: center; gap: var(--s-4); }
.pg-404 .nf-body p { margin: 0; }
.pg-404 .nf-code { margin: 0; font-family: var(--font-latin); font-weight: 700; font-size: clamp(4rem, 14vw, 9rem); line-height: .9; letter-spacing: .12em; color: transparent; -webkit-text-stroke: 1px rgba(237,239,234,.22); text-shadow: 0 0 40px rgba(47,211,154,.15); }
:root[data-theme="light"] .pg-404 .nf-code { -webkit-text-stroke: 1px rgba(14,16,15,.25); }
.pg-404 h1 { margin: 0; }
.pg-404 .nf-path { display: inline-block; padding: var(--s-2) var(--s-4); font-size: var(--fs-sm); background: var(--bg-elev); border: 1px solid var(--line-strong); color: var(--fg-muted); clip-path: var(--clip-facet); --facet: 6px; max-width: 100%; overflow-wrap: anywhere; }
.pg-404 .nf-actions { justify-content: center; margin-top: var(--s-2); }
.pg-404 .nf-links { list-style: none; padding: 0; margin: var(--s-5) 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-2); }
.pg-404 .nf-links a { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; font-size: var(--fs-xs); font-weight: 600; color: var(--fg-muted); border: 1px solid var(--line); clip-path: var(--clip-facet); --facet: 6px; background: var(--bg-elev); }
.pg-404 .nf-links a:hover { color: var(--accent-text); border-color: var(--line-glow); text-decoration: none; }
.pg-404 .nf-links .ico { width: 15px; height: 15px; }
@media (prefers-reduced-motion: reduce) { .pg-404 .nf-fog, .pg-404 .nf-ghost, .pg-404 .nf-raven { animation: none; } .pg-404 .nf-ghost { inset-inline-start: 60%; } }

/* ───────────────────────── DUST · «دوست» ───────────────────────── */
.pg-dust { padding-block: var(--s-9); text-align: center; background: radial-gradient(ellipse at 50% 0%, rgba(47,211,154,.1), transparent 50%); }
.pg-dust .dust-in { display: grid; justify-items: center; gap: var(--s-4); }
.pg-dust .dust-in p { margin: 0; }
.pg-dust h1 { margin: 0; font-size: var(--fs-4xl); }
.pg-dust .dust-lead { font-size: var(--fs-lg); color: var(--fg-strong); }
.pg-dust .dust-keeper { filter: drop-shadow(0 0 26px rgba(47,211,154,.5)); }
.pg-dust .dust-keeper .keeper-head { transform-box: fill-box; transform-origin: 50% 100%; animation: dustNod 5s ease-in-out infinite; }
.pg-dust .dust-keeper .keeper-armL { transform-box: fill-box; transform-origin: 100% 0%; animation: dustArmL 5s ease-in-out infinite; }
.pg-dust .dust-keeper .keeper-armR { transform-box: fill-box; transform-origin: 0% 0%; animation: dustArmR 5s ease-in-out infinite; }
@keyframes dustNod { 0%, 100% { transform: rotate(0) translateY(0); } 50% { transform: rotate(-2deg) translateY(2px); } }
@keyframes dustArmL { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(8deg); } }
@keyframes dustArmR { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-8deg); } }
.pg-dust .dust-founders { list-style: none; padding: 0; margin: var(--s-4) 0 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-3); width: 100%; text-align: start; }
.pg-dust .dust-founders li { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); border: 1px solid var(--line); background: var(--bg-elev); clip-path: var(--clip-facet); --facet: 8px; }
.pg-dust .dust-founders li > span:last-child { display: grid; }
.pg-dust .dust-founders b { color: var(--fg-strong); }
.pg-dust .dust-founders small { font-size: var(--fs-xs); }
.pg-dust .dust-poem { width: 100%; margin: var(--s-4) 0 0; padding: var(--s-5) var(--s-6); border-inline-start: 2px solid var(--emerald); background: var(--bg-elev); text-align: start; box-shadow: var(--glow-inset); }
.pg-dust .dust-poem p { margin: 0 0 .5em; display: flex; gap: var(--s-3); align-items: baseline; color: var(--fg-strong); }
.pg-dust .dust-poem p:last-child { margin-bottom: 0; }
.pg-dust .dust-poem .rune { font-size: 1.3rem; letter-spacing: 0; flex: none; }
.pg-dust .dust-foot { font-size: var(--fs-sm); }
@media (max-width: 600px) { .pg-dust .dust-founders { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .pg-dust .dust-keeper .keeper-head, .pg-dust .dust-keeper .keeper-armL, .pg-dust .dust-keeper .keeper-armR { animation: none; } }

/* ───────────────────────── STYLE GUIDE ───────────────────────── */
.pg-style { padding-block: var(--s-7) var(--s-9); }
.pg-style .sg-hero { display: grid; grid-template-columns: auto 1fr; gap: var(--s-6); align-items: center; margin-bottom: var(--s-8); }
.pg-style .sg-hero__mark { filter: drop-shadow(0 0 22px rgba(47,211,154,.35)); }
.pg-style .sg-hero h1 { margin: 0 0 var(--s-3); }
.pg-style .sg-hero__lead { font-size: var(--fs-lg); color: var(--fg); }
.pg-style .sg-hero .muted { margin: 0; font-size: var(--fs-sm); }
.pg-style .sg-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--s-7); align-items: start; }
.pg-style .sg-nav { position: sticky; top: 84px; }
.pg-style .sg-nav ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; border-inline-start: 1px solid var(--line); }
.pg-style .sg-nav button { display: flex; align-items: center; gap: var(--s-2); width: 100%; padding: var(--s-2) var(--s-3); text-align: start; background: none; border: 0; border-inline-start: 2px solid transparent; margin-inline-start: -1px; color: var(--fg-muted); font-weight: 600; font-size: var(--fs-sm); transition: color var(--t-ui), border-color var(--t-ui); }
.pg-style .sg-nav button:hover { color: var(--fg-strong); }
.pg-style .sg-nav button[aria-current="true"] { color: var(--accent-text); border-inline-start-color: var(--emerald); }
.pg-style .sg-nav .rune { font-size: .9rem; letter-spacing: 0; opacity: .7; }
.pg-style .sg-body { min-width: 0; }
.pg-style .sg-sec { padding-block: var(--s-6) var(--s-8); border-top: 1px solid var(--line); scroll-margin-top: 92px; }
.pg-style .sg-sec:first-child { border-top: 0; padding-top: 0; }
.pg-style .sg-lead { color: var(--fg-muted); font-size: var(--fs-lg); margin-top: calc(-1 * var(--s-4)); margin-bottom: var(--s-6); }
.pg-style .sg-sec :is(h2,h3) { margin-top: var(--s-6); }
.pg-style .sg-grid { display: grid; gap: var(--s-4); margin-bottom: var(--s-5); }
.pg-style .sg-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pg-style .sg-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pg-style .sg-tile { margin: 0; display: grid; place-items: center; gap: var(--s-4); padding: var(--s-6) var(--s-5); background: var(--bg-elev); border: 1px solid var(--line); clip-path: var(--clip-facet); --facet: 10px; min-width: 0; overflow: hidden; }
.pg-style .sg-tile figcaption { font-size: var(--fs-xs); color: var(--fg-muted); text-align: center; text-wrap: balance; }
.pg-style .sg-tile--dark { background: var(--void); color: var(--frost); }
.pg-style .sg-tile--dark figcaption { color: #9EA39C; }
.pg-style .sg-tile--light { background: #E6E8E2; color: #0E100F; }
.pg-style .sg-tile--light figcaption { color: #4E544F; }
.pg-style .sg-wordmarks { display: grid; gap: var(--s-4); justify-items: center; color: var(--fg-strong); }
.pg-style .sg-clear__box { position: relative; padding: 34px; border: 1px dashed var(--line-glow); }
.pg-style .sg-clear__x { position: absolute; font-family: var(--font-latin); font-size: 11px; color: var(--accent-text); }
.pg-style .sg-clear__x--t { top: 9px; left: 50%; transform: translateX(-50%); }
.pg-style .sg-clear__x--b { bottom: 9px; left: 50%; transform: translateX(-50%); }
.pg-style .sg-clear__x--s { top: 50%; inset-inline-start: 11px; transform: translateY(-50%); }
.pg-style .sg-clear__x--e { top: 50%; inset-inline-end: 11px; transform: translateY(-50%); }
.pg-style .sg-rules :is(h2,h3) { margin-top: 0; font-size: var(--fs-lg); }
.pg-style .sg-rules ul { margin: 0; padding-inline-start: 1.2em; display: grid; gap: var(--s-2); }
.pg-style .sg-rules li { max-width: var(--measure); }
.pg-style .sg-misuse .sg-tile > div { overflow: hidden; }
.pg-style .sg-fake-word { font-family: var(--font-display); font-weight: 900; font-size: var(--fs-2xl); color: var(--fg-strong); text-decoration: line-through; text-decoration-color: var(--ember-soft); text-decoration-thickness: 3px; }
.pg-style .sg-code { font-family: var(--font-latin); font-size: .8em; padding: 1px 7px; background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: var(--r-1); color: var(--fg-muted); direction: ltr; unicode-bidi: isolate; display: inline-block; overflow-wrap: anywhere; }
:root[data-theme="light"] .pg-style .sg-code { background: rgba(0,0,0,.04); }

.pg-style .sg-swatches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); margin-bottom: var(--s-5); }
.pg-style .sg-swatch { display: grid; grid-template-columns: 76px 1fr; gap: var(--s-3); padding: var(--s-3); border: 1px solid var(--line); background: var(--bg-elev); clip-path: var(--clip-facet); --facet: 8px; }
.pg-style .sg-swatch__chip { width: 76px; height: 76px; background: var(--c); clip-path: var(--clip-facet); --facet: 8px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.pg-style .sg-swatch__meta { display: grid; gap: 2px; font-size: var(--fs-sm); min-width: 0; }
.pg-style .sg-swatch__meta b { color: var(--fg-strong); }
.pg-style .sg-swatch__meta small { font-size: var(--fs-xs); }
.pg-style .sg-light-demo__bar { height: 14px; margin-bottom: var(--s-3); background: linear-gradient(90deg, var(--emerald) 0%, var(--jade) 55%, transparent 100%); box-shadow: 0 0 20px rgba(47,211,154,.5); clip-path: var(--clip-facet); --facet: 5px; }

.pg-style .sg-type-list { display: grid; margin-bottom: var(--s-5); }
.pg-style .sg-type { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--s-4); align-items: baseline; padding: var(--s-4) 0; border-bottom: 1px solid var(--line); }
.pg-style .sg-type__meta { display: grid; gap: 4px; font-size: var(--fs-xs); }
.pg-style .sg-type__meta b { color: var(--fg-strong); font-size: var(--fs-sm); }
.pg-style .sg-type__sample { line-height: 1.3; color: var(--fg-strong); overflow-wrap: anywhere; min-width: 0; }

.pg-style .sg-space-list { display: grid; gap: 6px; margin-bottom: var(--s-4); }
.pg-style .sg-space { display: flex; align-items: center; gap: var(--s-3); font-size: var(--fs-sm); }
.pg-style .sg-space i { display: block; height: 14px; flex: none; background: linear-gradient(90deg, var(--emerald), var(--jade)); }
.pg-style .sg-shapes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s-3); margin: var(--s-5) 0; }
.pg-style .sg-shape { margin: 0; display: grid; gap: var(--s-2); }
.pg-style .sg-shape > div { aspect-ratio: 1; width: 100%; border: 2px solid transparent; background: var(--stone-grad-2) padding-box, linear-gradient(180deg, var(--emerald), var(--jade)) border-box; }
.pg-style .sg-shape figcaption { display: grid; gap: 2px; font-size: var(--fs-xs); }

.pg-style .sg-futhark { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: var(--s-2); margin-bottom: var(--s-4); }
.pg-style .sg-rune { display: grid; justify-items: center; gap: 2px; padding: var(--s-3) 0; border: 1px solid var(--line); background: var(--bg-elev); }
.pg-style .sg-rune .rune { font-size: 1.7rem; letter-spacing: 0; opacity: 1; }
.pg-style .sg-rune small { font-size: 10px; color: var(--fg-faint); }

.pg-style .sg-demo { border: 1px solid var(--line); background: var(--bg-elev); margin-bottom: var(--s-4); clip-path: var(--clip-facet); --facet: 10px; min-width: 0; }
.pg-style .sg-demo__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; padding: var(--s-3) var(--s-5); border-bottom: 1px solid var(--line); }
.pg-style .sg-demo__head :is(h3,h4) { margin: 0; font-size: var(--fs-md); }
.pg-style .sg-demo__body { padding: var(--s-5); }
.pg-style .sg-demo__body > .row { margin: 0; }
.pg-style .sg-demo .empty { padding: var(--s-6) var(--s-5); }
.pg-style .sg-demo .empty .keeper svg { width: 100px; height: auto; }

.pg-style .sg-eases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4); margin-bottom: var(--s-5); }
.pg-style .sg-ease { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: var(--s-4); padding: var(--s-4); border: 1px solid var(--line); background: var(--bg-elev); }
.pg-style .sg-ease svg { width: 100px; height: 100px; background: var(--bg); border: 1px solid var(--line); }
.pg-style .sg-ease__meta { display: grid; gap: 4px; font-size: var(--fs-xs); align-content: start; min-width: 0; }
.pg-style .sg-ease__meta b { color: var(--fg-strong); font-size: var(--fs-sm); }
.pg-style .sg-ease__track { position: relative; height: 26px; margin: 6px 0; background: var(--bg); border: 1px solid var(--line-strong); box-shadow: inset 0 2px 5px rgba(0,0,0,.5); }
.pg-style .sg-ease__stone { position: absolute; top: 2px; inset-inline-start: 2px; width: 20px; height: 20px; clip-path: var(--clip-hex); background: var(--emerald-grad); }
.pg-style .sg-ease__try { justify-self: start; }
@media (max-width: 1100px) { .pg-style .sg-eases { grid-template-columns: 1fr; } .pg-style .sg-futhark { grid-template-columns: repeat(6, 1fr); } }
@media (max-width: 900px) {
  /* `1fr` resolves its minimum to min-content, and the horizontal nav scroller
     below is a nowrap flex row — that forced an 838px track inside a 358px page. */
  .pg-style .sg-layout { grid-template-columns: minmax(0, 1fr); gap: var(--s-5); }
  .pg-style .sg-nav { position: sticky; top: 60px; z-index: 5; background: var(--bg); padding-block: var(--s-2); margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); border-bottom: 1px solid var(--line); }
  .pg-style .sg-nav { min-width: 0; }
  .pg-style .sg-nav ul { display: flex; overflow-x: auto; scrollbar-width: none; border: 0; gap: 4px; min-width: 0; }
  .pg-style .sg-nav button { white-space: nowrap; border-inline-start: 0; border-bottom: 2px solid transparent; margin: 0; }
  .pg-style .sg-nav button[aria-current="true"] { border-bottom-color: var(--emerald); }
  .pg-style .sg-grid--2, .pg-style .sg-grid--3, .pg-style .sg-swatches { grid-template-columns: 1fr; }
  .pg-style .sg-shapes { grid-template-columns: repeat(3, 1fr); }
  .pg-style .sg-type { grid-template-columns: 1fr; gap: var(--s-2); }
  .pg-style .sg-hero { grid-template-columns: 1fr; justify-items: start; }
}
@media (max-width: 520px) {
  .pg-style .sg-futhark { grid-template-columns: repeat(4, 1fr); }
  .pg-style .sg-shapes { grid-template-columns: repeat(2, 1fr); }
  .pg-style .sg-ease { grid-template-columns: 1fr; }
  .pg-style .sg-swatch { grid-template-columns: 56px 1fr; }
  .pg-style .sg-swatch__chip { width: 56px; height: 56px; }
}

/* front matter: a reference document opens with its contents, not with section one */
.pg-style .sg-toc { margin: 0 0 var(--s-8); padding-block: var(--s-5); border-block: 1px solid var(--line); }
.pg-style .sg-toc ol { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px var(--s-5); }
.pg-style .sg-toc a { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: var(--s-3); padding: var(--s-2) 0; color: var(--fg); text-decoration: none; }
.pg-style .sg-toc a:hover { text-decoration: none; }
.pg-style .sg-toc a:hover .sg-toc__txt b { color: var(--accent-text); }
.pg-style .sg-toc__rune { font-family: var(--font-rune); font-size: var(--rune-md); color: var(--ornament); }
.pg-style .sg-toc a:hover .sg-toc__rune { color: var(--accent-text); }
.pg-style .sg-toc__txt { display: grid; gap: 1px; min-width: 0; }
.pg-style .sg-toc__txt b { color: var(--fg-strong); font-family: var(--font-display); font-weight: 700; }
.pg-style .sg-toc__txt small { font-size: var(--fs-2xs); line-height: 1.6; }
@media (max-width: 900px) { .pg-style .sg-toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .pg-style .sg-toc ol { grid-template-columns: 1fr; } }

.pg-style .sg-rune-scale { display: flex; align-items: baseline; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-3); }
.pg-style .sg-rune-scale .rune { letter-spacing: 0; }
.pg-style .sg-facet-note { margin-bottom: var(--s-3); }

/* auth cross-links ("offer your soul" / "enter the gate") were 22px tall targets */
.pg-auth .auth-alt a { display: inline-flex; align-items: center; min-height: 44px; padding-inline: var(--s-1); }

/* ── Niflheim: the hall of unfinished stories ── */
.pg-niflheim { position: relative; overflow: hidden; min-height: calc(100vh - 68px); padding-block: var(--s-9); background: radial-gradient(ellipse at 50% 0%, rgba(var(--fog-color), .12), transparent 60%); }
.pg-niflheim .nf-fog { position: absolute; inset: -30%; pointer-events: none; background: radial-gradient(ellipse at 20% 60%, rgba(var(--fog-color), .14), transparent 45%), radial-gradient(ellipse at 75% 35%, rgba(var(--fog-color), .1), transparent 45%); animation: nfDrift 46s ease-in-out infinite alternate; }
.pg-niflheim .nf-fog--2 { animation-duration: 64s; animation-direction: alternate-reverse; opacity: .7; }
.pg-niflheim .nif-in { position: relative; z-index: 1; }
.pg-niflheim .nif-head { text-align: center; display: grid; justify-items: center; gap: var(--s-3); margin-bottom: var(--s-8); }
.pg-niflheim .nif-head .rune { color: rgb(var(--fog-color)); letter-spacing: .4em; margin: 0; }
.pg-niflheim .nif-head h1 { margin: 0; }
.pg-niflheim .nif-head .lead { margin: 0; font-size: var(--fs-lg); }
.pg-niflheim .nif-head__p { margin: 0; max-width: 64ch; line-height: 2; }
.pg-niflheim .nif-souls { display: grid; gap: var(--s-4); max-width: 880px; margin-inline: auto; }
.pg-niflheim .nf-soul { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s-4); align-items: center; padding: var(--s-5); border-color: rgba(var(--fog-color), .28); background: linear-gradient(90deg, rgba(var(--fog-color), .07), transparent 70%), var(--bg-elev); }
.pg-niflheim .nf-soul__rune { font-family: var(--font-rune); font-size: 44px; color: rgb(var(--fog-color)); opacity: .8; text-shadow: 0 0 16px rgba(var(--fog-color), .45); }
.pg-niflheim .nf-soul__txt { display: grid; gap: 4px; }
.pg-niflheim .nf-soul__txt h2 { margin: 0; font-size: var(--fs-lg); }
.pg-niflheim .nf-soul__txt p { margin: 0; }
.pg-niflheim .nf-soul__epitaph { font-size: var(--fs-md); line-height: 1.9; color: var(--fg); }
.pg-niflheim .nf-soul__act { display: grid; gap: var(--s-2); }
@media (max-width: 640px) { .pg-niflheim .nf-soul { grid-template-columns: auto minmax(0, 1fr); } .pg-niflheim .nf-soul__act { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; } }
@media (prefers-reduced-motion: reduce) { .pg-niflheim .nf-fog { animation: none; } }
:root[data-motion="off"] .pg-niflheim .nf-fog { animation: none; }
.pg-valhalla .vh-fate + .vh-fate, .pg-valhalla .vh-fate + .vh-chars { margin-top: var(--s-7); }
.pg-valhalla .vh-fate h3 { margin: 0 0 var(--s-1); display: flex; align-items: baseline; gap: var(--s-2); }
.pg-valhalla .vh-fate > p { margin: 0 0 var(--s-4); font-size: var(--fs-sm); }
.pg-valhalla .vh-char.is-valhalla { border-color: var(--line-glow); box-shadow: var(--glow-inset-soft); }
.pg-valhalla .vh-char.is-niflheim { border-color: rgba(var(--fog-color), .35); }
.pg-valhalla .vh-char.is-niflheim .vh-char__rune { color: rgb(var(--fog-color)); }
.pg-valhalla .vh-char__epitaph { display: block; margin-top: 2px; color: var(--fg-muted); line-height: 1.8; }
