/* ── Exordium brand fonts ───────────────────────────────────────────── */
@font-face {
    font-family: 'Cinzel';
    src: url('fonts/Cinzel-Variable.ttf') format('truetype');
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Livingstone';
    src: url('fonts/Livingst.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ── Palette: matches Exordium desktop (FantasyTheme.Colors) ─────────── */
:root {
    --bg: #1E2228;
    --bg-dark: #171B21;
    --panel: #242A32;
    --card: #2A3140;
    --surface: #323A48;

    --accent: #C4A35A;
    --accent-light: #D4B36A;
    --accent-dim: #9A7B3C;
    --gold-soft: rgba(196, 163, 90, 0.14);

    --text: #E0E4EC;
    --text-dim: #9AA4B8;
    --text-mute: #627088;
    --on-gold: #1A1610;

    --border: #2A3140;
    --border-normal: #354058;
    --border-strong: #4A5778;

    --success: #5A9E6F;
    --danger: #C2564E;

    --display: 'Cinzel', Georgia, 'Times New Roman', serif;
    --body: 'Segoe UI', system-ui, -apple-system, sans-serif;

    --maxw: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--body);
    color: var(--text);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Atmosphere: a very slight five-colour blur washing the whole site (fixed) */
body::before {
    content: "";
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(520px 400px at 8% 8%,   rgba(48,193,131,0.09), transparent 70%),
        radial-gradient(540px 420px at 92% 10%,  rgba(52,145,212,0.09), transparent 70%),
        radial-gradient(460px 360px at 50% 48%,  rgba(246,162,29,0.045), transparent 70%),
        radial-gradient(540px 440px at 8% 92%,   rgba(156,88,171,0.08), transparent 70%),
        radial-gradient(560px 440px at 94% 90%,  rgba(229,119,33,0.08), transparent 70%),
        linear-gradient(180deg, var(--bg-dark), var(--bg) 30%, var(--bg));
}
/* Faint film grain — smooths gradient banding, adds a premium texture */
body::after {
    content: "";
    position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent-light); }

h1, h2 { font-family: var(--display); font-weight: 600; line-height: 1.12; letter-spacing: 0.4px; }
h3 { font-weight: 600; line-height: 1.2; }

.site { min-height: 100vh; display: flex; flex-direction: column; }
.content { flex: 1; width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 28px 40px; }
/* Inner pages (no hero) start with an h1 — give it breathing room below the sticky bar. */
.page-fade > h1:first-child { margin-top: 44px; }

/* Per-page fade-in (keyed by URL in the layout so it re-fires on navigation) */
@keyframes pageFade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.page-fade { animation: pageFade 0.62s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
@media (prefers-reduced-motion: reduce) { .page-fade { animation: none; } }

/* ── Eyebrow label ──────────────────────────────────────────────────── */
.eyebrow {
    display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 3px;
    text-transform: uppercase; color: var(--accent-dim); margin-bottom: 12px;
}

/* ── Top bar (sticky, glass) ────────────────────────────────────────── */
.topbar {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; gap: 24px;
    padding: 13px 28px;
    background: rgba(23, 27, 33, 0.72);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(53, 64, 88, 0.6);
}
.brand { display: inline-flex; align-items: center; }
.brand img { height: 25px; display: block; transition: filter .2s; }
.brand:hover img { filter: drop-shadow(0 0 8px rgba(196,163,90,0.4)); }
.nav { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.nav a { color: var(--text-dim); font-size: 13.5px; letter-spacing: 0.2px; }
.nav a:hover { color: var(--text); }
.logout-form { display: inline; margin: 0; }
.linkbtn { background: none; border: none; color: var(--text-dim); font: inherit; font-size: 13.5px; cursor: pointer; padding: 0; }
.linkbtn:hover { color: var(--text); }

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn {
    display: inline-block; padding: 13px 26px; border-radius: 9px;
    font-size: 14px; font-weight: 600; letter-spacing: 0.3px; cursor: pointer;
    border: 1px solid var(--border-strong); background: rgba(50, 58, 72, 0.5); color: var(--text);
    transition: transform .15s, border-color .15s, background .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-2px); border-color: var(--accent-dim); color: var(--text); }
.btn.primary {
    background: linear-gradient(180deg, var(--accent-light), var(--accent));
    border: 1px solid var(--accent-light); color: var(--on-gold);
    box-shadow: 0 6px 20px rgba(196,163,90,0.22);
}
.btn.primary:hover {
    background: linear-gradient(180deg, #E0C078, var(--accent-light));
    box-shadow: 0 10px 28px rgba(196,163,90,0.34); color: var(--on-gold);
}

/* ── Hero ────────────────────────────────────────────────────────────── */
.hero {
    position: relative; text-align: center;
    padding: 92px 0 56px; min-height: 460px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.hero-logo { height: 104px; filter: drop-shadow(0 4px 14px rgba(0,0,0,0.4)); }
.hero h1 { margin: 0; }
.hero h2 { font-size: 36px; color: var(--accent); margin: 0 0 14px; }
.hero .tag { font-size: 18px; color: var(--text-dim); max-width: 640px; margin: 22px auto 30px; line-height: 1.65; }
.cta { display: inline-flex; gap: 14px; flex-wrap: wrap; justify-content: center; }

/* Convergence strip: the five crafts → one story */
.pillars {
    display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
    gap: 12px; padding: 4px 0 36px; font-family: var(--display); font-size: 15px; letter-spacing: 0.4px;
}
.pillars .p { font-weight: 600; }
.pillars .sep { color: var(--border-strong); }
.pillars .arrow { color: var(--text-mute); margin: 0 2px; font-family: var(--body); }
.pillars .story { color: var(--accent); font-weight: 700; }

/* Ornamental divider: gold-fading rules + center diamond */
.ornament { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 8px auto 0; max-width: 320px; color: var(--accent-dim); }
.ornament::before, .ornament::after { content: ""; height: 1px; flex: 1; background: linear-gradient(90deg, transparent, var(--accent-dim)); }
.ornament::after { background: linear-gradient(90deg, var(--accent-dim), transparent); }
.ornament span { font-size: 10px; }

/* ── Long-form alternating feature sections ─────────────────────────── */
.feature-section {
    --pillar: var(--accent); /* overridden per section to its tower colour */
    display: flex; gap: 56px; align-items: center;
    padding: 68px 0; position: relative;
}
.feature-section + .feature-section::before {
    content: ""; position: absolute; top: 0; left: 8%; right: 8%; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(154,123,60,0.4), transparent);
}
.feature-section:nth-of-type(even) { flex-direction: row-reverse; }
.fs-visual { flex: 0 0 200px; display: flex; justify-content: center; }
.fs-ring {
    width: 180px; height: 180px; border-radius: 50%;
    background: radial-gradient(circle at 50% 38%, var(--surface), var(--bg-dark) 78%);
    border: 1px solid color-mix(in srgb, var(--pillar) 38%, var(--border-strong));
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 0 10px color-mix(in srgb, var(--pillar) 9%, transparent), 0 18px 40px rgba(0,0,0,0.38), inset 0 1px 0 rgba(255,255,255,0.05);
    transition: transform .25s, box-shadow .25s;
}
.fs-ring img { width: 92px; height: 92px; filter: drop-shadow(0 3px 10px rgba(0,0,0,0.45)); transition: transform .25s; }
.feature-section:hover .fs-ring { transform: translateY(-5px); box-shadow: 0 0 0 13px color-mix(in srgb, var(--pillar) 16%, transparent), 0 26px 56px rgba(0,0,0,0.5); }
.feature-section:hover .fs-ring img { transform: scale(1.07); }
.fs-body { flex: 1; }
.fs-body .eyebrow { color: var(--pillar); }
.fs-body h2 { font-size: 32px; margin: 0 0 12px; color: var(--text); }
.fs-body h2::after { content: ""; display: block; width: 54px; height: 3px; border-radius: 2px; background: var(--pillar); margin-top: 16px; opacity: 0.9; }
.fs-body .sub { font-size: 16.5px; color: var(--text-dim); margin: 18px 0 22px; line-height: 1.6; max-width: 640px; }
.fs-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 13px; }
.fs-list li { position: relative; padding-left: 26px; color: var(--text-dim); font-size: 15px; line-height: 1.55; max-width: 660px; }
.fs-list li::before { content: "\25C6"; position: absolute; left: 0; top: 3px; color: var(--pillar); font-size: 11px; }
.fs-list strong { color: var(--text); font-weight: 600; }

/* ── Feature bands (offline AI, one-file) ───────────────────────────── */
.band {
    position: relative; overflow: hidden;
    background: linear-gradient(180deg, rgba(36,42,50,0.6), rgba(23,27,33,0.6));
    border: 1px solid var(--border-normal);
    border-radius: 16px; padding: 50px 38px; margin: 64px 0 0; text-align: center;
    box-shadow: 0 16px 40px rgba(0,0,0,0.25);
}
.band::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.band h2 { color: var(--text); font-size: 30px; margin: 0 0 12px; }
.band .sub { color: var(--text-dim); max-width: 700px; margin: 0 auto 26px; font-size: 16.5px; line-height: 1.6; }
.band-points { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; max-width: 920px; margin: 0 auto; }
.band-points div {
    flex: 1 1 250px; background: rgba(42,49,64,0.5); border: 1px solid var(--border-normal);
    border-radius: 12px; padding: 18px 20px; text-align: left; color: var(--text-dim);
    font-size: 14px; line-height: 1.55; transition: transform .15s, border-color .15s;
}
.band-points div:hover { transform: translateY(-3px); border-color: var(--accent-dim); }
.band-points strong { color: var(--accent); display: block; margin-bottom: 5px; font-size: 13px; letter-spacing: 0.3px; }

/* ── Footer ─────────────────────────────────────────────────────────── */
.foot {
    border-top: 1px solid var(--border); margin-top: 64px;
    background: rgba(23,27,33,0.5);
}
.foot-inner { max-width: var(--maxw); margin: 0 auto; padding: 28px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.foot-inner img { height: 22px; opacity: 0.85; }
.foot-links { display: flex; gap: 20px; margin-left: auto; }
.foot-links a { color: var(--text-mute); font-size: 13px; }
.foot-links a:hover { color: var(--text-dim); }
.foot-copy { color: var(--text-mute); font-size: 12px; width: 100%; }

/* ── Centered auth pages (sign in / register) ───────────────────────── */
.auth {
    min-height: calc(100vh - 230px);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 18px; text-align: center;
}
.auth h1 { margin: 0; }
.auth > .tag { margin: 0; max-width: 440px; }
.auth .card { width: 100%; max-width: 420px; text-align: left; }

/* ── Pricing card ───────────────────────────────────────────────────── */
.pricing { display: flex; justify-content: center; margin-top: 28px; }
.price-card {
    background: var(--panel); border: 1px solid var(--border-normal);
    border-radius: 16px; padding: 34px 32px; max-width: 420px; width: 100%;
    text-align: center; box-shadow: 0 16px 40px rgba(0,0,0,0.25);
}
.price-card .amount { font-family: var(--display); font-size: 46px; color: var(--accent); line-height: 1; }
.price-card .amount span { font-size: 15px; color: var(--text-dim); font-family: var(--body); }
.price-card .lede { color: var(--text-dim); margin: 8px 0 20px; font-size: 14px; }
.price-card ul { list-style: none; padding: 0; margin: 0 0 24px; text-align: left; display: grid; gap: 11px; }
.price-card li { color: var(--text); font-size: 14px; padding-left: 26px; position: relative; line-height: 1.45; }
.price-card li::before { content: "\2713"; position: absolute; left: 0; top: 1px; color: var(--success); font-weight: 700; }

/* ── Legal / long-form content pages ────────────────────────────────── */
.legal { max-width: 760px; margin: 0 auto; padding-top: 12px; }
.legal h1 { font-size: 34px; margin: 0 0 6px; }
.legal .updated { color: var(--text-mute); font-size: 13px; margin: 0 0 28px; }
.legal h2 { font-family: var(--display); font-weight: 600; font-size: 20px; color: var(--accent); margin: 30px 0 10px; }
.legal p, .legal li { color: var(--text-dim); font-size: 15px; line-height: 1.65; }
.legal ul { padding-left: 22px; }
.legal strong { color: var(--text); }
.legal .note { background: var(--panel); border: 1px solid var(--border-normal); border-radius: 10px; padding: 14px 18px; font-size: 13px; }

/* ── Forms / cards ──────────────────────────────────────────────────── */
.page-pad { padding-top: 44px; }
.card {
    background: var(--panel); border: 1px solid var(--border-normal);
    border-radius: 14px; padding: 28px; max-width: 560px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.22);
}
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-mute); }
.field input, .field textarea {
    background: var(--bg-dark); border: 1px solid var(--border-normal); border-radius: 7px;
    color: var(--text); padding: 11px 13px; font: inherit; font-size: 14px; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(196,163,90,0.12); }
textarea.token { width: 100%; font-family: Consolas, monospace; font-size: 12px; }
.err { color: var(--danger); font-size: 13px; }
.ok { color: var(--success); font-size: 13px; }
.dl { display: inline-block; margin-top: 12px; }

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 760px) {
    .feature-section, .feature-section:nth-of-type(even) { flex-direction: column; text-align: center; padding: 48px 0; gap: 28px; }
    .fs-body .sub, .fs-list li { margin-left: auto; margin-right: auto; }
    .fs-list li { text-align: left; }
    .hero h2 { font-size: 28px; }
    .hero-logo { height: 76px; }
}

/* ── Blazor framework error UI ──────────────────────────────────────── */
#blazor-error-ui {
    background: #2a1015; color: #f1c6cf; border-top: 1px solid var(--danger);
    bottom: 0; box-shadow: 0 -1px 8px rgba(0,0,0,.4); display: none;
    left: 0; padding: 10px 16px; position: fixed; width: 100%; z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 12px; top: 8px; }
.blazor-error-boundary { background: #2a1015; padding: 12px; color: #f1c6cf; }
