/* mujun.quest — luxury-maximalist mcbling
   Palette: #0D0D0D background, #F5F0E8 body, #D4AF37 gold, #2D5016 spring green, #C4A76B bronze
   Type: Righteous (Futura PT substitute), Cormorant Garamond, Inter
*/

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

:root {
    --c-bg: #0D0D0D;
    --c-cream: #F5F0E8;
    --c-gold: #D4AF37;
    --c-green: #2D5016;
    --c-bronze: #C4A76B;
    --f-display: 'Cormorant Garamond', serif;
    --f-heading: 'Righteous', 'Inter', sans-serif;
    --f-body: 'Inter', sans-serif;
    --max-w: 1200px;
    --gutter: 24px;
}

html, body {
    background: var(--c-bg);
    color: var(--c-cream);
    font-family: var(--f-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body {
    background-image:
        radial-gradient(ellipse at 50% -20%, rgba(212,175,55,0.06), transparent 60%),
        radial-gradient(ellipse at 50% 110%, rgba(45,80,22,0.05), transparent 65%);
    background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; }
button { background: none; border: none; color: inherit; font: inherit; cursor: pointer; }

/* ==================== HERO ==================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    overflow: hidden;
}

.hero::before,
.hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--c-gold) 25%, var(--c-gold) 75%, transparent);
    opacity: 0.55;
    pointer-events: none;
}
.hero::before { top: 0; box-shadow: 0 60px 60px -60px rgba(212,175,55,0.18); }
.hero::after  { bottom: 0; box-shadow: 0 -60px 60px -60px rgba(212,175,55,0.18); }

.hero-nav {
    position: absolute;
    bottom: 36px;
    right: 36px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: right;
    z-index: 4;
}
.hero-nav a {
    font-family: var(--f-heading);
    font-size: 12px;
    letter-spacing: 0.12em;
    color: var(--c-gold);
    opacity: 0.8;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.hero-nav a:hover { opacity: 1; transform: translateX(-4px); }

.hero-figure {
    position: relative;
    width: min(560px, 92vw);
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.hero-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    will-change: stroke-dashoffset;
    transform: translateZ(0);
}

.frame-octagon,
.frame-dodecagon {
    stroke-dasharray: 1300;
    stroke-dashoffset: 1300;
    animation: drawStroke 1.6s cubic-bezier(0.4, 0, 0.2, 1) 0.1s forwards;
}
.frame-dodecagon { animation-delay: 0.4s; animation-duration: 1.8s; }

.flourish path,
.hero-inner-vine path {
    stroke-dasharray: 80;
    stroke-dashoffset: 80;
    animation: drawStroke 1.2s cubic-bezier(0.4, 0, 0.2, 1) 0.9s forwards;
}
.flourish-right path { animation-delay: 1.0s; }
.flourish-bottom path { animation-delay: 1.1s; }
.flourish-left path { animation-delay: 1.2s; }
.flourish circle { opacity: 0; animation: fadeIn 0.5s ease 1.4s forwards; }
.hero-inner-vine path { animation-delay: 1.4s; stroke-dasharray: 200; stroke-dashoffset: 200; animation-duration: 1.4s; }
.hero-inner-vine circle { opacity: 0; animation: fadeIn 0.5s ease 1.8s forwards; }

@keyframes drawStroke {
    to { stroke-dashoffset: 0; }
}
@keyframes fadeIn { to { opacity: 1; } }

.hero-caption {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 36px;
    max-width: 420px;
}

.hero-eyebrow {
    display: inline-block;
    font-family: var(--f-heading);
    font-size: 11px;
    letter-spacing: 0.4em;
    color: var(--c-gold);
    text-transform: uppercase;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(8px);
    animation: rise 0.8s cubic-bezier(0.4, 0, 0.2, 1) 1.6s forwards;
}

.hero-title {
    font-family: var(--f-heading);
    font-size: clamp(40px, 7vw, 64px);
    color: var(--c-cream);
    letter-spacing: 0.04em;
    line-height: 1.0;
    margin-bottom: 24px;
    opacity: 0;
    transform: translateY(12px);
    animation: rise 1.0s cubic-bezier(0.4, 0, 0.2, 1) 1.8s forwards;
}
.hero-title .dot { color: var(--c-gold); padding: 0 4px; }

.hero-subtitle {
    font-family: var(--f-display);
    font-style: italic;
    font-size: clamp(20px, 2.6vw, 28px);
    line-height: 1.35;
    color: var(--c-cream);
    opacity: 0;
    transform: translateY(10px);
    animation: rise 0.9s cubic-bezier(0.4, 0, 0.2, 1) 2.4s forwards;
    margin-bottom: 36px;
}

.cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--f-heading);
    font-size: 13px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--c-gold);
    border: 2px solid var(--c-gold);
    padding: 12px 28px;
    background: transparent;
    position: relative;
    overflow: hidden;
    transition: color 0.4s ease, border-color 0.3s ease;
    opacity: 0;
    transform: translateY(8px);
    animation: rise 0.8s cubic-bezier(0.4, 0, 0.2, 1) 3.0s forwards;
    cursor: pointer;
}
.cta::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--c-gold);
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left center;
    transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}
.cta:hover::before { opacity: 0.12; transform: scaleX(1); }
.cta > * { position: relative; z-index: 1; }

.cta-leaf {
    width: 14px;
    height: 14px;
    color: var(--c-gold);
    transform: translateX(-4px) rotate(-12deg);
    opacity: 0.7;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
}
.cta:hover .cta-leaf { transform: translateX(0) rotate(8deg); opacity: 1; }

/* Hero corner ornaments */
.hero-corner {
    position: absolute;
    width: 36px;
    height: 36px;
    border: 1px solid var(--c-gold);
    opacity: 0.6;
    pointer-events: none;
}
.hero-corner-tl { top: 24px; left: 24px; border-right: none; border-bottom: none; }
.hero-corner-tr { top: 24px; right: 24px; border-left: none; border-bottom: none; }
.hero-corner-bl { bottom: 24px; left: 24px; border-right: none; border-top: none; }
.hero-corner-br { bottom: 24px; right: 24px; border-left: none; border-top: none; }

.hero-scroll {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--c-gold);
    pointer-events: none;
    opacity: 0;
    animation: fadeIn 1s ease 3.4s forwards;
}
.scroll-label {
    font-family: var(--f-heading);
    font-size: 10px;
    letter-spacing: 0.4em;
    text-transform: uppercase;
}
.scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(180deg, var(--c-gold), transparent);
    animation: scrollPulse 2.4s ease-in-out infinite;
}
@keyframes scrollPulse {
    0%, 100% { opacity: 0.4; transform: scaleY(0.6); }
    50% { opacity: 1; transform: scaleY(1); }
}

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

/* ==================== SPRING DIVIDER BAND ==================== */
.spring-band {
    height: 16px;
    width: 100%;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='48' height='16' viewBox='0 0 48 16'><path d='M0 8 L8 0 L16 8 L8 16 Z' fill='none' stroke='%232D5016' stroke-width='0.8' opacity='0.6'/><path d='M16 8 L24 0 L32 8 L24 16 Z' fill='none' stroke='%23C4A76B' stroke-width='0.8' opacity='0.6'/><path d='M32 8 L40 0 L48 8 L40 16 Z' fill='none' stroke='%232D5016' stroke-width='0.8' opacity='0.6'/><path d='M4 8 q4 -6 8 0 q4 6 8 0' fill='none' stroke='%232D5016' stroke-width='0.7' opacity='0.5'/><path d='M20 8 q4 -6 8 0 q4 6 8 0' fill='none' stroke='%23C4A76B' stroke-width='0.7' opacity='0.5'/><path d='M36 8 q4 -6 8 0 q4 6 8 0' fill='none' stroke='%232D5016' stroke-width='0.7' opacity='0.5'/></svg>");
    background-repeat: repeat-x;
    background-size: 48px 16px;
    opacity: 0.7;
    pointer-events: none;
    margin: 0;
}

/* ==================== SECTION COMMON ==================== */
.chapters,
.archive,
.guild,
.contact {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 96px var(--gutter);
    position: relative;
}

.chapters::before, .chapters::after,
.archive::before, .archive::after,
.guild::before, .guild::after,
.contact::before, .contact::after {
    content: "";
    position: absolute;
    top: 60px;
    bottom: 60px;
    width: 1px;
    background: linear-gradient(180deg, transparent, var(--c-gold) 18%, var(--c-gold) 82%, transparent);
    opacity: 0.45;
}
.chapters::before, .archive::before, .guild::before, .contact::before { left: 12px; }
.chapters::after, .archive::after, .guild::after, .contact::after { right: 12px; }

.section-head {
    margin-bottom: 60px;
    max-width: 720px;
}

.accent-diamond {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 1px solid var(--c-gold);
    transform: rotate(45deg);
    margin-bottom: 12px;
    position: relative;
}
.accent-diamond::after {
    content: "";
    position: absolute;
    inset: 3px;
    background: var(--c-gold);
    opacity: 0.4;
}

.section-title {
    font-family: var(--f-heading);
    font-size: clamp(28px, 4vw, 36px);
    color: var(--c-cream);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 18px;
}

.section-lede {
    font-family: var(--f-display);
    font-style: italic;
    font-size: 20px;
    color: var(--c-cream);
    opacity: 0.82;
    line-height: 1.45;
}

/* ==================== CHAPTERS GRID ==================== */
.chapter-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 36px var(--gutter);
}

.chapter-card {
    border-left: 1px solid var(--c-gold);
    border-right: 1px solid var(--c-gold);
    padding: 36px 28px;
    background: linear-gradient(180deg, rgba(212,175,55,0.025), transparent 70%);
    position: relative;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), background 0.5s ease;
    opacity: 0;
    transform: translateY(20px);
}
.chapter-card.is-visible { opacity: 1; transform: translateY(0); }
.chapter-card:hover {
    background: linear-gradient(180deg, rgba(212,175,55,0.06), rgba(45,80,22,0.04));
    transform: translateY(-4px);
}
.chapter-card::before,
.chapter-card::after {
    content: "";
    position: absolute;
    width: 8px;
    height: 8px;
    border: 1px solid var(--c-gold);
}
.chapter-card::before { top: -1px; left: -4px; border-right: none; border-bottom: none; }
.chapter-card::after { bottom: -1px; right: -4px; border-left: none; border-top: none; }

.card-glyph {
    width: 48px;
    height: 48px;
    margin-bottom: 18px;
    color: var(--c-gold);
}
.card-glyph svg { width: 100%; height: 100%; transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.chapter-card:hover .card-glyph svg { transform: rotate(15deg); }

.card-roman {
    font-family: var(--f-display);
    font-style: italic;
    color: var(--c-bronze);
    font-size: 18px;
    margin-bottom: 8px;
    letter-spacing: 0.1em;
}

.card-title {
    font-family: var(--f-heading);
    font-size: 22px;
    letter-spacing: 0.04em;
    color: var(--c-cream);
    margin-bottom: 16px;
    line-height: 1.2;
}

.card-body {
    color: var(--c-cream);
    opacity: 0.78;
    margin-bottom: 18px;
    font-size: 15px;
    line-height: 1.65;
}

.card-meta {
    font-family: var(--f-heading);
    font-size: 11px;
    letter-spacing: 0.2em;
    color: var(--c-gold);
    text-transform: uppercase;
    opacity: 0.85;
}

/* ==================== ARCHIVE ==================== */
.archive-list {
    list-style: none;
    counter-reset: archive;
}

.archive-item {
    display: grid;
    grid-template-columns: 100px 1fr 160px;
    gap: 24px;
    padding: 28px 0;
    border-bottom: 1px solid rgba(212,175,55,0.18);
    align-items: baseline;
    opacity: 0;
    transform: translateY(16px);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), background 0.4s ease;
}
.archive-item.is-visible { opacity: 1; transform: translateY(0); }
.archive-item:hover {
    background: linear-gradient(90deg, rgba(212,175,55,0.04), transparent);
}
.archive-item:last-child { border-bottom: none; }

.archive-num {
    font-family: var(--f-display);
    font-style: italic;
    font-size: 22px;
    color: var(--c-bronze);
    letter-spacing: 0.05em;
}

.archive-body h3.archive-title {
    font-family: var(--f-heading);
    font-size: 20px;
    color: var(--c-cream);
    letter-spacing: 0.03em;
    margin-bottom: 10px;
    line-height: 1.2;
    transition: color 0.3s ease;
}
.archive-item:hover .archive-title { color: var(--c-gold); }

.archive-body p {
    color: var(--c-cream);
    opacity: 0.78;
    font-size: 14px;
    line-height: 1.65;
    max-width: 680px;
}

.archive-meta {
    font-family: var(--f-heading);
    font-size: 10px;
    letter-spacing: 0.22em;
    color: var(--c-gold);
    text-transform: uppercase;
    opacity: 0.8;
    text-align: right;
}

/* ==================== GUILD QUOTE ==================== */
.guild-quote {
    border-left: 1px solid var(--c-gold);
    border-right: 1px solid var(--c-gold);
    padding: 60px 40px;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(212,175,55,0.05), transparent 60%),
        radial-gradient(ellipse at 50% 100%, rgba(45,80,22,0.04), transparent 60%);
}
.guild-quote::before, .guild-quote::after {
    content: "";
    position: absolute;
    width: 36px;
    height: 1px;
    background: var(--c-gold);
}
.guild-quote::before { top: 12px; left: 50%; transform: translateX(-50%); }
.guild-quote::after { bottom: 12px; left: 50%; transform: translateX(-50%); }

.quote-body {
    text-align: center;
    margin-bottom: 36px;
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.quote-body.is-fading { opacity: 0; transform: translateY(8px); }

.quote-text {
    font-family: var(--f-display);
    font-style: italic;
    font-size: clamp(20px, 2.4vw, 26px);
    line-height: 1.5;
    color: var(--c-cream);
    margin-bottom: 24px;
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

.quote-attr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.quote-name {
    font-family: var(--f-heading);
    font-size: 14px;
    color: var(--c-gold);
    letter-spacing: 0.1em;
}
.quote-role {
    font-family: var(--f-display);
    font-style: italic;
    font-size: 13px;
    color: var(--c-bronze);
}

.quote-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
}

.quote-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--c-gold);
    color: var(--c-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, transform 0.3s ease;
}
.quote-btn:hover {
    background: rgba(212,175,55,0.1);
    transform: scale(1.05);
}

.quote-index {
    font-family: var(--f-heading);
    font-size: 12px;
    letter-spacing: 0.2em;
    color: var(--c-gold);
}

/* ==================== INVITATION FORM ==================== */
.invite-form {
    max-width: 720px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.field-wide { grid-column: 1 / -1; }

.field-label {
    font-family: var(--f-heading);
    font-size: 11px;
    letter-spacing: 0.22em;
    color: var(--c-gold);
    text-transform: uppercase;
}

.field input,
.field textarea {
    background: transparent;
    border: 1px solid rgba(212,175,55,0.4);
    color: var(--c-cream);
    font-family: var(--f-display);
    font-size: 16px;
    padding: 14px 16px;
    transition: border-color 0.3s ease, background 0.3s ease;
}
.field input::placeholder,
.field textarea::placeholder {
    color: rgba(245,240,232,0.42);
    font-style: italic;
}
.field input:hover,
.field textarea:hover {
    border-color: var(--c-gold);
    background: rgba(212,175,55,0.03);
}
.field textarea {
    resize: vertical;
    min-height: 96px;
    line-height: 1.5;
}

.cta-submit {
    grid-column: 1 / -1;
    justify-self: center;
    margin-top: 12px;
    opacity: 1;
    transform: none;
    animation: none;
}

.form-status {
    grid-column: 1 / -1;
    text-align: center;
    font-family: var(--f-display);
    font-style: italic;
    font-size: 14px;
    color: var(--c-bronze);
    min-height: 20px;
}
.form-status.is-success { color: var(--c-gold); }
.form-status.is-error { color: #C4663B; }

/* ==================== FOOTER ==================== */
.page-footer {
    padding: 72px 24px 48px;
    text-align: center;
    border-top: 1px solid rgba(212,175,55,0.3);
    background: linear-gradient(180deg, transparent, rgba(212,175,55,0.04));
    margin-top: 40px;
}

.footer-ornament {
    width: min(480px, 90vw);
    height: 64px;
    margin: 0 auto 36px;
    color: var(--c-gold);
}

.footer-vine path {
    stroke-dasharray: 360;
    stroke-dashoffset: 360;
    transition: stroke-dashoffset 1.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.page-footer.is-visible .footer-vine path {
    stroke-dashoffset: 0;
}

.footer-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.footer-mark {
    font-family: var(--f-heading);
    font-size: 22px;
    letter-spacing: 0.15em;
    color: var(--c-cream);
    text-transform: uppercase;
}
.footer-mark .dot { color: var(--c-gold); }

.footer-line {
    font-family: var(--f-display);
    font-style: italic;
    font-size: 14px;
    color: var(--c-cream);
    opacity: 0.7;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 24px;
    justify-content: center;
    margin-top: 8px;
}
.footer-links a {
    font-family: var(--f-heading);
    font-size: 11px;
    letter-spacing: 0.22em;
    color: var(--c-gold);
    text-transform: uppercase;
    opacity: 0.78;
    transition: opacity 0.3s ease;
}
.footer-links a:hover { opacity: 1; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 880px) {
    .hero-nav {
        flex-direction: row;
        bottom: 24px;
        right: 50%;
        transform: translateX(50%);
        gap: 18px;
    }
    .hero-corner { width: 24px; height: 24px; }
    .hero-corner-tl, .hero-corner-tr { top: 16px; }
    .hero-corner-bl, .hero-corner-br { bottom: 70px; }
    .hero-corner-tl, .hero-corner-bl { left: 16px; }
    .hero-corner-tr, .hero-corner-br { right: 16px; }
    .hero-scroll { display: none; }

    .chapter-grid { grid-template-columns: 1fr; gap: 28px; }

    .archive-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .archive-meta { text-align: left; }

    .invite-form { grid-template-columns: 1fr; }

    .guild-quote { padding: 36px 24px; }
}

@media (max-width: 520px) {
    .chapters, .archive, .guild, .contact {
        padding: 64px 16px;
    }
    .chapters::before, .chapters::after,
    .archive::before, .archive::after,
    .guild::before, .guild::after,
    .contact::before, .contact::after { display: none; }
    .hero-caption { padding: 0 16px; }
    .hero-figure { width: 88vw; }
}
