:root {
    --ink: #07060a;
    --panel: rgba(16, 12, 20, 0.74);
    --blood: #7d0d1b;
    --blood-hi: #b3182b;
    --gold: #c9a24d;
    --gold-hi: #ecd9a2;
    --gold-dim: rgba(201, 162, 77, 0.35);
    --text: #ddd5c7;
    --muted: #9a8f80;
    --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    --display: 'Cinzel Decorative', 'Cinzel', Georgia, serif;
    --caps: 'Cinzel', Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { background: var(--ink); color-scheme: dark; }

body {
    min-height: 100vh;
    font-family: var(--serif);
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--text);
    background: radial-gradient(ellipse at 50% -10%, #2a1422 0%, #120d18 45%, var(--ink) 100%);
    overflow-x: hidden;
}

a { color: var(--gold-hi); text-decoration: none; }

/* ---------- Sky: moon, fog, embers ---------- */
.sky { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }

.moon {
    position: absolute;
    top: 7vh;
    right: 12vw;
    width: clamp(90px, 12vw, 170px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #f6ecd6 0%, #d8c7a4 45%, #9c8a6a 100%);
    box-shadow: 0 0 60px 10px rgba(236, 217, 162, 0.18), 0 0 160px 40px rgba(179, 24, 43, 0.10);
    opacity: 0.85;
}

.moon::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background:
        radial-gradient(circle at 65% 60%, rgba(0, 0, 0, 0.18) 0 8%, transparent 9%),
        radial-gradient(circle at 40% 70%, rgba(0, 0, 0, 0.12) 0 6%, transparent 7%),
        radial-gradient(circle at 55% 30%, rgba(0, 0, 0, 0.10) 0 5%, transparent 6%);
}

.fog {
    position: absolute;
    left: -50%;
    width: 200%;
    height: 45vh;
    background: radial-gradient(ellipse at center, rgba(120, 100, 140, 0.16) 0%, transparent 60%);
    filter: blur(30px);
}
.fog-1 { bottom: -8vh; animation: drift 40s ease-in-out infinite alternate; }
.fog-2 { bottom: 12vh; opacity: 0.6; animation: drift 65s ease-in-out infinite alternate-reverse; }

@keyframes drift {
    from { transform: translateX(-10%); }
    to   { transform: translateX(10%); }
}

.embers span {
    position: absolute;
    bottom: -10px;
    left: var(--x);
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #ff6a3d;
    box-shadow: 0 0 8px 2px rgba(255, 90, 40, 0.6);
    opacity: 0;
    animation: rise var(--t) linear infinite;
    animation-delay: calc(var(--d) * -1);
}

@keyframes rise {
    0%   { transform: translate(0, 0); opacity: 0; }
    10%  { opacity: 0.9; }
    100% { transform: translate(40px, -105vh); opacity: 0; }
}

.vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.75) 100%);
}

/* ---------- Layout ---------- */
.realm {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: clamp(48px, 10vh, 110px) 20px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 56px;
}

/* ---------- Hero ---------- */
.hero { text-align: center; }

.hero-kicker {
    font-family: var(--caps);
    font-size: 0.8rem;
    letter-spacing: 0.45em;
    text-transform: uppercase;
    color: var(--gold);
    opacity: 0.8;
    margin-bottom: 18px;
}

.hero-title { display: flex; flex-direction: column; align-items: center; line-height: 1; }

.hero-dawn {
    font-family: var(--display);
    font-weight: 900;
    font-size: clamp(2.6rem, 9vw, 6.5rem);
    letter-spacing: 0.04em;
    background: linear-gradient(180deg, #fff3d6 0%, var(--gold-hi) 35%, var(--gold) 65%, #7a5a22 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 4px 24px rgba(179, 24, 43, 0.35));
}

.hero-realm {
    font-family: var(--caps);
    font-weight: 600;
    font-size: clamp(1rem, 2.6vw, 1.6rem);
    letter-spacing: 1.1em;
    margin-right: -1.1em;
    margin-top: 14px;
    color: var(--text);
    text-transform: uppercase;
}

.ornament { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 26px auto 18px; color: var(--gold); }
.ornament span { width: clamp(60px, 14vw, 160px); height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.ornament span:last-child { background: linear-gradient(90deg, var(--gold), transparent); }

.hero-tagline { font-style: italic; font-size: clamp(1.1rem, 2.2vw, 1.4rem); color: var(--muted); }

/* ---------- Gate (login card) ---------- */
.gate { width: 100%; display: flex; justify-content: center; }

.gate-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    padding: 40px 34px 32px;
    background: var(--panel);
    border: 1px solid var(--gold-dim);
    border-radius: 4px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), inset 0 0 40px rgba(125, 13, 27, 0.12);
    backdrop-filter: blur(6px);
}

.gate-card::before {
    content: "";
    position: absolute;
    inset: 8px;
    border: 1px solid rgba(201, 162, 77, 0.12);
    pointer-events: none;
}

.gate-title {
    font-family: var(--caps);
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-align: center;
    color: var(--gold-hi);
}

.gate-sub { text-align: center; font-style: italic; color: var(--muted); margin: 6px 0 26px; }

.gate-form { display: flex; flex-direction: column; gap: 18px; }

.field span {
    display: block;
    font-family: var(--caps);
    font-size: 0.72rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 6px;
}

.field input {
    width: 100%;
    padding: 12px 14px;
    font: inherit;
    font-size: 1.05rem;
    color: var(--text);
    background: rgba(5, 4, 8, 0.7);
    border: 1px solid rgba(201, 162, 77, 0.25);
    border-radius: 2px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.field input::placeholder { color: #5f574d; }
.field input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 162, 77, 0.12); }

.gate-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 0.98rem; }

.check { display: flex; align-items: center; gap: 8px; color: var(--muted); cursor: pointer; }
.check input { accent-color: var(--blood-hi); }

.link { color: var(--muted); border-bottom: 1px solid transparent; transition: color 0.2s, border-color 0.2s; }
.link:hover { color: var(--gold-hi); border-color: var(--gold-dim); }

.btn {
    display: block;
    width: 100%;
    padding: 14px 18px;
    font-family: var(--caps);
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    text-align: center;
    border-radius: 2px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.25s, background 0.25s;
}

.btn-blood {
    color: #fbeee6;
    background: linear-gradient(180deg, var(--blood-hi), var(--blood));
    border: 1px solid #d23a4c;
    box-shadow: 0 8px 30px rgba(179, 24, 43, 0.35);
}
.btn-blood:hover { box-shadow: 0 10px 40px rgba(179, 24, 43, 0.6); transform: translateY(-1px); }

.btn-gold { color: var(--gold-hi); background: transparent; border: 1px solid var(--gold); }
.btn-gold:hover { background: rgba(201, 162, 77, 0.1); box-shadow: 0 0 30px rgba(201, 162, 77, 0.2); }

.divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 24px 0;
    color: var(--muted);
    font-family: var(--caps);
    font-size: 0.7rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: rgba(201, 162, 77, 0.2); }

.gate-note { margin-top: 16px; font-size: 0.95rem; text-align: center; color: var(--muted); }
.gate-note strong { color: var(--gold-hi); font-weight: 600; }

.alert {
    margin-bottom: 18px;
    padding: 10px 14px;
    border-left: 3px solid var(--blood-hi);
    background: rgba(125, 13, 27, 0.2);
    font-size: 0.98rem;
}

/* ---------- Pillars ---------- */
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; width: 100%; }

.pillar {
    padding: 28px 24px;
    text-align: center;
    border-top: 1px solid var(--gold-dim);
    background: linear-gradient(180deg, rgba(201, 162, 77, 0.05), transparent);
}
.pillar-icon { color: var(--gold); margin-bottom: 12px; }
.pillar h3 {
    font-family: var(--caps);
    font-size: 1rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--gold-hi);
    margin-bottom: 8px;
}
.pillar p { color: var(--muted); font-size: 1.02rem; }

/* ---------- Footer ---------- */
.realm-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 30px 20px 40px;
    font-size: 0.88rem;
    color: #6d655b;
}
.realm-footer .sigil { font-family: var(--caps); letter-spacing: 0.4em; color: var(--gold); opacity: 0.6; margin-bottom: 8px; }

/* ---------- Accessibility & mobile ---------- */
@media (prefers-reduced-motion: reduce) {
    .fog { animation: none; }
    .embers { display: none; }
}

@media (max-width: 520px) {
    .gate-card { padding: 32px 22px 26px; }
    .moon { right: 6vw; top: 4vh; }
}
