@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700&family=Cormorant+Garamond:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
    --bg-deep: #170c07;
    --bg-mid: #2a150c;
    --umber: #3b1f11;
    --ivory: #f4e9d8;
    --muted: #dac8aa;
    --gold: #d9a441;
    --gold-soft: #f0c56b;
    --terracotta: #c1592f;
    --line: rgba(217, 164, 65, 0.24);
}

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

/* overflow-x only on html: setting it on body too breaks position: sticky */
html {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: var(--bg-deep);
    color: var(--ivory);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Layering: background 0, canvas 1, content 2, nav 100 ---- */

.bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 80% 55% at 50% 12%, rgba(193, 89, 47, 0.38) 0%, rgba(193, 89, 47, 0) 70%),
        radial-gradient(ellipse 70% 50% at 50% 100%, rgba(217, 164, 65, 0.16) 0%, rgba(217, 164, 65, 0) 70%),
        linear-gradient(180deg, #2f180d 0%, #221109 45%, #150a06 100%);
}

#scene {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    display: block;
}

.hero,
.cards-section,
.cta,
.signal-line {
    position: relative;
    z-index: 2;
}

/* ---- Nav ---- */
/* Full-width sticky bar; max-width lives on .nav-inner. Class is .site-nav
   (not .nav) to stay clear of Bootstrap's .nav rules. */

.site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    padding: 24px 0;
    background: rgba(30, 15, 9, 0.5);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(217, 164, 65, 0.12);
    transition: padding 250ms ease, background-color 250ms ease, box-shadow 250ms ease, border-color 250ms ease;
}

.nav-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.site-nav.nav-scrolled {
    padding: 10px 0;
    background: rgba(23, 11, 6, 0.93);
    border-bottom-color: rgba(217, 164, 65, 0.28);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 1.65rem;
    letter-spacing: 0.06em;
    color: var(--ivory);
    text-decoration: none;
    transition: font-size 250ms ease, gap 250ms ease;
}

.logo:hover { color: var(--ivory); text-decoration: none; }

.logo svg {
    width: 1.3em;
    height: 1.3em;
    flex: none;
    color: var(--gold);
    transition: width 250ms ease, height 250ms ease;
}

.logo .quest { color: var(--gold-soft); }

.logo .tld {
    font-size: 0.55em;
    font-weight: 500;
    letter-spacing: 0.14em;
    color: var(--muted);
    margin-left: -6px;
    align-self: flex-end;
    padding-bottom: 0.3em;
}

.site-nav.nav-scrolled .logo { font-size: 1.3rem; gap: 9px; }

.site-nav .nav-link {
    display: inline-block;
    padding: 12px 26px;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 0.92rem;
    letter-spacing: 0.1em;
    color: #1a0d06;
    background: linear-gradient(135deg, #f0c56b 0%, #d9a441 55%, #c8862e 100%);
    border-radius: 6px;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 4px 18px rgba(217, 164, 65, 0.25);
    transition: padding 250ms ease, font-size 250ms ease, transform 200ms ease, box-shadow 200ms ease, filter 200ms ease;
}

.site-nav.nav-scrolled .nav-link { padding: 8px 18px; font-size: 0.8rem; }

.site-nav .nav-link:hover,
.site-nav .nav-link:focus {
    color: #1a0d06;
    transform: translateY(-2px);
    filter: brightness(1.08);
    box-shadow: 0 8px 26px rgba(217, 164, 65, 0.45);
}

.site-nav .nav-link:focus-visible,
.signal-cta:focus-visible,
.logo:focus-visible {
    outline: 3px solid var(--ivory);
    outline-offset: 4px;
}

/* ---- Hero ---- */

.hero {
    max-width: 1240px;
    margin: 0 auto;
    padding: 12vh 24px 9vh;
    text-align: center;
}

.hero h1 {
    margin: 0;
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 700;
    font-size: clamp(2rem, 6vw, 5rem);
    line-height: 1.1;
    letter-spacing: 0.005em;
    color: var(--ivory);
    text-shadow: 0 2px 30px rgba(10, 4, 2, 0.85), 0 0 2px rgba(10, 4, 2, 0.6);
    animation: rise 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero h1 .line { display: block; }

.hero h1 .line + .line {
    color: var(--gold-soft);
    animation: rise 1.1s 0.15s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero-domain {
    max-width: 680px;
    margin: 34px auto 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    font-family: 'Cinzel', serif;
    font-weight: 500;
    font-size: 1.05rem;
    letter-spacing: 0.24em;
    color: var(--muted);
    text-shadow: 0 1px 14px rgba(10, 4, 2, 0.9);
    animation: rise 1.1s 0.3s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero-domain::before,
.hero-domain::after {
    content: "";
    flex: 0 1 64px;
    height: 1px;
    background: linear-gradient(90deg, rgba(217, 164, 65, 0), rgba(217, 164, 65, 0.85));
}

.hero-domain::after { transform: scaleX(-1); }

@keyframes rise {
    from { opacity: 0; transform: translateY(22px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---- Cards ---- */
/* Explicit colors and Bootstrap .card overrides so contrast never depends on inheritance. */

.cards-section {
    padding: 8vh 24px 4vh;
}

.cards {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.cards-section .card {
    position: relative;
    display: block;
    height: auto;
    min-width: 0;
    padding: 38px;
    color: var(--muted);
    background: linear-gradient(160deg, rgba(52, 28, 16, 0.94) 0%, rgba(30, 16, 9, 0.96) 100%);
    border: 1px solid var(--line);
    border-radius: 14px;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
    transition: transform 300ms ease, border-color 300ms ease, box-shadow 300ms ease;
}

.cards-section .card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 38px;
    right: 38px;
    height: 2px;
    background: linear-gradient(90deg, rgba(217, 164, 65, 0), var(--gold), rgba(217, 164, 65, 0));
    opacity: 0.55;
    transition: opacity 300ms ease;
}

.cards-section .card:hover {
    transform: translateY(-8px);
    border-color: rgba(240, 197, 107, 0.6);
    box-shadow: 0 24px 54px rgba(0, 0, 0, 0.5), 0 0 34px rgba(217, 164, 65, 0.14);
}

.cards-section .card:hover::before { opacity: 1; }

.cards-section .card .icon {
    display: block;
    width: 46px;
    height: 46px;
    margin-bottom: 22px;
    color: var(--gold);
}

.cards-section .card h2 {
    margin: 0 0 14px;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 700;
    font-size: 1.85rem;
    line-height: 1.15;
    color: var(--ivory);
}

.cards-section .card p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--muted);
}

/* ---- Signal Line / CTA ---- */

.cta {
    padding: 12vh 24px 16vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.cta p { margin: 0; }

.signal-status {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 26px;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.24em;
    color: var(--gold-soft);
}

.signal-status::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--gold-soft);
    box-shadow: 0 0 0 0 rgba(240, 197, 107, 0.6);
    animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(240, 197, 107, 0.55); }
    70%, 100% { box-shadow: 0 0 0 12px rgba(240, 197, 107, 0); }
}

.signal-cta {
    display: inline-block;
    max-width: 100%;
    padding: 22px 52px;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.12em;
    color: #1a0d06;
    text-decoration: none;
    background: linear-gradient(135deg, #f6d17c 0%, #d9a441 55%, #c1592f 130%);
    border-radius: 8px;
    box-shadow: 0 10px 34px rgba(217, 164, 65, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transition: transform 220ms ease, box-shadow 220ms ease, filter 220ms ease;
}

.signal-cta:hover {
    color: #1a0d06;
    text-decoration: none;
    transform: translateY(-3px);
    filter: brightness(1.07);
    box-shadow: 0 16px 46px rgba(217, 164, 65, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.signal-cta:active { transform: translateY(0); }

.signal-sub {
    margin: 22px 0 0;
    font-size: 0.9rem;
    letter-spacing: 0.03em;
    color: var(--muted);
}

/* ---- Footer ---- */
/* Footer markup is injected via SSI and can't be edited per-domain, so
   visibility, contrast and spacing live here. */

footer {
    position: relative;
    z-index: 2;
    padding: 20px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--muted);
    background: #120904;
    border-top: 1px solid var(--line);
}

footer div {
    margin: 4px 0;
}

footer a {
    color: var(--gold-soft);
}

footer a:hover,
footer a:focus {
    color: var(--ivory);
}

footer .text-muted,
footer .text-secondary,
footer .text-dark,
footer .text-body {
    color: var(--muted) !important;
}

footer [class*="bg-"] {
    background: transparent !important;
}

/* ---- Responsive ---- */

@media (min-width: 600px) {
    .hero h1 .line { white-space: nowrap; }
}

@media (max-width: 480px) {
    .site-nav { padding: 16px 0; }
    .site-nav.nav-scrolled { padding: 8px 0; }
    .nav-inner { padding: 0 16px; gap: 10px; }
    .logo { font-size: 1.2rem; gap: 8px; }
    .site-nav.nav-scrolled .logo { font-size: 1.05rem; }
    .site-nav .nav-link { padding: 10px 16px; font-size: 0.78rem; }
    .site-nav.nav-scrolled .nav-link { padding: 7px 13px; font-size: 0.72rem; }
    .hero { padding: 11vh 20px 6vh; }
    .hero-domain { font-size: 0.9rem; letter-spacing: 0.16em; }
    .cards-section { padding: 6vh 16px 3vh; }
    .cards-section .card { padding: 30px 26px; }
    .cards-section .card::before { left: 26px; right: 26px; }
    .cards-section .card h2 { font-size: 1.6rem; }
    .cta { padding: 9vh 16px 14vh; }
    .signal-status { font-size: 0.8rem; letter-spacing: 0.16em; }
    .signal-cta { padding: 18px 26px; font-size: 0.95rem; letter-spacing: 0.08em; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}
