/* ==========================================================================
   Freemason — the Lodge
   Gold on lodge blue, the starry-decked heaven and the mosaic pavement.
   ========================================================================== */

:root {
    --night: #04050a;
    --lodge: #0a1024;
    --lodge-2: #0f1834;
    --lodge-3: #16224a;
    --azure: #23408a;
    --gold: #d6b25e;
    --gold-light: #f4dfa0;
    --gold-pale: #fbf0cf;
    --gold-deep: #9a7428;
    --gold-grad: linear-gradient(180deg, #fff4cc 0%, #ecca72 32%, #b4893a 58%, #f3d68c 82%, #c79d48 100%);
    --gold-grad-h: linear-gradient(90deg, #8a6420, #f6e2a0 50%, #8a6420);
    --ivory: #eee6d3;
    --parchment: #d9cdb2;
    --muted: #9f9886;
    --line: rgba(214, 178, 94, .22);
    --line-strong: rgba(214, 178, 94, .5);
    --glass: rgba(10, 16, 36, .62);
    --crimson: #7d1621;
    --radius: 14px;
    --shadow: 0 30px 80px -30px rgba(0, 0, 0, .9);
    --font-display: "Cinzel", "Trajan Pro", Georgia, serif;
    --font-body: "Cormorant Garamond", Garamond, Georgia, serif;
    --font-fell: "IM Fell English", "Cormorant Garamond", Georgia, serif;
    --header-h: 76px;
    --ease: cubic-bezier(.2, .7, .1, 1);
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    font-size: 1.2rem;
    line-height: 1.65;
    color: var(--ivory);
    background:
        radial-gradient(ellipse 120% 70% at 50% -10%, #1a2a5e 0%, rgba(16, 24, 52, .6) 40%, transparent 70%),
        radial-gradient(ellipse 80% 50% at 50% 120%, rgba(214, 178, 94, .08), transparent 70%),
        linear-gradient(180deg, #070b1c 0%, var(--night) 60%);
    background-attachment: fixed;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}
body.is-gated, body.nav-open { overflow: hidden; }

img, svg { display: block; max-width: 100%; }
a { color: var(--gold-light); text-decoration: none; transition: color .2s; }
a:hover { color: var(--gold-pale); }
button { font: inherit; color: inherit; }
::selection { background: rgba(214, 178, 94, .4); color: #fff; }
:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 3px; border-radius: 4px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 16px; top: -60px; z-index: 100; padding: .6rem 1rem; background: var(--gold); color: #111; border-radius: 8px; font-family: var(--font-display); }
.skip-link:focus { top: 12px; }
.center { text-align: center; }
.muted { color: var(--muted); }
code { font-family: ui-monospace, Menlo, monospace; font-size: .85em; }

.sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -2; pointer-events: none; }
.vignette { position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, .65) 100%); }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; letter-spacing: .02em; }
p { margin: 0 0 1em; }
.display, .display-xl {
    font-family: var(--font-display);
    font-weight: 600;
    background: var(--gold-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 2px 10px rgba(214, 178, 94, .18));
}
.display { font-size: clamp(2rem, 4.2vw, 3.3rem); }
.display-xl { font-size: clamp(2.2rem, 5.5vw, 4.4rem); letter-spacing: .03em; max-width: 18ch; margin-inline: auto; }
.eyebrow {
    display: inline-flex; align-items: center; gap: .9em;
    font-family: var(--font-display); font-size: .8rem; letter-spacing: .32em; text-transform: uppercase;
    color: var(--gold); margin: 0 0 1rem;
}
.eyebrow::before, .eyebrow::after { content: ""; width: 2.4em; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.eyebrow::after { transform: scaleX(-1); }
.lede { font-size: clamp(1.2rem, 1.8vw, 1.45rem); color: var(--parchment); max-width: 60ch; margin-inline: auto; }
.hero-sub { font-family: var(--font-fell); font-style: italic; font-size: clamp(1.25rem, 2.2vw, 1.75rem); color: var(--parchment); }

/* ---------- Buttons ---------- */
.btn {
    --h: 52px;
    display: inline-flex; align-items: center; justify-content: center; gap: .6em;
    min-height: var(--h); padding: 0 1.6em;
    font-family: var(--font-display); font-size: .86rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
    border-radius: 999px; border: 1px solid transparent; cursor: pointer;
    transition: transform .3s var(--ease), box-shadow .3s, background .3s, color .3s, border-color .3s;
    white-space: nowrap;
}
.btn svg { width: 1.15em; height: 1.15em; flex: none; }
.btn-gold {
    color: #1b1406;
    background: var(--gold-grad);
    background-size: 100% 180%;
    box-shadow: 0 0 0 1px rgba(255, 236, 180, .35) inset, 0 10px 30px -10px rgba(214, 178, 94, .7);
}
.btn-gold:hover { color: #000; transform: translateY(-2px); background-position: 0 100%; box-shadow: 0 0 0 1px rgba(255, 236, 180, .5) inset, 0 16px 40px -10px rgba(214, 178, 94, .9); }
.btn-ghost { color: var(--gold-light); border-color: var(--line-strong); background: rgba(10, 16, 36, .45); backdrop-filter: blur(6px); }
.btn-ghost:hover { color: var(--gold-pale); border-color: var(--gold); background: rgba(214, 178, 94, .1); transform: translateY(-2px); }
.btn-ghost.is-on { background: rgba(214, 178, 94, .2); border-color: var(--gold); color: #ffb3b3; }
.btn-sm { --h: 40px; padding: 0 1.1em; font-size: .74rem; }
.btn-icon { padding: 0; width: var(--h); }
.icon-btn { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: rgba(4, 5, 10, .5); cursor: pointer; color: var(--gold-light); transition: .2s; flex: none; }
.icon-btn:hover:not(:disabled) { border-color: var(--gold); background: rgba(214, 178, 94, .12); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.icon-btn svg { width: 20px; height: 20px; }
.flip { transform: scaleX(-1); }
.link { background: none; border: 0; padding: 0; color: var(--gold-light); cursor: pointer; border-bottom: 1px solid var(--line-strong); }
.link:hover { color: var(--gold-pale); border-color: var(--gold); }

/* ---------- Header ---------- */
.site-header {
    position: fixed; inset: 0 0 auto; z-index: 50; height: var(--header-h);
    transition: background .4s, box-shadow .4s, backdrop-filter .4s;
}
.site-header.is-scrolled, body:not(.page-home) .site-header {
    background: linear-gradient(180deg, rgba(4, 6, 14, .92), rgba(6, 10, 24, .82));
    backdrop-filter: blur(14px) saturate(1.2);
    box-shadow: 0 1px 0 var(--line), 0 20px 40px -20px rgba(0, 0, 0, .8);
}
.header-inner { max-width: 1320px; height: 100%; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 14px; color: var(--ivory); margin-right: auto; }
.brand-mark { width: 44px; height: 44px; fill: url(#g-gold); filter: drop-shadow(0 0 10px rgba(214, 178, 94, .45)); transition: transform .6s var(--ease); }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.32rem; letter-spacing: .2em; text-transform: uppercase; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-motto { font-family: var(--font-fell); font-style: italic; font-size: .92rem; color: var(--muted); margin-top: 4px; letter-spacing: .06em; }

.site-nav { display: flex; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 6px; }
.nav-group { position: relative; }
.nav-trigger {
    display: flex; align-items: center; gap: .45em; height: 44px; padding: 0 16px; border: 0; background: none; cursor: pointer;
    font-family: var(--font-display); font-size: .82rem; letter-spacing: .2em; text-transform: uppercase; color: var(--parchment);
    border-radius: 999px; transition: color .2s, background .2s;
}
.nav-trigger svg { width: 14px; height: 14px; transform: rotate(90deg); transition: transform .3s; opacity: .7; }
.nav-trigger:hover, .nav-group.is-open .nav-trigger { color: var(--gold-pale); background: rgba(214, 178, 94, .08); }
.nav-group.is-active .nav-trigger { color: var(--gold-light); }
.nav-group.is-active .nav-trigger::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 5px; height: 5px; margin-left: -2.5px; transform: rotate(45deg); background: var(--gold); }
.nav-group.is-open .nav-trigger svg { transform: rotate(-90deg); }
.nav-menu {
    list-style: none; margin: 0; padding: 10px; position: absolute; top: calc(100% + 12px); left: 50%; min-width: 290px;
    background: linear-gradient(180deg, rgba(14, 22, 48, .97), rgba(6, 9, 22, .97));
    border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow), 0 0 0 1px rgba(0, 0, 0, .4);
    opacity: 0; visibility: hidden; transform: translate(-50%, -8px); transition: .25s var(--ease);
}
.nav-menu::before { content: ""; position: absolute; top: -6px; left: 50%; width: 12px; height: 12px; margin-left: -6px; transform: rotate(45deg); background: #0e1630; border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
.nav-group.is-open .nav-menu { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
@media (hover: hover) and (min-width: 961px) {
    .nav-group:hover .nav-menu { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
    .nav-group:hover .nav-trigger svg { transform: rotate(-90deg); }
    .nav-group::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 14px; }
}
.nav-menu a { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 10px; color: var(--ivory); transition: background .2s; }
.nav-menu a:hover, .nav-menu a[aria-current="page"] { background: rgba(214, 178, 94, .1); }
.nav-menu a svg { width: 34px; height: 34px; padding: 6px; border-radius: 10px; border: 1px solid var(--line); color: var(--gold); fill: var(--gold); flex: none; }
.nav-menu a span { display: flex; flex-direction: column; font-family: var(--font-display); font-size: .92rem; letter-spacing: .06em; line-height: 1.25; }
.nav-menu a small { font-family: var(--font-body); font-style: italic; font-size: .95rem; color: var(--muted); letter-spacing: 0; }
.nav-cta { margin-left: 10px; }
.nav-toggle { display: none; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line-strong); background: rgba(4, 5, 10, .5); cursor: pointer; color: var(--gold-light); place-items: center; }
.nav-toggle svg { width: 22px; height: 22px; }

/* ---------- Seal (Origins) ---------- */
.seal { position: fixed; right: 22px; bottom: 22px; z-index: 40; display: flex; align-items: center; flex-direction: row-reverse; gap: 0; color: var(--gold-pale); }
.seal-wax {
    position: relative; width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; flex: none;
    background: radial-gradient(circle at 35% 30%, #c2323f, #7d1621 55%, #3e070d 100%);
    box-shadow: 0 10px 30px -6px rgba(0, 0, 0, .8), inset 0 -4px 10px rgba(0, 0, 0, .5), inset 0 3px 6px rgba(255, 160, 160, .25);
    transition: transform .4s var(--ease);
}
.seal-wax::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; border: 1.5px dashed rgba(255, 210, 160, .35); }
.seal-wax svg { width: 36px; height: 36px; fill: url(#g-gold); filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .6)); }
.seal-label {
    font-family: var(--font-display); font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; white-space: nowrap;
    padding: 10px 18px 10px 20px; margin-right: -12px; border-radius: 999px 0 0 999px; background: rgba(6, 9, 22, .9); border: 1px solid var(--line);
    max-width: 0; opacity: 0; overflow: hidden; padding-inline: 0; transition: .45s var(--ease);
}
.seal:hover .seal-label, .seal:focus-visible .seal-label { max-width: 260px; opacity: 1; padding-inline: 20px 26px; }
.seal:hover .seal-wax { transform: rotate(-12deg) scale(1.06); }

/* ---------- Main ---------- */
.site-main { position: relative; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 860px; }
.section { position: relative; padding: clamp(80px, 12vw, 150px) 24px; }
.section-head { text-align: center; max-width: 820px; margin: 0 auto clamp(40px, 6vw, 70px); }

.reveal { opacity: 0; transform: translateY(26px); transition: opacity 1s var(--ease) var(--rd, 0ms), transform 1s var(--ease) var(--rd, 0ms); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Hero ---------- */
.hero {
    position: relative; min-height: 100vh; min-height: 100svh; display: grid; place-items: center; overflow: hidden;
    padding: calc(var(--header-h) + 20px) 24px 22vh; text-align: center; isolation: isolate;
}
.hero-rays {
    position: absolute; left: 50%; top: 32%; width: 160vmax; height: 160vmax; transform: translate(-50%, -50%); z-index: -1; opacity: .5;
    background: repeating-conic-gradient(from 0deg, rgba(244, 223, 160, .09) 0deg 3deg, transparent 3deg 12deg);
    -webkit-mask-image: radial-gradient(circle, #000 0%, transparent 45%);
    mask-image: radial-gradient(circle, #000 0%, transparent 45%);
    animation: spin 160s linear infinite;
}
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.hero-content { position: relative; z-index: 2; max-width: 900px; }
.hero-emblem { position: relative; width: clamp(130px, 18vw, 200px); aspect-ratio: 1; margin: 0 auto 18px; }
.hero-emblem svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.emblem-line { fill: none; stroke: var(--gold-light); stroke-width: .9; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.6s var(--ease) .3s forwards; }
.emblem-fill { fill: url(#g-gold); opacity: 0; animation: fadeIn 1.6s ease 2.2s forwards; filter: drop-shadow(0 0 22px rgba(244, 210, 120, .55)); }
.emblem-glow { position: absolute; inset: -60%; z-index: -1; border-radius: 50%; background: radial-gradient(circle, rgba(255, 228, 160, .35), rgba(214, 178, 94, .08) 40%, transparent 65%); animation: breathe 6s ease-in-out infinite; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fadeIn { to { opacity: 1; } }
@keyframes breathe { 0%, 100% { opacity: .65; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.05); } }
.hero-title { margin: 0; font-size: clamp(2.5rem, 7vw, 7.2rem); font-weight: 600; letter-spacing: .1em; line-height: 1; text-transform: uppercase; }
.hero-title span { display: inline-block; background: var(--gold-grad); background-size: 100% 140%; -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 24px rgba(214, 178, 94, .3)); animation: shimmer 8s ease-in-out infinite; }
@keyframes shimmer { 0%, 100% { background-position: 0 0; } 50% { background-position: 0 100%; } }
.hero .hero-sub { margin: 18px 0 6px; font-size: clamp(1.3rem, 2.6vw, 2rem); }
.hero-greek { font-family: var(--font-display); font-size: .86rem; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 34px; }

.hero-pillar { position: absolute; bottom: 14vh; z-index: 1; width: clamp(80px, 9vw, 160px); display: flex; flex-direction: column; align-items: center; filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .8)); }
.hero-pillar-left { left: clamp(12px, 4vw, 120px); }
.hero-pillar-right { right: clamp(12px, 4vw, 120px); }
.pillar-svg { width: 100%; height: auto; }
.pillar-name { margin-top: 10px; padding: 3px 10px 3px 14px; border-radius: 999px; background: rgba(4, 5, 10, .75); border: 1px solid var(--line); font-family: var(--font-display); font-size: .72rem; letter-spacing: .4em; text-transform: uppercase; color: var(--gold); opacity: .8; }

.mosaic { position: absolute; left: 0; right: 0; bottom: 0; height: 30vh; perspective: 420px; perspective-origin: 50% 0%; overflow: hidden; z-index: 0; }
.mosaic-tiles {
    position: absolute; left: -60%; right: -60%; top: 0; height: 260%; transform-origin: 50% 0; transform: rotateX(62deg);
    background: repeating-conic-gradient(#e9e3d2 0 25%, #0b0b10 0 50%) 0 0 / 90px 90px;
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, .9) 22%, #000 60%);
    mask-image: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, .9) 22%, #000 60%);
    animation: floor 30s linear infinite;
}
.mosaic::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, var(--night) 0%, transparent 35%, transparent 70%, rgba(4, 5, 10, .9) 100%), radial-gradient(ellipse at 50% 0%, rgba(244, 223, 160, .2), transparent 60%); }
@keyframes floor { to { background-position: 0 180px; } }
.scroll-cue { position: absolute; bottom: 26px; left: 50%; z-index: 3; width: 26px; height: 42px; margin-left: -13px; border: 1.5px solid var(--line-strong); border-radius: 14px; }
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--gold); animation: cue 2s ease-in-out infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- Degree cards ---------- */
.degree-cards { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.degree-card {
    position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; text-align: center;
    padding: 46px 30px 34px; border-radius: 22px; color: var(--ivory);
    background:
        linear-gradient(180deg, rgba(22, 34, 74, .75), rgba(6, 9, 22, .9)) padding-box,
        linear-gradient(160deg, rgba(244, 223, 160, .7), rgba(214, 178, 94, .1) 40%, rgba(214, 178, 94, .5)) border-box;
    border: 1px solid transparent;
    box-shadow: var(--shadow);
    transition: transform .6s var(--ease), box-shadow .6s;
}
.degree-card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 0%, rgba(244, 223, 160, .18), transparent 60%); opacity: 0; transition: opacity .6s; }
.degree-card:hover { transform: translateY(-10px); box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 1), 0 0 60px -20px rgba(214, 178, 94, .5); color: var(--ivory); }
.degree-card:hover::before { opacity: 1; }
.degree-numeral { position: absolute; top: -10px; right: 18px; font-family: var(--font-display); font-size: 7rem; font-weight: 700; line-height: 1; color: rgba(214, 178, 94, .07); }
.degree-icon { width: 86px; height: 86px; color: var(--gold); fill: var(--gold); margin-bottom: 22px; filter: drop-shadow(0 0 16px rgba(214, 178, 94, .4)); transition: transform .8s var(--ease); }
.degree-card:hover .degree-icon { transform: scale(1.1) rotate(-4deg); }
.degree-kicker { font-family: var(--font-display); font-size: .74rem; letter-spacing: .34em; text-transform: uppercase; color: var(--gold); }
.degree-card h3 { font-size: 1.7rem; margin: 10px 0 12px; color: var(--gold-pale); }
.degree-card p { color: var(--parchment); font-size: 1.15rem; }
.degree-latin { font-family: var(--font-fell); font-style: italic; color: var(--muted); margin-bottom: 18px; }
.degree-go { margin-top: auto; display: inline-flex; align-items: center; gap: .5em; font-family: var(--font-display); font-size: .76rem; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-light); }
.degree-go svg { width: 16px; height: 16px; transition: transform .3s; }
.degree-card:hover .degree-go svg, .origin-card:hover .degree-go svg { transform: translateX(5px); }

/* ---------- Three great lights ---------- */
.lights { background: linear-gradient(180deg, transparent, rgba(16, 24, 52, .5) 30%, rgba(16, 24, 52, .5) 70%, transparent); }
.lights-inner { max-width: 1180px; margin: 0 auto; }
.lights-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.light { text-align: center; padding: 0 10px; }
.light h3 { font-size: 1.3rem; color: var(--gold-pale); }
.light p { color: var(--parchment); }
.light-icon { width: 56px; height: 56px; margin: 18px auto; color: var(--gold); }
.candle { position: relative; width: 22px; height: 110px; margin: 0 auto; }
.candle .wax { position: absolute; bottom: 0; left: 0; width: 22px; height: 76px; border-radius: 4px 4px 2px 2px; background: linear-gradient(90deg, #b9ab8a, #f6efdc 45%, #cbbd9c); box-shadow: inset 0 6px 6px -4px rgba(0, 0, 0, .4); }
.candle .wax::before { content: ""; position: absolute; top: -6px; left: 10px; width: 2px; height: 8px; background: #2b2216; }
.candle .flame { position: absolute; left: 50%; bottom: 80px; width: 14px; height: 30px; margin-left: -7px; border-radius: 50% 50% 35% 35% / 65% 65% 35% 35%; background: radial-gradient(ellipse at 50% 80%, #fff 0%, #ffe9a8 25%, #ffb648 60%, rgba(255, 120, 30, 0) 100%); transform-origin: 50% 100%; animation: flicker 3s ease-in-out infinite; filter: blur(.3px); }
.candle .flame::after { content: ""; position: absolute; left: 50%; top: 50%; width: 180px; height: 180px; margin: -90px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 200, 110, .28), transparent 60%); animation: glow 3s ease-in-out infinite; pointer-events: none; }
.light:nth-child(2) .flame { animation-delay: -.8s; }
.light:nth-child(3) .flame { animation-delay: -1.7s; }
@keyframes flicker { 0%, 100% { transform: scale(1, 1) rotate(-1deg); } 25% { transform: scale(.94, 1.08) rotate(2deg); } 50% { transform: scale(1.04, .94) rotate(-2deg); } 75% { transform: scale(.97, 1.04) rotate(1deg); } }
@keyframes glow { 0%, 100% { opacity: .85; } 50% { opacity: 1; transform: scale(1.06); } }

/* ---------- Library teaser ---------- */
.stats { max-width: 980px; margin: 0 auto 50px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.stat { background: rgba(6, 9, 22, .85); padding: 26px 10px; text-align: center; }
.stat-num { display: block; font-family: var(--font-display); font-size: clamp(2rem, 4vw, 3rem); font-weight: 600; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1.1; }
.stat-label { font-family: var(--font-display); font-size: .72rem; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); }

.search-hero { position: relative; max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 22px; border-radius: 999px; background: rgba(6, 9, 22, .8); border: 1px solid var(--line-strong); box-shadow: 0 0 0 6px rgba(214, 178, 94, .05), var(--shadow); transition: box-shadow .3s, border-color .3s; }
.search-hero:focus-within { border-color: var(--gold); box-shadow: 0 0 0 6px rgba(214, 178, 94, .14), var(--shadow); }
.search-hero > svg { width: 22px; height: 22px; color: var(--gold); flex: none; }
.search-hero input { flex: 1; min-width: 0; height: 48px; border: 0; background: none; outline: none; color: var(--ivory); font-family: var(--font-body); font-size: 1.3rem; }
.search-hero input::placeholder { color: #7d7767; font-style: italic; }
.search-hero input::-webkit-search-cancel-button { filter: sepia(1) saturate(3); }
.kbd { font-family: ui-monospace, Menlo, monospace; font-size: .8rem; padding: 3px 9px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--muted); }

.shelf { position: relative; max-width: 1100px; margin: 60px auto 40px; padding: 0 30px; display: flex; align-items: flex-end; justify-content: center; gap: 16px; flex-wrap: nowrap; overflow: hidden; }
.shelf-plank { position: absolute; left: 0; right: 0; bottom: -18px; height: 20px; border-radius: 3px; background: linear-gradient(180deg, #5b3b1c, #2d1b0b); box-shadow: 0 18px 30px -10px rgba(0, 0, 0, .9), inset 0 2px 0 rgba(255, 210, 150, .2); }
.mini-book { flex: 0 0 auto; width: clamp(70px, 9vw, 104px); transition: transform .5s var(--ease); }
.mini-book:nth-child(3n) { width: clamp(64px, 8vw, 94px); }
.mini-book:hover { transform: translateY(-14px) rotate(-2deg); }
.mini-cover { position: relative; display: grid; place-items: center; aspect-ratio: 2 / 3; padding: 10px; overflow: hidden; border-radius: 3px 6px 6px 3px; background: linear-gradient(90deg, rgba(0, 0, 0, .5), transparent 12%), radial-gradient(circle at 30% 20%, #6b2626, #3a0f0f); box-shadow: inset 0 0 0 1px rgba(214, 178, 94, .35), inset 4px 0 0 rgba(0, 0, 0, .35), 0 16px 26px -10px rgba(0, 0, 0, .9); }
.mini-book:nth-child(2n) .mini-cover { background: linear-gradient(90deg, rgba(0, 0, 0, .5), transparent 12%), radial-gradient(circle at 30% 20%, #23386e, #0d1530); }
.mini-book:nth-child(3n) .mini-cover { background: linear-gradient(90deg, rgba(0, 0, 0, .5), transparent 12%), radial-gradient(circle at 30% 20%, #2a4a33, #0f1f14); }
.mini-title { font-family: var(--font-display); font-size: .56rem; letter-spacing: .06em; line-height: 1.3; text-align: center; color: var(--gold-light); display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.mini-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: sepia(.35) contrast(1.05) brightness(.92); opacity: 0; transition: opacity .6s; }
.mini-cover.has-scan img { opacity: 1; }
.mini-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0, 0, 0, .45), transparent 14%, transparent 85%, rgba(0, 0, 0, .25)); pointer-events: none; }

/* ---------- Threshold ---------- */
.threshold-grid { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(40px, 6vw, 90px); align-items: center; }
.gilded-frame { position: relative; margin: 0; padding: 18px; border-radius: 6px; background: var(--gold-grad); box-shadow: 0 0 0 1px #3d2c0c, inset 0 0 0 3px rgba(60, 40, 10, .6), 0 50px 100px -30px rgba(0, 0, 0, 1), 0 0 80px -30px rgba(214, 178, 94, .5); }
.gilded-frame::before { content: ""; position: absolute; inset: 9px; border: 2px solid rgba(70, 48, 12, .55); border-radius: 3px; pointer-events: none; }
.gilded-frame img { width: 100%; height: auto; border-radius: 2px; box-shadow: inset 0 0 30px #000, 0 0 0 2px #2b1e08; filter: contrast(1.05); }
.threshold-copy p { color: var(--parchment); font-size: 1.25rem; }
.quote { margin: 30px 0 0; padding: 22px 0 0 28px; border-left: 2px solid var(--gold); font-family: var(--font-fell); font-style: italic; font-size: 1.45rem; line-height: 1.45; color: var(--gold-pale); }
.quote cite { display: block; margin-top: 10px; font-family: var(--font-display); font-style: normal; font-size: .74rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.container .quote { text-align: center; border: 0; padding: 40px 0 0; }

/* ---------- Origins ---------- */
.origins-grid { max-width: 1080px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.origin-card {
    position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; padding: 40px; border-radius: 22px; color: var(--ivory);
    background: linear-gradient(140deg, rgba(125, 22, 33, .35), rgba(6, 9, 22, .9) 55%) padding-box, linear-gradient(140deg, rgba(244, 223, 160, .6), rgba(214, 178, 94, .1)) border-box;
    border: 1px solid transparent; box-shadow: var(--shadow); transition: transform .6s var(--ease);
}
.origin-card:nth-child(2) { background: linear-gradient(140deg, rgba(35, 64, 138, .4), rgba(6, 9, 22, .9) 55%) padding-box, linear-gradient(140deg, rgba(244, 223, 160, .6), rgba(214, 178, 94, .1)) border-box; }
.origin-card:hover { transform: translateY(-8px); color: var(--ivory); }
.origin-card .eyebrow { margin-bottom: .5rem; }
.origin-card .eyebrow::before { display: none; }
.origin-card h3 { font-size: 1.9rem; color: var(--gold-pale); }
.origin-card p { color: var(--parchment); }
.origin-icon { position: absolute; right: -20px; top: -20px; width: 170px; height: 170px; color: rgba(214, 178, 94, .1); }

/* ---------- Footer ---------- */
.site-footer { position: relative; margin-top: 60px; padding: 90px 24px 40px; background: linear-gradient(180deg, transparent, rgba(4, 5, 10, .95) 30%); border-top: 1px solid var(--line); }
.footer-floor { position: absolute; left: 0; right: 0; top: -1px; height: 10px; background: repeating-conic-gradient(#e9e3d2 0 25%, #0b0b10 0 50%) 0 0 / 20px 20px; opacity: .6; }
.footer-inner { max-width: 1180px; margin: 0 auto; }
.footer-emblem { text-align: center; margin-bottom: 50px; }
.footer-emblem svg { width: 60px; height: 60px; margin: 0 auto 14px; fill: url(#g-gold); }
.footer-quote { font-family: var(--font-fell); font-style: italic; font-size: 1.6rem; color: var(--gold-pale); margin: 0; }
.footer-sub { font-family: var(--font-display); font-size: .72rem; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); }
.footer-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; padding: 40px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.footer-cols h4 { font-size: .76rem; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; }
.footer-cols a { display: block; color: var(--parchment); padding: 3px 0; font-size: 1.1rem; overflow-wrap: anywhere; }
.footer-cols a:hover { color: var(--gold-pale); }
.footer-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 14px; margin: 26px 0 0; font-size: .95rem; color: var(--muted); text-align: center; }
.footer-legal .dot { color: var(--gold-deep); font-size: .6rem; align-self: center; }

/* ---------- Inner page hero ---------- */
.page-hero { position: relative; text-align: center; padding: calc(var(--header-h) + clamp(60px, 9vw, 110px)) 24px clamp(50px, 7vw, 80px); overflow: hidden; isolation: isolate; }
.page-hero::before { content: ""; position: absolute; left: 50%; top: 0; width: 1100px; height: 700px; transform: translateX(-50%); z-index: -1; background: radial-gradient(ellipse at 50% 30%, rgba(214, 178, 94, .16), transparent 60%); }
.hero-numeral { position: absolute; left: 50%; top: calc(var(--header-h) - 10px); transform: translateX(-50%); z-index: -1; font-family: var(--font-display); font-weight: 700; font-size: clamp(10rem, 30vw, 22rem); line-height: 1; color: transparent; -webkit-text-stroke: 1px rgba(214, 178, 94, .12); white-space: nowrap; }
.page-hero-icon { width: 76px; height: 76px; margin: 0 auto 22px; color: var(--gold); fill: var(--gold); filter: drop-shadow(0 0 18px rgba(214, 178, 94, .5)); animation: float 7s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.page-hero .hero-sub { max-width: 46ch; margin: 18px auto 0; }
.status-hero { min-height: 80vh; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.status-hero .btn { margin-top: 26px; }

.steps { list-style: none; display: flex; justify-content: center; align-items: flex-start; gap: 0; margin: 46px auto 0; padding: 0; max-width: 640px; }
.steps li { flex: 1; position: relative; }
.steps li + li::before { content: ""; position: absolute; top: 22px; right: 50%; width: 100%; height: 1px; background: var(--line-strong); z-index: -1; }
.steps li.is-done + li::before, .steps li.is-current::before { background: var(--gold); }
.steps a { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--muted); }
.step-dot { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--lodge); font-family: var(--font-display); font-size: .9rem; color: var(--gold); transition: .3s; }
.step-name { font-family: var(--font-display); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; }
.steps .is-current .step-dot { background: var(--gold-grad); color: #1b1406; border-color: transparent; box-shadow: 0 0 24px rgba(214, 178, 94, .6); }
.steps .is-current a { color: var(--gold-pale); }
.steps .is-done .step-dot { border-color: var(--gold); }
.steps a:hover .step-dot { border-color: var(--gold); transform: scale(1.06); }

/* ---------- Degree page ---------- */
.degree-intro { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(30px, 5vw, 70px); align-items: start; margin: 30px 0 90px; }
.prose p { font-size: 1.32rem; color: var(--parchment); }
.dropcap::first-letter { float: left; font-family: var(--font-display); font-weight: 700; font-size: 4.6em; line-height: .82; padding: 6px 12px 0 0; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.virtue { margin-top: 30px; padding: 22px 26px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(10, 16, 36, .5); font-family: var(--font-fell); font-style: italic; font-size: 1.4rem !important; color: var(--gold-pale) !important; }
.virtue span { display: block; font-family: var(--font-display); font-style: normal; font-size: .7rem; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; }
.symbol-card { position: sticky; top: calc(var(--header-h) + 24px); padding: 36px 32px; text-align: center; border-radius: 22px; background: linear-gradient(180deg, rgba(22, 34, 74, .8), rgba(6, 9, 22, .92)) padding-box, linear-gradient(170deg, rgba(244, 223, 160, .7), rgba(214, 178, 94, .1)) border-box; border: 1px solid transparent; box-shadow: var(--shadow); }
.symbol-card svg { width: 110px; height: 110px; margin: 0 auto 18px; color: var(--gold); fill: var(--gold); filter: drop-shadow(0 0 20px rgba(214, 178, 94, .4)); }
.symbol-card h3 { font-size: 1.45rem; color: var(--gold-pale); }
.symbol-card p { color: var(--parchment); }
.symbol-card .btn { margin-top: 6px; }

.tools { margin-bottom: 90px; }
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.tool { padding: 34px 28px; border-radius: 18px; border: 1px solid var(--line); background: rgba(8, 12, 28, .65); text-align: center; transition: border-color .4s, transform .5s var(--ease), background .4s; }
.tool:hover { border-color: var(--line-strong); transform: translateY(-6px); background: rgba(16, 24, 52, .75); }
.tool svg { width: 64px; height: 64px; margin: 0 auto 18px; color: var(--gold); }
.tool h3 { font-size: 1.15rem; color: var(--gold-pale); }
.tool p { color: var(--parchment); margin: 0; font-size: 1.12rem; }

.plaque { display: flex; gap: 26px; align-items: flex-start; margin: 0 0 60px; padding: 30px 34px; border-radius: 16px; background: linear-gradient(180deg, rgba(60, 44, 14, .35), rgba(20, 14, 4, .5)); border: 1px solid var(--line-strong); box-shadow: inset 0 1px 0 rgba(255, 230, 170, .12); }
.plaque-icon { width: 58px; height: 58px; flex: none; color: var(--gold); }
.plaque h3 { font-size: 1rem; letter-spacing: .3em; text-transform: uppercase; margin-bottom: 10px; }
.plaque h3 a { color: #f0a35a; border-bottom: 1px solid rgba(240, 163, 90, .4); }
.plaque p { margin: 0; color: #f0c48a; font-weight: 500; font-size: 1.15rem; }

.lectern { margin-bottom: 70px; border-radius: 20px; overflow: hidden; border: 1px solid var(--line-strong); background: #0a0806; box-shadow: var(--shadow), 0 0 80px -40px rgba(214, 178, 94, .4); }
.lectern-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 18px; background: linear-gradient(180deg, #2a1d0c, #170f05); border-bottom: 1px solid var(--line-strong); }
.lectern-title { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); letter-spacing: .08em; color: var(--gold-pale); }
.lectern-title svg { width: 26px; height: 26px; color: var(--gold); }
.lectern-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.lectern-page { background: #3a3a3a; }
.lectern-page iframe { display: block; width: 100%; height: min(82vh, 920px); border: 0; background: #525659; }
.lectern-page:fullscreen iframe { height: 100vh; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 40px; }
.pager-link { display: flex; flex-direction: column; padding: 24px 28px; border-radius: 16px; border: 1px solid var(--line); background: rgba(8, 12, 28, .6); transition: .3s; }
.pager-link:hover { border-color: var(--gold); background: rgba(16, 24, 52, .8); }
.pager-link span { font-family: var(--font-display); font-size: .7rem; letter-spacing: .26em; text-transform: uppercase; color: var(--muted); }
.pager-link strong { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; color: var(--gold-pale); }
.pager-next { text-align: right; }

/* ---------- About / Contact ---------- */
.about-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 50px 0; }
.about-card { padding: 30px 24px; border-radius: 18px; border: 1px solid var(--line); background: rgba(8, 12, 28, .65); color: var(--ivory); transition: .4s var(--ease); }
.about-card:hover { transform: translateY(-6px); border-color: var(--line-strong); color: var(--ivory); }
.about-card svg { width: 48px; height: 48px; color: var(--gold); margin-bottom: 14px; }
.about-card h3 { color: var(--gold-pale); font-size: 1.2rem; }
.about-card p { color: var(--parchment); margin: 0; font-size: 1.1rem; }

.contact-card { position: relative; margin: 20px auto 40px; padding: 70px 40px 50px; text-align: center; border-radius: 26px; background: linear-gradient(180deg, rgba(22, 34, 74, .8), rgba(6, 9, 22, .94)) padding-box, linear-gradient(170deg, rgba(244, 223, 160, .7), rgba(214, 178, 94, .1)) border-box; border: 1px solid transparent; box-shadow: var(--shadow); }
.contact-seal { position: absolute; top: -40px; left: 50%; width: 80px; height: 80px; margin-left: -40px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #c2323f, #7d1621 55%, #3e070d 100%); box-shadow: 0 14px 30px -8px rgba(0, 0, 0, .9); }
.contact-seal svg { width: 44px; height: 44px; fill: url(#g-gold); }
.contact-card h2 { font-size: 1.1rem; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.contact-card p { color: var(--parchment); }
.contact-mail { display: inline-block; margin: 6px 0 30px; font-family: var(--font-display); font-size: clamp(1.1rem, 3.4vw, 1.8rem); letter-spacing: .04em; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; overflow-wrap: anywhere; }
.contact-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

/* ==========================================================================
   The Library
   ========================================================================== */
.library-hero { padding-bottom: 40px; }
.library-search { margin-top: 36px; }
.library { max-width: 1440px; margin: 0 auto; padding: 0 24px 80px; display: grid; grid-template-columns: 270px 1fr; gap: 36px; align-items: start; }
.lib-sidebar { position: sticky; top: calc(var(--header-h) + 20px); max-height: calc(100vh - var(--header-h) - 40px); overflow: auto; padding: 24px 20px; border-radius: 18px; border: 1px solid var(--line); background: rgba(6, 9, 22, .75); backdrop-filter: blur(10px); scrollbar-width: thin; scrollbar-color: var(--gold-deep) transparent; }
.lib-filter + .lib-filter { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.lib-filter h3 { font-size: .72rem; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; }
.chip-list { display: flex; flex-direction: column; gap: 4px; }
.chip { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 8px 12px; border-radius: 10px; border: 1px solid transparent; background: none; cursor: pointer; text-align: left; font-size: 1.08rem; color: var(--parchment); transition: .2s; }
.chip span { font-family: var(--font-display); font-size: .74rem; color: var(--muted); }
.chip:hover { background: rgba(214, 178, 94, .08); color: var(--gold-pale); }
.chip.is-on { background: rgba(214, 178, 94, .14); border-color: var(--line-strong); color: var(--gold-pale); }
.chip.is-on span { color: var(--gold-light); }
.chip-shelf { justify-content: flex-start; }
.chip-shelf svg { width: 18px; height: 18px; color: #e08080; }
.chip-shelf span { margin-left: auto; }

.lib-toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.lib-count { margin: 0 auto 0 0; color: var(--muted); font-size: 1.1rem; }
.lib-count strong { font-family: var(--font-display); color: var(--gold-light); font-weight: 600; }
.lib-controls { display: flex; gap: 10px; align-items: center; }
.lib-filters-toggle { display: none; }
.select select { height: 40px; padding: 0 36px 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: rgba(6, 9, 22, .8) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d6b25e' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 16px; color: var(--ivory); font-family: var(--font-display); font-size: .78rem; letter-spacing: .08em; appearance: none; cursor: pointer; }
.seg { display: flex; padding: 3px; border-radius: 999px; border: 1px solid var(--line-strong); background: rgba(6, 9, 22, .8); }
.seg button { display: grid; place-items: center; width: 36px; height: 32px; border: 0; border-radius: 999px; background: none; cursor: pointer; color: var(--muted); }
.seg button svg { width: 18px; height: 18px; }
.seg button.is-on { background: var(--gold-grad); color: #1b1406; }

.az { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 14px; }
.az button { min-width: 32px; height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line); background: rgba(6, 9, 22, .6); color: var(--parchment); font-family: var(--font-display); font-size: .8rem; cursor: pointer; transition: .2s; }
.az button:hover:not(:disabled) { border-color: var(--gold); color: var(--gold-pale); }
.az button.is-on { background: var(--gold-grad); color: #1b1406; border-color: transparent; }
.az button:disabled { opacity: .25; cursor: default; }

.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.active-filters:empty { display: none; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px 6px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: rgba(214, 178, 94, .1); color: var(--gold-pale); cursor: pointer; font-size: 1rem; }
.pill svg { width: 14px; height: 14px; opacity: .7; }
.pill:hover { border-color: var(--gold); }
.pill-all { background: none; color: var(--muted); padding-right: 14px; }

/* Results — the bookshelf */
.lib-main { min-width: 0; }
.results.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 40px 26px; }
.book-card { min-width: 0; position: relative; display: flex; flex-direction: column; gap: 14px; padding: 0; border: 0; background: none; cursor: pointer; text-align: left; perspective: 900px; animation: rise .7s var(--ease) both; animation-delay: var(--d, 0ms); }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
.book-caption { display: flex; flex-direction: column; gap: 3px; }
.book-caption strong { font-family: var(--font-body); font-weight: 600; font-size: 1.08rem; line-height: 1.25; color: var(--ivory); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.book-caption > span { color: var(--muted); font-size: .98rem; line-height: 1.3; }
.book-card:hover .book-caption strong { color: var(--gold-pale); }
mark { background: rgba(214, 178, 94, .3); color: var(--gold-pale); border-radius: 3px; padding: 0 2px; }
.saved-badge { position: absolute; top: 10px; right: 8px; z-index: 3; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: rgba(4, 5, 10, .8); color: #ff8f8f; border: 1px solid rgba(255, 143, 143, .4); }
.saved-badge svg { width: 15px; height: 15px; fill: currentColor; }

.book {
    --leather: #4c0f24;
    position: relative; aspect-ratio: 2 / 3; width: 100%;
    transform-style: preserve-3d; transform-origin: 0 50%;
    transition: transform .7s var(--ease), filter .5s;
    filter: drop-shadow(0 18px 18px rgba(0, 0, 0, .7));
}
.book-card:hover .book, .book-card:focus-visible .book { transform: rotateY(-22deg) translateX(6px) translateY(-6px); filter: drop-shadow(18px 26px 24px rgba(0, 0, 0, .8)) drop-shadow(0 0 22px rgba(214, 178, 94, .25)); }
.book-face {
    position: absolute; inset: 0; overflow: hidden; border-radius: 2px 7px 7px 2px;
    background:
        radial-gradient(circle at 25% 15%, rgba(255, 255, 255, .14), transparent 40%),
        radial-gradient(circle at 80% 90%, rgba(0, 0, 0, .45), transparent 50%),
        repeating-radial-gradient(circle at 30% 40%, rgba(0, 0, 0, .06) 0 1px, transparent 1px 3px),
        var(--leather);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .5), inset 6px 0 10px -4px rgba(0, 0, 0, .6);
    transform: translateZ(8px);
}
.book-face::before { content: ""; position: absolute; inset: 9px 9px 9px 15px; border: 1px solid rgba(214, 178, 94, .55); border-radius: 2px; box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .15), inset 0 0 0 4px rgba(214, 178, 94, .25); pointer-events: none; z-index: 1; }
.book-face::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; background: linear-gradient(90deg, rgba(0, 0, 0, .55) 0, rgba(255, 255, 255, .12) 4%, transparent 9%, transparent 88%, rgba(0, 0, 0, .2)); }
.book-label { position: absolute; inset: 22px 16px 22px 22px; min-width: 0; overflow: hidden; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; }
.book-orn { width: 28px; height: 28px; fill: url(#g-gold); opacity: .9; flex: none; }
.book-label-title { max-width: 100%; overflow-wrap: anywhere; font-family: var(--font-display); font-weight: 600; font-size: .72rem; line-height: 1.35; letter-spacing: .05em; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; text-shadow: none; }
.book-label-author { font-family: var(--font-fell); font-style: italic; font-size: .78rem; color: rgba(244, 223, 160, .8); line-height: 1.2; }
.book-label-year { font-family: var(--font-display); font-size: .62rem; letter-spacing: .2em; color: rgba(214, 178, 94, .7); }
.book-scan { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; object-fit: cover; object-position: top; opacity: 0; transition: opacity .8s; filter: sepia(.28) contrast(1.04) brightness(.95); }
.book.has-scan .book-scan { opacity: 1; }
.book.has-scan .book-face::before { inset: 0; border: 0; box-shadow: none; }
.book-spine { position: absolute; top: 0; bottom: 0; left: 0; width: 16px; transform-origin: 0 50%; transform: rotateY(90deg) translateZ(0) translateX(-8px); background: linear-gradient(90deg, rgba(0, 0, 0, .5), rgba(255, 255, 255, .08) 50%, rgba(0, 0, 0, .5)), var(--leather); }
.book-spine::before, .book-spine::after { content: ""; position: absolute; left: 0; right: 0; height: 2px; background: var(--gold-grad-h); }
.book-spine::before { top: 14%; }
.book-spine::after { bottom: 14%; }
.book-pages { position: absolute; top: 3px; bottom: 3px; right: 0; width: 14px; transform-origin: 100% 50%; transform: rotateY(90deg) translateZ(0) translateX(7px); background: repeating-linear-gradient(90deg, #efe6cf 0 1px, #cfc3a5 1px 2px); }

.book-lg { width: min(260px, 70vw); }
.book-lg .book-label-title { font-size: 1.05rem; -webkit-line-clamp: 8; }
.book-lg .book-label-author { font-size: 1rem; }
.book-lg .book-orn { width: 40px; height: 40px; }
.book-xs { width: 46px; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .6)); }
.book-xs .book-label, .book-xs .book-face::before { display: none; }

.book-card.is-skeleton { pointer-events: none; animation: none; }
.book-card.is-skeleton .book, .book-card.is-skeleton strong, .book-card.is-skeleton span { background: linear-gradient(90deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .09), rgba(255, 255, 255, .04)); background-size: 200% 100%; animation: shine 1.4s linear infinite; border-radius: 6px; filter: none; }
.book-card.is-skeleton strong { height: 16px; width: 90%; }
.book-card.is-skeleton span { height: 12px; width: 60%; }
@keyframes shine { to { background-position: -200% 0; } }

/* Results — the catalogue */
.results.list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: rgba(6, 9, 22, .7); }
.book-row { display: grid; grid-template-columns: 60px 1fr 80px 180px 56px; align-items: center; gap: 18px; padding: 12px 18px; border: 0; border-bottom: 1px solid rgba(214, 178, 94, .1); background: none; cursor: pointer; text-align: left; transition: background .2s; }
.book-row:last-child { border-bottom: 0; }
.book-row:hover { background: rgba(214, 178, 94, .06); }
.row-main { display: flex; flex-direction: column; min-width: 0; }
.row-main strong { font-weight: 600; font-size: 1.12rem; color: var(--ivory); line-height: 1.3; }
.row-main span { color: var(--muted); font-size: 1rem; }
.row-year { font-family: var(--font-display); font-size: .9rem; color: var(--gold-light); }
.row-col { font-size: .95rem; color: var(--muted); }
.row-go { display: flex; align-items: center; justify-content: flex-end; gap: 8px; color: var(--gold); }
.row-go svg { width: 18px; height: 18px; }
.row-go .is-saved { color: #ff8f8f; fill: currentColor; width: 15px; height: 15px; }

.lib-empty { text-align: center; padding: 70px 20px; }
.lib-empty svg { width: 70px; height: 70px; margin: 0 auto 16px; color: var(--gold); opacity: .6; }
.lib-empty h3 { color: var(--gold-pale); }
.lib-empty p { color: var(--muted); }
.lib-error { color: #f0a35a; text-align: center; padding: 60px 0; grid-column: 1 / -1; }
.lib-sentinel { height: 1px; }
.noscript-list { columns: 2; font-size: 1.05rem; }

/* Book dialog */
dialog { color: var(--ivory); }
dialog::backdrop { background: rgba(2, 3, 8, .78); backdrop-filter: blur(8px); }
.book-dialog { width: min(980px, calc(100vw - 32px)); max-height: calc(100vh - 40px); padding: 0; border: 1px solid var(--line-strong); border-radius: 24px; background: linear-gradient(180deg, #111a3a, #070a18); box-shadow: 0 60px 120px -30px #000, 0 0 100px -40px rgba(214, 178, 94, .4); overflow: hidden; }
.book-dialog[open] { animation: pop .5s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(20px) scale(.97); } }
.bd-inner { position: relative; display: grid; grid-template-columns: 340px 1fr; max-height: calc(100vh - 42px); overflow: auto; }
.bd-close { position: absolute; top: 16px; right: 16px; z-index: 5; }
.bd-cover { display: flex; justify-content: center; align-items: flex-start; padding: 56px 20px; background: radial-gradient(circle at 50% 40%, rgba(214, 178, 94, .18), transparent 65%), rgba(0, 0, 0, .25); border-right: 1px solid var(--line); perspective: 1000px; }
.bd-cover #bd-book { position: sticky; top: 56px; }
.bd-cover .book { animation: turn 1.2s var(--ease); }
@keyframes turn { from { transform: rotateY(-40deg); } }
.bd-body { padding: 46px 44px 40px; min-width: 0; }
.bd-body .eyebrow { margin-bottom: .6rem; }
.bd-body .eyebrow::before { display: none; }
.bd-body h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); color: var(--gold-pale); padding-right: 40px; }
.bd-author { font-family: var(--font-fell); font-style: italic; font-size: 1.3rem; color: var(--parchment); }
.bd-meta { display: flex; flex-wrap: wrap; gap: 1px; margin: 24px 0; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.bd-meta div { flex: 1 1 130px; padding: 12px 16px; background: rgba(6, 9, 22, .9); min-width: 0; }
.bd-meta div:last-child { flex-basis: 100%; }
.bd-meta dt { font-family: var(--font-display); font-size: .66rem; letter-spacing: .24em; text-transform: uppercase; color: var(--gold); }
.bd-meta dd { margin: 2px 0 0; color: var(--ivory); overflow-wrap: anywhere; font-size: 1.05rem; }
.bd-actions { display: flex; flex-wrap: wrap; gap: 10px; }
#bd-save.is-on svg { fill: currentColor; color: #ff8f8f; }
.bd-more h4 { margin: 34px 0 12px; font-size: .72rem; letter-spacing: .28em; text-transform: uppercase; color: var(--gold); }
.more-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.more-item { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 10px; border: 1px solid transparent; background: none; cursor: pointer; text-align: left; transition: .2s; }
.more-item:hover { border-color: var(--line); background: rgba(214, 178, 94, .06); }
.more-item .book { flex: none; width: 38px; }
.more-item strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 600; font-size: 1rem; line-height: 1.25; color: var(--ivory); }
.more-item small { display: block; color: var(--muted); font-size: .9rem; }

/* Reading room */
.reader { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #050608; display: none; flex-direction: column; }
.reader[open] { display: flex; animation: fadeIn .4s ease both; opacity: 0; }
.reader-bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: linear-gradient(180deg, #1c1408, #0d0904); border-bottom: 1px solid var(--line-strong); }
.reader-title { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: center; }
.reader-title strong { font-family: var(--font-display); font-weight: 600; font-size: 1rem; letter-spacing: .04em; color: var(--gold-pale); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-title span { font-family: var(--font-fell); font-style: italic; color: var(--muted); font-size: 1rem; }
.reader-actions { display: flex; align-items: center; gap: 8px; }
.reader-stage { position: relative; flex: 1; background: radial-gradient(circle at 50% 30%, #1d1a14, #050608); }
.reader-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.reader-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; color: var(--muted); font-family: var(--font-fell); font-style: italic; font-size: 1.2rem; pointer-events: none; }
.reader-loading[hidden] { display: none; }
.reader-loading svg { width: 80px; height: 80px; fill: url(#g-gold); animation: breathe 2s ease-in-out infinite; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 30px; z-index: 200; transform: translate(-50%, 20px); padding: 12px 24px; border-radius: 999px; background: rgba(10, 14, 30, .95); border: 1px solid var(--line-strong); color: var(--gold-pale); font-family: var(--font-display); font-size: .82rem; letter-spacing: .1em; opacity: 0; pointer-events: none; transition: .35s var(--ease); box-shadow: var(--shadow); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ==========================================================================
   The initiation — three knocks at the door of the Lodge
   ========================================================================== */
.initiation { position: fixed; inset: 0; z-index: 300; perspective: 1600px; background: radial-gradient(ellipse at 50% 50%, #fff3c4 0%, #e6bf62 12%, #6b4b16 34%, #04050a 64%); overflow: hidden; }
.door { position: absolute; top: 0; bottom: 0; width: 50.2%; transition: transform 2.2s cubic-bezier(.6, 0, .2, 1); backface-visibility: hidden; }
.door-left { left: 0; transform-origin: 0 50%; }
.door-right { right: 0; transform-origin: 100% 50%; }
.door-panel {
    position: absolute; inset: 0; display: grid; place-items: center;
    background:
        linear-gradient(90deg, rgba(0, 0, 0, .55), transparent 8%, transparent 92%, rgba(0, 0, 0, .55)),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, .015) 0 2px, transparent 2px 7px),
        linear-gradient(180deg, #1a1d33 0%, #0b0d1c 50%, #070812 100%);
    box-shadow: inset 0 0 0 14px #0a0b16, inset 0 0 0 16px rgba(214, 178, 94, .45), inset 0 0 0 40px #0b0d1c, inset 0 0 0 41px rgba(214, 178, 94, .25), inset 0 0 120px rgba(0, 0, 0, .9);
}
.door-right .door-panel { background: linear-gradient(270deg, rgba(0, 0, 0, .55), transparent 8%, transparent 92%, rgba(0, 0, 0, .55)), repeating-linear-gradient(90deg, rgba(255, 255, 255, .015) 0 2px, transparent 2px 7px), linear-gradient(180deg, #1a1d33 0%, #0b0d1c 50%, #070812 100%); }
.door-left .door-panel::after, .door-right .door-panel::after { content: ""; position: absolute; top: 72%; width: 14px; height: 70px; border-radius: 8px; background: var(--gold-grad); box-shadow: 0 0 20px rgba(214, 178, 94, .5); }
.door-left .door-panel::after { right: 30px; }
.door-right .door-panel::after { left: 30px; }
.door-emblem { width: min(30vw, 220px); height: min(30vw, 220px); fill: url(#g-gold); opacity: .3; filter: drop-shadow(0 0 30px rgba(214, 178, 94, .4)); }
.initiation-copy { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; transition: opacity .6s; }
.initiation-ask { font-family: var(--font-display); font-size: clamp(1.6rem, 4vw, 2.8rem); letter-spacing: .12em; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; margin: 0 0 8px; animation: fadeUp 1.4s var(--ease) both; }
.initiation-answer { font-family: var(--font-fell); font-style: italic; font-size: clamp(1.2rem, 2.4vw, 1.6rem); color: var(--parchment); margin: 0 0 40px; animation: fadeUp 1.4s var(--ease) .6s both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } }
.knock { position: relative; width: 132px; height: 132px; border-radius: 50%; border: 1px solid var(--line-strong); background: radial-gradient(circle, rgba(214, 178, 94, .18), rgba(4, 5, 10, .8) 70%); cursor: pointer; display: grid; place-items: center; animation: fadeUp 1.4s var(--ease) 1.1s both; transition: transform .15s; }
.knock:active { transform: scale(.95); }
.knock-ring { position: absolute; inset: -10px; border-radius: 50%; border: 1px solid rgba(214, 178, 94, .3); animation: ring 2.4s ease-out infinite; }
@keyframes ring { from { transform: scale(.9); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
.knock-label { font-family: var(--font-display); font-size: .9rem; letter-spacing: .4em; text-transform: uppercase; color: var(--gold-pale); padding-left: .4em; }
.knock-count { position: absolute; bottom: 26px; display: flex; gap: 8px; }
.knock-count i { width: 7px; height: 7px; transform: rotate(45deg); border: 1px solid var(--gold); transition: .3s; }
.knock-count i.is-on { background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.initiation-skip { margin-top: 34px; border: 0; background: none; cursor: pointer; color: var(--muted); font-family: var(--font-display); font-size: .7rem; letter-spacing: .24em; text-transform: uppercase; animation: fadeUp 1.4s var(--ease) 1.6s both; }
.initiation-skip:hover { color: var(--gold-light); }
.initiation.is-knock .door { animation: shake .35s ease; }
@keyframes shake { 30% { transform: translateX(-3px); } 60% { transform: translateX(3px); } }
.initiation.is-opening .initiation-copy { opacity: 0; }
.initiation.is-opening .door-left { transform: rotateY(-105deg); }
.initiation.is-opening .door-right { transform: rotateY(105deg); }
.initiation.is-opening { animation: gateFade 2.6s ease forwards; }
@keyframes gateFade { 0%, 60% { opacity: 1; } 100% { opacity: 0; } }
body.is-entering .hero-content { animation: enter 2.6s var(--ease) both; }
@keyframes enter { from { transform: scale(1.12); filter: brightness(2) blur(3px); } }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1180px) {
    .hero-pillar { width: clamp(70px, 8vw, 110px); }
    .library { grid-template-columns: 240px 1fr; gap: 26px; }
}

@media (max-width: 960px) {
    :root { --header-h: 66px; }
    .nav-toggle { display: grid; }
    .site-nav {
        /* The header's backdrop-filter makes it the containing block, so size against the header. */
        position: absolute; top: 100%; left: 0; right: 0; height: calc(100vh - var(--header-h)); height: calc(100dvh - var(--header-h));
        z-index: 49; display: block; padding: 20px 20px 40px; overflow: auto;
        background: rgba(4, 6, 14, .98); backdrop-filter: blur(16px);
        opacity: 0; visibility: hidden; transform: translateY(-10px); transition: .3s var(--ease);
    }
    .site-nav.is-open { opacity: 1; visibility: visible; transform: none; }
    .nav-list { flex-direction: column; align-items: stretch; gap: 8px; }
    .nav-trigger { width: 100%; justify-content: space-between; height: 54px; font-size: .9rem; border-bottom: 1px solid var(--line); border-radius: 0; }
    .nav-group.is-active .nav-trigger::after { display: none; }
    .nav-menu { position: static; transform: none; min-width: 0; opacity: 1; visibility: visible; display: none; margin-top: 6px; box-shadow: none; background: transparent; border: 0; padding: 0 0 10px; }
    .nav-menu::before { display: none; }
    .nav-group.is-open .nav-menu { display: block; transform: none; }
    .nav-cta { margin: 20px 0 0; }
    .nav-cta .btn { width: 100%; --h: 52px; }

    .hero-pillar { opacity: .35; bottom: 16vh; }
    .degree-cards, .lights-grid, .tool-grid, .about-grid { grid-template-columns: 1fr; max-width: 560px; margin-inline: auto; }
    .lights-grid { gap: 60px; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .threshold-grid, .origins-grid, .degree-intro { grid-template-columns: 1fr; }
    .symbol-card { position: static; }
    .footer-cols { grid-template-columns: repeat(2, 1fr); }

    .library { grid-template-columns: minmax(0, 1fr); }
    .lib-filters-toggle { display: inline-flex; }
    .lib-sidebar {
        position: fixed; inset: auto 0 0 0; top: auto; z-index: 60; max-height: 78vh; border-radius: 22px 22px 0 0;
        background: rgba(6, 9, 22, .98); transform: translateY(105%); transition: transform .4s var(--ease); box-shadow: 0 -30px 60px rgba(0, 0, 0, .8);
    }
    .lib-sidebar.is-open { transform: none; }
    .bd-inner { grid-template-columns: 1fr; }
    .bd-cover { border-right: 0; border-bottom: 1px solid var(--line); padding: 40px 20px 30px; }
    .bd-cover .book-lg { width: min(200px, 50vw); }
    .bd-body { padding: 30px 24px; }
    .book-row { grid-template-columns: 50px 1fr 60px 30px; }
    .row-col { display: none; }
}

@media (max-width: 640px) {
    body { font-size: 1.12rem; }
    .header-inner { padding: 0 16px; }
    .brand-mark { width: 38px; height: 38px; }
    .brand-name { font-size: 1.1rem; }
    .section { padding-inline: 16px; }
    .container { padding: 0 16px; }
    .hero { padding-inline: 16px; }
    .hero-pillar { display: none; }
    .hero-actions .btn { width: 100%; }
    .eyebrow { letter-spacing: .22em; font-size: .72rem; }
    .eyebrow::before, .eyebrow::after { width: 1.4em; }
    .stats { margin-bottom: 36px; }
    .search-hero { padding-left: 16px; }
    .search-hero .btn { padding: 0 1em; }
    .search-hero input { font-size: 1.1rem; }
    .kbd { display: none; }
    .shelf { gap: 10px; padding: 0 10px; justify-content: flex-start; }
    .footer-cols { grid-template-columns: 1fr; text-align: center; }
    .seal { right: 14px; bottom: 14px; }
    .seal-wax { width: 56px; height: 56px; }
    .seal-wax svg { width: 30px; height: 30px; }
    .library { padding: 0 16px 60px; }
    .results.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 18px; }
    .lib-controls { width: 100%; justify-content: space-between; }
    .lib-count { width: 100%; order: -1; }
    .plaque { flex-direction: column; padding: 24px; }
    .pager { grid-template-columns: 1fr; }
    .pager-next { text-align: left; }
    .steps .step-name { font-size: .62rem; letter-spacing: .06em; }
    .lectern-page iframe { height: 70vh; }
    .reader-actions .btn span { display: none; }
    .reader-actions .btn { padding: 0; width: 40px; }
    .contact-card { padding: 60px 20px 40px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
    .reveal { opacity: 1; transform: none; }
    .emblem-line { stroke-dashoffset: 0; }
    .emblem-fill { opacity: 1; }
}

/* Above-the-fold hero copy animates on load rather than waiting for the scroll observer. */
.hero-content .reveal, .page-hero .reveal { opacity: 1; transform: none; animation: fadeUp 1.2s var(--ease) both; }
.hero-content .reveal:nth-child(2), .page-hero .reveal:nth-of-type(1) { animation-delay: .9s; }
.hero-content .reveal:nth-child(3), .page-hero .reveal:nth-of-type(2) { animation-delay: 1.1s; }
.hero-content .reveal:nth-child(4), .page-hero .reveal:nth-of-type(3) { animation-delay: 1.3s; }
.hero-content .reveal:nth-child(5), .page-hero .reveal:nth-of-type(4) { animation-delay: 1.5s; }
.hero-content .reveal:nth-child(6) { animation-delay: 1.7s; }
.page-hero .reveal { animation-duration: 1s; }
.page-hero .reveal:nth-of-type(1) { animation-delay: .1s; }
.page-hero .reveal:nth-of-type(2) { animation-delay: .25s; }
.page-hero .reveal:nth-of-type(3) { animation-delay: .4s; }
.page-hero .reveal:nth-of-type(4) { animation-delay: .55s; }

/* ==========================================================================
   Language menu (after Lumazel) and the translation veil
   ========================================================================== */
.lang-dd { position: relative; flex: none; }
.lang-dd__btn {
    display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 12px 0 14px; border-radius: 999px; cursor: pointer;
    border: 1px solid var(--gold); background: rgba(4, 5, 10, .6); color: var(--gold-light);
    box-shadow: 0 0 0 3px rgba(214, 178, 94, .12), 0 0 18px -6px rgba(214, 178, 94, .6); transition: .25s;
}
.lang-dd__btn:hover, .lang-dd__btn[aria-expanded="true"] { background: rgba(214, 178, 94, .14); box-shadow: 0 0 0 3px rgba(214, 178, 94, .25), 0 0 24px -4px rgba(214, 178, 94, .8); }
.lang-dd__flag { font-size: 1.35rem; line-height: 1; }
.lang-dd__caret { width: 13px; height: 13px; transform: rotate(90deg); opacity: .8; transition: transform .25s; }
.lang-dd__btn[aria-expanded="true"] .lang-dd__caret { transform: rotate(-90deg); }
.lang-dd__menu {
    position: absolute; top: calc(100% + 10px); right: 0; z-index: 60; width: 290px; max-height: min(70vh, 640px); overflow-y: auto; padding: 8px;
    border-radius: 16px; border: 1px solid var(--line-strong); background: linear-gradient(180deg, rgba(14, 22, 48, .98), rgba(6, 9, 22, .98));
    box-shadow: var(--shadow), 0 0 0 1px rgba(0, 0, 0, .5); scrollbar-width: thin; scrollbar-color: var(--gold-deep) transparent;
    opacity: 0; visibility: hidden; transform: translateY(-8px); transition: .22s var(--ease);
}
.lang-dd__menu.is-open { opacity: 1; visibility: visible; transform: none; }
.lang-dd__opt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border: 0; border-radius: 10px; background: none; cursor: pointer; text-align: start; color: var(--ivory); font-size: 1.08rem; transition: background .15s; }
.lang-dd__opt:hover { background: rgba(214, 178, 94, .1); }
.lang-dd__opt.is-cur { background: linear-gradient(90deg, rgba(35, 64, 138, .85), rgba(35, 64, 138, .45)); font-weight: 600; color: #fff; }
.lang-dd__f { font-size: 1.25rem; line-height: 1; width: 1.6rem; text-align: center; flex: none; }
.lang-dd__label { flex: 1; min-width: 0; }
.lang-dd__native { font-size: .9rem; color: var(--muted); white-space: nowrap; }
.lang-dd__opt.is-cur .lang-dd__native { color: var(--gold-light); }
body.is-switching .site-main { opacity: .35; transition: opacity .3s; }

.tr-veil { position: fixed; inset: 0; z-index: 250; display: grid; place-items: center; background: rgba(4, 5, 10, .55); backdrop-filter: blur(6px); opacity: 0; visibility: hidden; transition: opacity .5s, visibility .5s; pointer-events: none; }
.tr-veil svg { width: 84px; height: 84px; fill: url(#g-gold); animation: breathe 1.6s ease-in-out infinite; }
html.is-translating .tr-veil { opacity: 1; visibility: visible; }

/* Right-to-left languages */
[dir="rtl"] .brand { margin-right: 0; margin-left: auto; }
[dir="rtl"] .nav-cta { margin-left: 0; margin-right: 10px; }
[dir="rtl"] .lang-dd__menu { right: auto; left: 0; }
[dir="rtl"] .seal { right: auto; left: 22px; flex-direction: row; }
[dir="rtl"] .seal-label { margin-right: 0; margin-left: -12px; border-radius: 0 999px 999px 0; }
[dir="rtl"] .quote { border-left: 0; border-right: 2px solid var(--gold); padding: 22px 28px 0 0; }
[dir="rtl"] .dropcap::first-letter { float: right; padding: 6px 0 0 12px; }
[dir="rtl"] .pager-next { text-align: left; }
[dir="rtl"] .btn svg, [dir="rtl"] .degree-go svg, [dir="rtl"] .row-go svg { transform: scaleX(-1); }
[dir="rtl"] .bd-cover { border-right: 0; border-left: 1px solid var(--line); }
[dir="rtl"] .bd-close { right: auto; left: 16px; }

@media (max-width: 960px) {
    .lang-dd__btn { height: 46px; padding: 0 10px 0 12px; }
    .lang-dd__menu { position: fixed; top: calc(var(--header-h) + 6px); right: 12px; left: 12px; width: auto; }
    [dir="rtl"] .lang-dd__menu { left: 12px; }
}
@media (max-width: 640px) {
    .header-inner { gap: 10px; }
    .brand-motto { display: none; }
}
.brand { order: 1; }
.site-nav { order: 2; }
.lang-dd { order: 3; }
.nav-toggle { order: 4; }
.nav-trigger, .nav-cta .btn { white-space: nowrap; }
@media (min-width: 961px) and (max-width: 1180px) { .nav-trigger { padding: 0 10px; letter-spacing: .12em; } .header-inner { gap: 12px; } }
@media (min-width: 1181px) and (max-width: 1320px) { .header-inner { gap: 16px; } }

/* The same folded menu as on a phone, for wide screens whose menu does not fit (long translations; site.js sets .nav-compact). */
.nav-compact { --header-h: 66px; }
.nav-compact .nav-toggle { display: grid; }
.nav-compact .site-nav {
    position: absolute; top: 100%; left: 0; right: 0; height: calc(100vh - var(--header-h)); height: calc(100dvh - var(--header-h));
    z-index: 49; display: block; padding: 20px max(20px, calc((100% - 720px) / 2)) 40px; overflow: auto;
    background: rgba(4, 6, 14, .98); backdrop-filter: blur(16px);
    opacity: 0; visibility: hidden; transform: translateY(-10px); transition: .3s var(--ease);
}
.nav-compact .site-nav.is-open { opacity: 1; visibility: visible; transform: none; }
.nav-compact .nav-list { flex-direction: column; align-items: stretch; gap: 8px; }
.nav-compact .nav-trigger { width: 100%; justify-content: space-between; height: 54px; font-size: .9rem; border-bottom: 1px solid var(--line); border-radius: 0; }
.nav-compact .nav-group.is-active .nav-trigger::after { display: none; }
.nav-compact .nav-menu { position: static; transform: none; min-width: 0; opacity: 1; visibility: visible; display: none; margin-top: 6px; box-shadow: none; background: transparent; border: 0; padding: 0 0 10px; }
.nav-compact .nav-menu::before { display: none; }
.nav-compact .nav-group.is-open .nav-menu { display: block; transform: none; }
.nav-compact .nav-cta { margin: 20px 0 0; }
.nav-compact .nav-cta .btn { width: 100%; --h: 52px; }
.nav-compact .nav-user { max-width: none; }

/* At the gate the language can already be chosen: the header sits above the doors with only the flag visible. */
body.is-gated .site-header { z-index: 310; background: none !important; box-shadow: none !important; backdrop-filter: none !important; }
body.is-gated .site-header .brand,
body.is-gated .site-header .site-nav,
body.is-gated .site-header .nav-toggle { visibility: hidden; }
body.is-gated .seal { visibility: hidden; }

/* Translations can bring long compound words (vrijmetselaarsdenken, Freimaurerei…): let headings hyphenate per language. */
h1, h2, h3, h4, .display, .display-xl, .hero-sub, .stat-label, .degree-card p, .initiation-ask { overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.hero-title { font-size: clamp(1.9rem, 7vw, 7.2rem); }
@media (max-width: 640px) { .hero-title { letter-spacing: .05em; } }

/* ==========================================================================
   The degree handbook — an illuminated manuscript in the site's own letters
   ========================================================================== */
.handbook { margin: 20px 0 80px; scroll-margin-top: calc(var(--header-h) + 20px); }
.hb-head { text-align: center; max-width: 820px; margin: 0 auto 50px; padding: 50px 30px 40px; border-radius: 24px; border: 1px solid var(--line); background: radial-gradient(ellipse at 50% 0%, rgba(214, 178, 94, .14), transparent 65%), rgba(8, 12, 28, .6); }
.hb-head .display { font-size: clamp(2rem, 4.4vw, 3.2rem); max-width: none; }
.hb-subtitle { font-family: var(--font-fell); font-style: italic; font-size: clamp(1.2rem, 2.2vw, 1.55rem); color: var(--parchment); margin: 4px 0 18px; }
.hb-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 14px; color: var(--muted); font-size: 1.05rem; margin-bottom: 26px; }
.hb-meta strong { font-family: var(--font-display); color: var(--gold-light); font-weight: 600; }
.hb-meta .dot { color: var(--gold-deep); font-size: .6rem; align-self: center; }
.hb-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.hb-pending { display: flex; align-items: center; gap: 14px; max-width: 620px; margin: 26px auto 0; padding: 14px 20px; border-radius: 14px; border: 1px solid var(--line-strong); background: rgba(35, 64, 138, .25); color: var(--parchment); text-align: start; font-size: 1.05rem; }
.hb-pending svg { width: 34px; height: 34px; flex: none; fill: url(#g-gold); animation: breathe 2s ease-in-out infinite; }

.hb-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: clamp(30px, 4vw, 60px); align-items: start; }
.hb-toc { position: sticky; top: calc(var(--header-h) + 24px); }
.hb-toc-toggle { display: none; }
.hb-toc-panel { max-height: calc(100vh - var(--header-h) - 60px); overflow-y: auto; padding: 22px 14px 22px 18px; border-radius: 18px; border: 1px solid var(--line); background: rgba(6, 9, 22, .78); backdrop-filter: blur(10px); scrollbar-width: thin; scrollbar-color: var(--gold-deep) transparent; }
.hb-toc-title { font-family: var(--font-display); font-size: .72rem; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); margin: 0 0 12px 8px; }
.hb-toc ol { list-style: none; margin: 0; padding: 0; }
.hb-toc a { display: flex; gap: 12px; align-items: baseline; padding: 7px 10px; border-radius: 9px; color: var(--parchment); font-size: 1.04rem; line-height: 1.3; border-inline-start: 2px solid transparent; transition: background .2s, color .2s, border-color .2s; }
.hb-toc a:hover { background: rgba(214, 178, 94, .08); color: var(--gold-pale); }
.hb-toc a.is-current { background: rgba(214, 178, 94, .12); color: var(--gold-pale); border-inline-start-color: var(--gold); }
.hb-toc-num { flex: none; min-width: 2.4em; font-family: var(--font-display); font-size: .78rem; color: var(--gold); text-align: end; }

.hb-body { max-width: 760px; }
.hb-chapter { scroll-margin-top: calc(var(--header-h) + 24px); padding-bottom: 50px; margin-bottom: 50px; border-bottom: 1px solid rgba(214, 178, 94, .14); }
.hb-chapter:last-child { border-bottom: 0; margin-bottom: 0; }
.hb-ch-head { text-align: center; margin-bottom: 30px; }
.hb-ch-num { display: block; font-family: var(--font-display); font-size: .86rem; letter-spacing: .4em; color: var(--gold); margin-bottom: 8px; }
.hb-ch-head h3 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 600; margin: 0 auto 14px; max-width: 24ch; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hb-ch-orn { width: 34px; height: 34px; margin: 0 auto; fill: url(#g-gold); opacity: .7; }
.hb-text { font-size: 1.3rem; line-height: 1.78; color: var(--parchment); }
.hb-text p { margin: 0 0 1.1em; }
.hb-text > p:first-child::first-letter { float: inline-start; font-family: var(--font-display); font-weight: 700; font-size: 3.6em; line-height: .85; padding: 6px 10px 0 0; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
[dir="rtl"] .hb-text > p:first-child::first-letter { padding: 6px 0 0 10px; }
.hb-text h3 { font-family: var(--font-display); font-size: 1.15rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-light); margin: 1.8em 0 .7em; }
.hb-text em { color: var(--gold-pale); }
.hb-text strong { color: var(--ivory); font-weight: 600; }
.hb-text blockquote { margin: 1.6em 0; padding: 18px 26px; border-inline-start: 2px solid var(--gold); background: rgba(214, 178, 94, .06); border-radius: 0 12px 12px 0; font-family: var(--font-fell); font-style: italic; font-size: 1.32rem; color: var(--gold-pale); }
[dir="rtl"] .hb-text blockquote { border-radius: 12px 0 0 12px; }
.hb-text blockquote p:last-child { margin: 0; }
.hb-text ul, .hb-text ol { margin: 0 0 1.2em; padding-inline-start: 1.4em; }
.hb-text li { margin: .35em 0; }
.hb-text li::marker { color: var(--gold); }
.hb-colophon { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 40px; padding-top: 30px; border-top: 1px solid var(--line); color: var(--muted); font-size: 1rem; text-align: center; }
.hb-colophon svg { width: 26px; height: 26px; flex: none; fill: url(#g-gold); opacity: .7; }
.hb-colophon p { margin: 0; }

.hb-progress { position: fixed; left: 0; right: 0; top: var(--header-h); z-index: 45; height: 3px; pointer-events: none; opacity: 0; transition: opacity .3s; }
.hb-progress span { display: block; height: 100%; background: var(--gold-grad-h); transform-origin: 0 50%; transform: scaleX(0); box-shadow: 0 0 10px rgba(214, 178, 94, .7); }
[dir="rtl"] .hb-progress span { transform-origin: 100% 50%; }
body.is-reading .hb-progress { opacity: 1; }

@media (max-width: 960px) {
    .hb-layout { grid-template-columns: minmax(0, 1fr); }
    .hb-toc { position: static; }
    .hb-toc-toggle {
        position: fixed; bottom: 22px; left: 22px; z-index: 41; display: inline-flex; align-items: center; gap: 8px; height: 50px; padding: 0 18px; border-radius: 999px;
        border: 1px solid var(--gold); background: rgba(6, 9, 22, .92); color: var(--gold-light); font-family: var(--font-display); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; box-shadow: var(--shadow); cursor: pointer;
        opacity: 0; visibility: hidden; transition: opacity .3s;
    }
    [dir="rtl"] .hb-toc-toggle { left: auto; right: 22px; }
    body.is-reading .hb-toc-toggle { opacity: 1; visibility: visible; }
    .hb-toc-toggle svg { width: 18px; height: 18px; }
    .hb-toc-panel { position: fixed; left: 12px; right: 12px; bottom: 84px; z-index: 42; max-height: 65vh; background: rgba(6, 9, 22, .98); box-shadow: var(--shadow); transform: translateY(20px); opacity: 0; visibility: hidden; transition: .3s var(--ease); }
    .hb-toc.is-open .hb-toc-panel { transform: none; opacity: 1; visibility: visible; }
    .hb-text { font-size: 1.2rem; }
}
@media (max-width: 640px) {
    .hb-head { padding: 36px 18px 30px; }
    .hb-actions .btn { width: 100%; }
}

/* Print: just the handbook, in black on white. */
@media print {
    body { background: #fff !important; color: #000; font-size: 11.5pt; }
    .sky, .vignette, .site-header, .site-footer, .seal, .toast, .tr-veil, .page-hero, .degree-intro, .tools, .plaque, .pager, .hb-toc, .hb-actions, .hb-pending, .hb-progress, .hb-ch-orn { display: none !important; }
    .reveal { opacity: 1 !important; transform: none !important; }
    .container { max-width: none; padding: 0; }
    .hb-head { border: 0; background: none; padding: 0 0 20pt; page-break-after: always; }
    .hb-layout { display: block; }
    .hb-body { max-width: none; }
    .display, .hb-ch-head h3, .hb-text > p:first-child::first-letter { background: none !important; color: #000 !important; -webkit-text-fill-color: #000; filter: none; }
    .hb-subtitle, .hb-text, .hb-text blockquote, .hb-meta, .hb-ch-num, .hb-text h3, .hb-text em, .hb-colophon { color: #000 !important; }
    .hb-text blockquote { background: none; border-color: #999; }
    .hb-chapter { page-break-before: always; border: 0; }
    .hb-chapter:first-child { page-break-before: auto; }
}

/* Working tools: English name with a dotted underline, opening an explanation */
.tool-term { padding: 0; border: 0; background: none; cursor: pointer; font: inherit; letter-spacing: inherit; color: var(--gold-pale); text-decoration: underline dotted rgba(214, 178, 94, .8); text-decoration-thickness: 2px; text-underline-offset: 6px; transition: color .2s, text-decoration-color .2s; }
.tool-term:hover, .tool-term:focus-visible { color: #fff; text-decoration-style: solid; text-decoration-color: var(--gold); }
.tools-hint { margin: 22px 0 0; text-align: center; font-style: italic; color: var(--muted); font-size: 1.02rem; }
.tool-dialog { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 40px); padding: 46px 40px 36px; border: 1px solid var(--line-strong); border-radius: 22px; background: radial-gradient(ellipse at 50% 0%, rgba(214, 178, 94, .16), transparent 60%), linear-gradient(180deg, #111a3a, #070a18); box-shadow: 0 60px 120px -30px #000, 0 0 90px -40px rgba(214, 178, 94, .45); overflow: auto; text-align: center; }
.tool-dialog[open] { animation: pop .45s var(--ease); }
.tool-dialog-close { position: absolute; top: 14px; right: 14px; }
[dir="rtl"] .tool-dialog-close { right: auto; left: 14px; }
.tool-dialog-icon { width: 70px; height: 70px; margin: 0 auto 14px; color: var(--gold); filter: drop-shadow(0 0 16px rgba(214, 178, 94, .45)); }
.tool-dialog h3 { font-size: clamp(1.5rem, 3.4vw, 2rem); margin-bottom: 4px; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tool-dialog-body { text-align: start; }
.tool-dialog-body .tool-explain-kicker { text-align: center; font-family: var(--font-display); font-size: .72rem; letter-spacing: .28em; text-transform: uppercase; color: var(--gold); margin-bottom: 22px; }
.tool-dialog-body h4 { font-family: var(--font-display); font-size: .82rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-light); margin: 20px 0 6px; }
.tool-dialog-body p { font-size: 1.2rem; line-height: 1.7; color: var(--parchment); margin: 0; }
@media (max-width: 640px) { .tool-dialog { padding: 44px 22px 28px; } }

/* ==========================================================================
   Masonic terms: English, dotted, clickable; explanation in the visitor's language
   ========================================================================== */
.mterm {
    display: inline; padding: 0; margin: 0; border: 0; background: none; cursor: help; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit;
    text-decoration: underline dotted rgba(214, 178, 94, .85); text-decoration-thickness: 1.5px; text-underline-offset: .22em; transition: color .2s, text-decoration-color .2s;
}
.mterm:hover, .mterm:focus-visible { color: var(--gold-pale); text-decoration-style: solid; text-decoration-color: var(--gold); }
.hb-text .mterm, .prose .mterm, .term-body .mterm { color: var(--gold-light); }
.tool h3 .mterm { color: var(--gold-pale); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.display .mterm, .hb-ch-head h3 .mterm { color: inherit; -webkit-text-fill-color: currentColor; }
.hb-ch-head h3 .mterm, .hb-head .display .mterm { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }

.term-dialog { width: min(600px, calc(100vw - 32px)); max-height: calc(100vh - 40px); padding: 18px 36px 30px; border: 1px solid var(--line-strong); border-radius: 22px; background: radial-gradient(ellipse at 50% 0%, rgba(214, 178, 94, .16), transparent 60%), linear-gradient(180deg, #111a3a, #070a18); box-shadow: 0 60px 120px -30px #000, 0 0 90px -40px rgba(214, 178, 94, .45); overflow: auto; text-align: center; }
.term-dialog[open] { animation: pop .4s var(--ease); }
.term-head { display: flex; justify-content: space-between; margin: 0 -18px 0; }
.term-head .term-close { margin-left: auto; }
.term-emblem { width: 46px; height: 46px; margin: -6px auto 10px; fill: url(#g-gold); opacity: .85; }
.term-group { font-family: var(--font-display); font-size: .7rem; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); margin: 0 0 6px; }
.term-title { font-size: clamp(1.5rem, 3.4vw, 2.1rem); margin: 0 0 18px; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.term-body { text-align: start; transition: opacity .3s; }
.term-body p { font-size: 1.2rem; line-height: 1.7; color: var(--parchment); margin: 0 0 .9em; }
.term-dialog.is-loading .term-body { opacity: .45; }
.term-note { margin: 14px 0 0; font-size: .92rem; font-style: italic; color: var(--muted); }
@media (max-width: 640px) { .term-dialog { padding: 14px 20px 24px; } }
.term-back[hidden], .icon-btn[hidden] { display: none; }

/* The hero title is one word on one line in every language (scaled down by site.js when needed). */
.hero-title { hyphens: manual !important; -webkit-hyphens: manual !important; overflow-wrap: normal !important; white-space: nowrap; width: 100%; }
.hero-content { width: 100%; }
.eyebrow .sep { color: var(--gold); opacity: .8; }

/* ==========================================================================
   The Masonic Course
   ========================================================================== */
.footer-cols { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 960px) { .footer-cols { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .footer-cols { grid-template-columns: 1fr; } }
@media (min-width: 961px) and (max-width: 1240px) { .nav-trigger { padding: 0 9px; letter-spacing: .1em; font-size: .76rem; } .brand-motto { display: none; } }

.course-progress { height: 6px; border-radius: 999px; background: rgba(214, 178, 94, .14); overflow: hidden; }
.course-progress span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--gold-grad-h); transition: width .8s var(--ease); }

.course-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin: 10px 0 60px; }
.course-step { padding: 26px 22px; border-radius: 18px; border: 1px solid var(--line); background: rgba(8, 12, 28, .6); }
.course-step span { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 12px; border-radius: 50%; border: 1px solid var(--gold); font-family: var(--font-display); color: var(--gold); }
.course-step h3 { font-size: 1.1rem; color: var(--gold-pale); }
.course-step p { margin: 0; color: var(--parchment); font-size: 1.08rem; }

.course-modules { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; margin-bottom: 70px; }
.course-card { position: relative; overflow: hidden; display: flex; flex-direction: column; padding: 34px 28px 26px; border-radius: 22px; background: linear-gradient(180deg, rgba(22, 34, 74, .75), rgba(6, 9, 22, .92)) padding-box, linear-gradient(160deg, rgba(244, 223, 160, .6), rgba(214, 178, 94, .1) 40%, rgba(214, 178, 94, .45)) border-box; border: 1px solid transparent; box-shadow: var(--shadow); }
.course-card.is-passed { background: linear-gradient(180deg, rgba(40, 54, 30, .6), rgba(6, 9, 22, .92)) padding-box, linear-gradient(160deg, rgba(244, 223, 160, .9), rgba(214, 178, 94, .3)) border-box; }
.course-card-numeral { position: absolute; top: -12px; right: 16px; font-family: var(--font-display); font-weight: 700; font-size: 6rem; line-height: 1; color: rgba(214, 178, 94, .07); }
.course-card-icon { width: 56px; height: 56px; color: var(--gold); fill: var(--gold); margin-bottom: 14px; }
.course-card-kicker { font-family: var(--font-display); font-size: .72rem; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); margin: 0 0 4px; }
.course-card h3 { font-size: 1.45rem; color: var(--gold-pale); }
.course-card-summary { color: var(--parchment); font-size: 1.1rem; flex: 1; }
.course-card-status { margin: 10px 0 16px; font-size: 1rem; color: var(--muted); }
.course-card.is-passed .course-card-status { color: #b9e2a0; }
.course-card-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.diploma-panel { position: relative; margin: 30px auto 40px; max-width: 860px; padding: 70px 40px 46px; text-align: center; border-radius: 26px; background: radial-gradient(ellipse at 50% 0%, rgba(214, 178, 94, .18), transparent 60%), linear-gradient(180deg, rgba(22, 34, 74, .8), rgba(6, 9, 22, .94)) padding-box, linear-gradient(170deg, rgba(244, 223, 160, .7), rgba(214, 178, 94, .1)) border-box; border: 1px solid transparent; box-shadow: var(--shadow); }
.diploma-count { font-family: var(--font-display); letter-spacing: .14em; color: var(--gold-light); }
.diploma-form, .verify-form { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: center; gap: 14px; margin-top: 20px; }
.diploma-form label, .verify-form label, .exam-name { display: flex; flex-direction: column; gap: 6px; text-align: start; flex: 1 1 280px; max-width: 420px; }
.diploma-form label span, .verify-form label span, .exam-name span { font-family: var(--font-display); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.diploma-form input, .verify-form input, .exam-name input { height: 50px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line-strong); background: rgba(4, 5, 10, .7); color: var(--ivory); font: inherit; font-size: 1.15rem; }
.diploma-form input:focus, .verify-form input:focus, .exam-name input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(214, 178, 94, .15); }
.form-message { flex-basis: 100%; margin: 6px 0 0; color: #f0a35a; min-height: 1.2em; }
.course-note { text-align: center; color: var(--muted); font-style: italic; margin-bottom: 40px; }
.course-module-progress { max-width: 420px; margin: 26px auto 0; }
.course-module-progress p { margin: 8px 0 0; color: var(--muted); }

.hb-toc a.is-done .hb-toc-num::before { content: "✓ "; color: #b9e2a0; }

/* Practice questions after each lesson */
.practice { margin-top: 40px; padding: 28px 28px 22px; border-radius: 18px; border: 1px solid var(--line-strong); background: linear-gradient(180deg, rgba(35, 64, 138, .22), rgba(8, 12, 28, .7)); }
.practice.is-done { border-color: rgba(185, 226, 160, .45); }
.practice-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.practice-head > svg { width: 40px; height: 40px; flex: none; color: var(--gold); }
.practice-head h4 { font-size: 1.05rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-light); margin: 2px 0 4px; }
.practice-head p { margin: 0; color: var(--muted); font-size: 1.02rem; }
.practice-badge { margin-inline-start: auto; flex: none; padding: 4px 12px; border-radius: 999px; background: rgba(185, 226, 160, .14); color: #b9e2a0; font-family: var(--font-display); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; }
.practice-list { margin: 0; padding-inline-start: 1.3em; }
.practice-q { margin-bottom: 22px; color: var(--gold); }
.practice-question, .exam-question { color: var(--ivory); font-size: 1.18rem; font-weight: 500; margin: 0 0 10px; }
.practice-options { display: grid; gap: 8px; }
.practice-option { text-align: start; padding: 11px 16px; border-radius: 12px; border: 1px solid var(--line); background: rgba(4, 5, 10, .5); color: var(--parchment); font: inherit; font-size: 1.08rem; cursor: pointer; transition: border-color .2s, background .2s; }
.practice-option:hover:not(:disabled) { border-color: var(--gold); background: rgba(214, 178, 94, .08); }
.practice-option:disabled { cursor: default; opacity: .7; }
.practice-option.is-right { opacity: 1; border-color: #8fcf6d; background: rgba(143, 207, 109, .14); color: #e5f6da; }
.practice-option.is-wrong { opacity: 1; border-color: #e07a6a; background: rgba(224, 122, 106, .12); }
.practice-feedback { margin: 10px 0 0; padding: 10px 14px; border-radius: 10px; background: rgba(224, 122, 106, .08); color: var(--parchment); font-size: 1.05rem; }
.practice-feedback.is-right { background: rgba(143, 207, 109, .1); }
.practice-verdict { color: #f0a35a; }
.practice-feedback.is-right .practice-verdict { color: #b9e2a0; }
.practice-summary { margin: 4px 0 0; font-family: var(--font-fell); font-style: italic; color: var(--gold-pale); font-size: 1.15rem; }

.exam-cta { display: flex; align-items: center; gap: 24px; margin: 20px 0 50px; padding: 28px 32px; border-radius: 20px; border: 1px solid var(--line-strong); background: radial-gradient(ellipse at 0% 50%, rgba(214, 178, 94, .15), transparent 60%), rgba(8, 12, 28, .7); }
.exam-cta > svg { width: 54px; height: 54px; color: var(--gold); flex: none; }
.exam-cta h3 { color: var(--gold-pale); margin-bottom: 4px; }
.exam-cta p { margin: 0; color: var(--parchment); }
.exam-cta .btn { margin-inline-start: auto; }

/* Exam */
.exam { margin-bottom: 60px; }
.exam-intro { padding: 36px; border-radius: 22px; border: 1px solid var(--line); background: rgba(8, 12, 28, .65); }
.exam-intro h2 { color: var(--gold-pale); font-size: 1.4rem; }
.exam-rules { color: var(--parchment); padding-inline-start: 1.2em; margin-bottom: 20px; }
.exam-rules li { margin: .3em 0; }
.exam-rules li::marker { color: var(--gold); }
.exam-advice { padding: 12px 16px; border-radius: 12px; border: 1px solid rgba(240, 163, 90, .4); background: rgba(240, 163, 90, .08); color: #f3cfa0; }
.exam-name { margin: 6px 0 20px; max-width: none; }
.exam-bar { position: sticky; top: calc(var(--header-h) + 8px); z-index: 5; display: flex; align-items: center; gap: 12px; padding: 12px 18px; margin-bottom: 20px; border-radius: 14px; border: 1px solid var(--line); background: rgba(6, 9, 22, .92); backdrop-filter: blur(8px); color: var(--parchment); }
.exam-bar [data-answered] { font-family: var(--font-display); color: var(--gold-light); }
.exam-bar .course-progress { flex: 1; }
.exam-questions { padding-inline-start: 1.4em; color: var(--gold); }
.exam-q { margin-bottom: 28px; }
.exam-options { display: grid; gap: 8px; }
.exam-option { display: flex; align-items: flex-start; gap: 12px; padding: 11px 16px; border-radius: 12px; border: 1px solid var(--line); background: rgba(4, 5, 10, .5); color: var(--parchment); cursor: pointer; font-size: 1.08rem; transition: border-color .2s, background .2s; }
.exam-option:hover { border-color: var(--line-strong); }
.exam-option:has(input:checked) { border-color: var(--gold); background: rgba(214, 178, 94, .12); color: var(--ivory); }
.exam-option input { accent-color: var(--gold); margin-top: .3em; flex: none; }
.exam-submit { width: 100%; margin-top: 10px; }
.exam-submit:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.exam-result { text-align: center; padding: 44px 32px; border-radius: 22px; border: 1px solid var(--line-strong); background: rgba(8, 12, 28, .7); }
.exam-score { font-family: var(--font-display); font-size: 5rem; font-weight: 700; line-height: 1; color: #f0a35a; }
.exam-result.is-passed .exam-score { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.exam-score small { font-size: .4em; }
.exam-result h2 { color: var(--gold-pale); margin: 14px 0 6px; }
.exam-result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 22px 0 30px; }
.exam-review-title { font-size: .8rem; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); margin: 20px 0 14px; }
.exam-review { text-align: start; padding-inline-start: 1.4em; color: var(--gold); }
.exam-review li { margin-bottom: 18px; padding: 14px 18px; border-radius: 14px; border: 1px solid rgba(224, 122, 106, .35); background: rgba(224, 122, 106, .06); }
.exam-review li.is-right { border-color: rgba(143, 207, 109, .35); background: rgba(143, 207, 109, .06); }
.review-answer { margin: 4px 0; color: var(--parchment); }
.review-answer.is-right { color: #e5f6da; }
.review-label { font-family: var(--font-display); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin-inline-end: 8px; }
.review-explanation { margin: 8px 0 0; color: var(--muted); font-style: italic; }
.verify-result { margin-top: 24px; text-align: center; color: var(--parchment); }
.verify-result.is-bad { color: #f0a35a; }

/* Certificate: parchment, gold and a wax seal; prints on landscape A4 */
.certificate-wrap { padding: calc(var(--header-h) + 40px) 24px 60px; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.certificate-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.certificate {
    position: relative; width: min(1000px, 100%); aspect-ratio: 297 / 210; padding: 5.5% 7%; text-align: center; color: #2a1f0b;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: radial-gradient(ellipse at 50% 40%, #fffaf0 0%, #f6ecd2 55%, #e9d9b0 100%);
    box-shadow: 0 40px 90px -30px #000, 0 0 0 1px #c9a45c; border-radius: 6px;
}
.certificate-border { position: absolute; inset: 2.2%; border: 3px double #b08a3e; border-radius: 4px; pointer-events: none; }
.certificate-border::before { content: ""; position: absolute; inset: 8px; border: 1px solid rgba(176, 138, 62, .55); }
.certificate-emblem { width: 9%; aspect-ratio: 1; height: auto; fill: url(#g-gold); margin-bottom: 1%; }
.certificate-org { font-family: var(--font-display); font-size: clamp(.55rem, 1.3vw, .95rem); letter-spacing: .35em; text-transform: uppercase; color: #8a6420; margin: 0 0 1.5%; }
.certificate-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.4rem, 4.6vw, 3.4rem); letter-spacing: .08em; margin: 0 0 2%; background: linear-gradient(180deg, #a77d2a, #6b4b16 60%, #b08a3e); -webkit-background-clip: text; background-clip: text; color: transparent; }
.certificate-line { font-family: var(--font-fell); font-style: italic; font-size: clamp(.8rem, 1.8vw, 1.3rem); margin: 0 0 .8%; color: #4a3a19; }
.certificate-name { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.3rem, 4vw, 3rem); margin: .5% 0 1.5%; padding: 0 4% .5%; border-bottom: 1px solid rgba(176, 138, 62, .6); color: #2a1f0b; }
.certificate-module { font-family: var(--font-display); font-size: clamp(.9rem, 2.4vw, 1.7rem); margin: 0 0 1.2%; color: #6b4b16; }
.certificate-modules { list-style: none; padding: 0; margin: 0 0 1%; display: flex; flex-wrap: wrap; justify-content: center; gap: 0 1.4em; font-family: var(--font-display); font-size: clamp(.55rem, 1.2vw, .85rem); letter-spacing: .06em; color: #6b4b16; }
.certificate-foot { display: flex; align-items: center; justify-content: space-between; width: 86%; margin-top: 2.5%; }
.certificate-sign { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 28%; font-size: clamp(.55rem, 1.1vw, .82rem); color: #6b5a3a; }
.certificate-sign > span:first-child { font-family: var(--font-display); font-size: clamp(.7rem, 1.5vw, 1.05rem); color: #2a1f0b; padding: 0 1em 4px; border-bottom: 1px solid rgba(42, 31, 11, .5); }
.certificate-seal { width: 13%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #c2323f, #7d1621 55%, #3e070d 100%); box-shadow: 0 8px 18px -6px rgba(0, 0, 0, .6), inset 0 -4px 10px rgba(0, 0, 0, .5); }
.certificate-seal svg { width: 58%; height: 58%; fill: url(#g-gold); }
.certificate-verify { position: absolute; bottom: 4.2%; left: 0; right: 0; margin: 0; font-size: clamp(.45rem, .9vw, .7rem); color: #8a7a5a; }
.certificate.is-diploma .certificate-title { font-size: clamp(1.8rem, 6vw, 4.4rem); }

@media (max-width: 960px) { .course-steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
    .course-steps { grid-template-columns: 1fr; }
    .exam-cta { flex-direction: column; text-align: center; }
    .exam-cta .btn { margin: 0; }
    .exam-intro { padding: 24px 18px; }
    .practice { padding: 22px 16px; }
    .practice-head { flex-wrap: wrap; }
}

@media print {
    @page { size: A4 landscape; margin: 0; }
    body.page-certificate { background: #fff !important; }
    body.page-certificate .site-header, body.page-certificate .site-footer, body.page-certificate .seal,
    body.page-certificate .certificate-actions, body.page-certificate .sky, body.page-certificate .vignette,
    body.page-certificate .tr-veil, body.page-certificate .toast { display: none !important; }
    body.page-certificate .certificate-wrap { padding: 0; }
    body.page-certificate .certificate { width: 297mm; height: 210mm; aspect-ratio: auto; box-shadow: none; border-radius: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    body.page-certificate .certificate * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ==========================================================================
   Accounts, passes, locked content, administration
   ========================================================================== */
.nav-login svg { width: 16px; height: 16px; transform: none; opacity: 1; }
.nav-user { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: .06em; text-transform: none; font-size: .95rem; }
.nav-logout { display: flex; align-items: center; gap: 14px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: none; color: var(--ivory); cursor: pointer; font-family: var(--font-display); font-size: .92rem; letter-spacing: .06em; text-align: start; }
.nav-logout:hover { background: rgba(214, 178, 94, .1); }
.nav-logout svg { width: 34px; height: 34px; padding: 8px; border-radius: 10px; border: 1px solid var(--line); color: var(--gold); }

.auth { min-height: 80vh; display: grid; place-items: center; padding: calc(var(--header-h) + 70px) 16px 60px; }
.auth-card { position: relative; width: min(480px, 100%); padding: 64px 36px 34px; text-align: center; border-radius: 24px; background: radial-gradient(ellipse at 50% 0%, rgba(214, 178, 94, .16), transparent 60%), linear-gradient(180deg, rgba(22, 34, 74, .85), rgba(6, 9, 22, .95)) padding-box, linear-gradient(170deg, rgba(244, 223, 160, .7), rgba(214, 178, 94, .1)) border-box; border: 1px solid transparent; box-shadow: var(--shadow); }
.auth-card .display { font-size: clamp(1.8rem, 4vw, 2.4rem); }
.auth-intro { color: var(--parchment); }
.auth-form { display: flex; flex-direction: column; gap: 14px; margin: 18px 0 10px; text-align: start; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; }
.auth-form label span { font-family: var(--font-display); font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.auth-form input, .admin-filter input, .admin-filter select, .admin-inline input, .admin-inline select { height: 48px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-strong); background: rgba(4, 5, 10, .7); color: var(--ivory); font: inherit; font-size: 1.1rem; }
.auth-form input:focus, .admin-filter input:focus, .admin-inline input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(214, 178, 94, .15); }
.auth-form .btn { margin-top: 6px; }
.auth-hint { margin: -4px 0 0; font-size: .98rem; color: var(--gold-pale); }
.auth-links { margin: 16px 0 0; color: var(--muted); font-size: 1rem; }
.auth-error { padding: 10px 14px; border-radius: 12px; border: 1px solid rgba(224, 122, 106, .5); background: rgba(224, 122, 106, .1); color: #f3b4a8; }
.auth-notice { padding: 10px 14px; border-radius: 12px; border: 1px solid rgba(185, 226, 160, .4); background: rgba(143, 207, 109, .08); color: #d8efc8; }

.account { margin-bottom: 60px; }
.account-grid, .admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 22px; }
.account-card { padding: 28px; border-radius: 20px; border: 1px solid var(--line); background: rgba(8, 12, 28, .7); margin-bottom: 22px; }
.account-grid .account-card, .admin-grid .account-card { margin-bottom: 0; }
.account-card h2 { font-size: .85rem; letter-spacing: .26em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; }
.account-card h3 { font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-light); margin: 22px 0 10px; }
.access-ok { color: #d8efc8; }
.account-name { flex-direction: row; align-items: flex-end; flex-wrap: wrap; margin: 0; }
.account-name label { flex: 1 1 220px; }
.account-meta { margin: 14px 0 0; color: var(--muted); font-size: .98rem; }
.account-modules { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.account-module { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(4, 5, 10, .45); color: var(--ivory); }
.account-module.is-passed { border-color: rgba(185, 226, 160, .45); }
.account-module > svg { width: 30px; height: 30px; color: var(--gold); fill: var(--gold); }
.account-module-title { font-family: var(--font-display); font-size: .92rem; color: var(--gold-pale); }
.account-module-status { font-size: .95rem; color: var(--muted); }
.account-module.is-passed .account-module-status { color: #b9e2a0; }
.account-certs { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.account-certs a { display: flex; align-items: center; gap: 10px; color: var(--parchment); }
.account-certs svg { width: 18px; height: 18px; color: var(--gold); fill: var(--gold); }
.account-logout { text-align: center; }
.account-welcome { text-align: center; margin-bottom: 22px; }

.pass-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 10px 0 40px; }
.pass-col { padding: 26px; border-radius: 18px; border: 1px solid var(--line); background: rgba(8, 12, 28, .6); }
.pass-col.is-full { border-color: var(--line-strong); background: radial-gradient(ellipse at 0% 0%, rgba(214, 178, 94, .12), transparent 60%), rgba(8, 12, 28, .7); }
.pass-col h3 { color: var(--gold-pale); font-size: 1.15rem; }
.pass-col ul { margin: 0; padding-inline-start: 1.2em; color: var(--parchment); }
.pass-col li::marker { color: var(--gold); }
.passes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin: 24px 0 30px; }
.pass-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 32px 18px 24px; text-align: center; border-radius: 20px; border: 1px solid var(--line); background: rgba(8, 12, 28, .72); }
.pass-card.is-recommended { border-color: var(--gold); background: radial-gradient(ellipse at 50% 0%, rgba(214, 178, 94, .2), transparent 65%), rgba(8, 12, 28, .8); box-shadow: 0 0 60px -30px rgba(214, 178, 94, .7); }
.pass-flag { position: absolute; top: -12px; padding: 3px 12px; border-radius: 999px; background: var(--gold-grad); color: #1b1406; font-family: var(--font-display); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; }
.pass-card h3 { margin: 0; color: var(--gold-pale); font-size: 1.15rem; }
.pass-period { margin: 0; color: var(--muted); font-size: .98rem; min-height: 2.6em; }
.pass-price { margin: 4px 0 10px; font-family: var(--font-display); font-size: 2.2rem; font-weight: 600; line-height: 1; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pass-price span { font-size: .5em; margin-inline-end: 4px; }
.pass-card form { width: 100%; }
.pass-card .btn { width: 100%; padding: 0 1em; font-size: .72rem; }
.pass-login { font-size: .92rem; color: var(--muted); }
.pass-fine { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 1rem; text-align: center; margin-bottom: 50px; }
.pass-fine svg { width: 22px; height: 22px; flex: none; fill: url(#g-gold); }

.lib-access { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin-bottom: 18px; padding: 18px 22px; border-radius: 16px; border: 1px solid var(--line-strong); background: radial-gradient(ellipse at 0% 50%, rgba(214, 178, 94, .14), transparent 60%), rgba(8, 12, 28, .75); }
.lib-access > svg { width: 38px; height: 38px; color: var(--gold); flex: none; }
.lib-access > div { flex: 1 1 280px; }
.lib-access strong { color: var(--gold-pale); }
.lib-access p { margin: 2px 0 0; color: var(--parchment); font-size: 1.02rem; }
.book-card.is-locked .book, .book-row.is-locked .row-thumb { filter: grayscale(.6) brightness(.6) drop-shadow(0 18px 18px rgba(0, 0, 0, .7)); }
.book-card.is-locked .book-caption strong { color: var(--muted); }
.locked-badge { position: absolute; top: 10px; left: 8px; z-index: 3; padding: 3px 9px; border-radius: 999px; background: rgba(4, 5, 10, .85); border: 1px solid var(--line-strong); color: var(--gold-light); font-family: var(--font-display); font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; }
.book-lock { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; }
.book-lock svg { width: 40%; height: 40%; fill: url(#g-gold); opacity: .35; }
.book-dialog.is-locked .bd-actions { display: none; }
.bd-paywall { margin: 6px 0 20px; padding: 18px 20px; border-radius: 14px; border: 1px solid var(--line-strong); background: rgba(214, 178, 94, .07); }
.bd-paywall p { color: var(--parchment); }
.bd-paywall .btn { margin: 4px 8px 0 0; }

.hb-chapter.is-locked .hb-ch-head { opacity: .7; }
.hb-locked { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 26px; text-align: center; border-radius: 16px; border: 1px dashed var(--line-strong); background: rgba(8, 12, 28, .55); }
.hb-locked svg { width: 42px; height: 42px; fill: url(#g-gold); opacity: .7; }
.hb-locked p { margin: 0; color: var(--parchment); }
.exam-locked { text-align: center; }
.exam-locked > svg { width: 60px; height: 60px; margin: 0 auto 12px; fill: url(#g-gold); }

.page-admin .page-hero { padding-bottom: 30px; }
.admin { max-width: 1320px; margin: 0 auto 60px; padding: 0 24px; }
.admin-nav { display: flex; gap: 10px; margin-bottom: 22px; flex-wrap: wrap; }
.admin-nav a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line); color: var(--parchment); font-family: var(--font-display); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; }
.admin-nav a svg { width: 16px; height: 16px; }
.admin-nav a.is-on { background: var(--gold-grad); color: #1b1406; border-color: transparent; }
.admin-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.admin-filter input { flex: 1 1 260px; height: 42px; font-size: 1rem; }
.admin-filter select, .admin-inline select { height: 42px; font-size: 1rem; }
.admin-count { margin-inline-start: auto; color: var(--muted); }
.admin-table-wrap { overflow-x: auto; border-radius: 16px; border: 1px solid var(--line); background: rgba(6, 9, 22, .75); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.admin-table th { text-align: start; padding: 12px 14px; font-family: var(--font-display); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); border-bottom: 1px solid var(--line); white-space: nowrap; }
.admin-table td { padding: 11px 14px; border-bottom: 1px solid rgba(214, 178, 94, .08); color: var(--parchment); vertical-align: top; }
.admin-table tr.is-disabled td { opacity: .5; }
.admin-table small { color: var(--muted); }
.role-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-family: var(--font-display); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; border: 1px solid var(--line-strong); color: var(--gold-light); }
.role-admin { background: rgba(125, 22, 33, .4); border-color: rgba(224, 122, 106, .6); color: #f3b4a8; }
.role-contributor { background: rgba(35, 64, 138, .4); }
.admin-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.admin-dl dt { color: var(--gold); font-family: var(--font-display); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; padding-top: 4px; }
.admin-dl dd { margin: 0; color: var(--parchment); overflow-wrap: anywhere; }
.admin-actions { display: flex; flex-direction: column; gap: 10px; }
.admin-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.admin-inline input { height: 42px; font-size: 1rem; flex: 1 1 180px; }
.admin-danger { border-color: rgba(224, 122, 106, .6) !important; color: #f3b4a8 !important; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 22px; }
.kpi { padding: 18px; border-radius: 16px; border: 1px solid var(--line); background: rgba(8, 12, 28, .72); text-align: center; }
.kpi span { display: block; font-family: var(--font-display); font-size: 1.7rem; font-weight: 600; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kpi small { color: var(--muted); font-size: .9rem; }
.chart { width: 100%; height: auto; }
.chart .bar-reg { fill: var(--gold); }
.chart .bar-log { fill: rgba(80, 120, 220, .75); }
.chart line { stroke: var(--line-strong); }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font-body); }
.chart-legend { display: flex; gap: 16px; align-items: center; color: var(--muted); font-size: .95rem; margin: 0 0 8px; }
.chart-legend span { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-inline-end: -10px; }
.lg-reg { background: var(--gold); }
.lg-log { background: rgba(80, 120, 220, .75); }
.activity { list-style: none; margin: 0; padding: 0; max-height: 520px; overflow-y: auto; }
.activity li { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 8px 0; border-bottom: 1px solid rgba(214, 178, 94, .08); font-size: .98rem; color: var(--parchment); }
.activity time { color: var(--muted); min-width: 92px; font-variant-numeric: tabular-nums; }
.activity-kind { font-family: var(--font-display); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); padding-top: 3px; }
.activity-detail { color: var(--muted); }
.activity-payment .activity-kind, .activity-certificate .activity-kind, .activity-diploma .activity-kind { color: #b9e2a0; }
.activity-login-failed .activity-kind { color: #f3b4a8; }

@media (max-width: 1100px) { .passes { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 960px) {
    .account-grid, .admin-grid, .pass-compare { grid-template-columns: 1fr; }
    .passes { grid-template-columns: repeat(2, 1fr); }
    .nav-user { max-width: none; }
}
@media (max-width: 640px) {
    .passes { grid-template-columns: 1fr; }
    .auth-card { padding: 60px 20px 28px; }
    .admin { padding: 0 12px; }
    .account-card { padding: 20px 16px; }
}

/* Admin: create a user */
.admin-create { margin-bottom: 18px; }
.admin-create > summary { list-style: none; display: inline-flex; cursor: pointer; }
.admin-create > summary::-webkit-details-marker { display: none; }
.admin-create[open] > summary { margin-bottom: 14px; }
.admin-create__form { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; padding: 20px; border-radius: 16px; border: 1px solid var(--line); background: rgba(6, 9, 22, .6); }
.admin-create__form label { display: grid; gap: 6px; font-size: .9rem; color: var(--gold-light); letter-spacing: .04em; }
.admin-create__form input, .admin-create__form select { height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-strong); background: rgba(4, 5, 10, .7); color: var(--ivory); font: inherit; font-size: 1rem; }
.admin-create__form input:focus, .admin-create__form select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(214, 178, 94, .15); }
.admin-create__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.admin-create__actions small { color: var(--parchment); opacity: .75; font-size: .9rem; }
