/* ============================================
   npc.quest - Bauhaus Tavern Quest Portfolio
   ============================================ */

/* ---- Reset & Base ---- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --burgundy-deep: #3A1020;
    --bauhaus-yellow: #E8C840;
    --bauhaus-blue: #2858A0;
    --tavern-cream: #F0E8D0;
    --ember-orange: #D87838;
    --timber-dark: #1A0810;
    --parchment: #E8DCC0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--burgundy-deep);
    color: var(--tavern-cream);
    font-family: 'Merriweather', Georgia, serif;
    font-weight: 400;
    font-size: clamp(14px, 0.9vw, 15px);
    line-height: 1.75;
    overflow-x: hidden;
    position: relative;
}

/* ---- Parallax Tavern Atmosphere ---- */
.tavern-atmosphere {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.fireplace-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120vmax;
    height: 120vmax;
    transform: translate(-50%, -50%) scale(0);
    border-radius: 50%;
    background: radial-gradient(
        ellipse at center,
        rgba(216, 120, 56, 0.08) 0%,
        rgba(216, 120, 56, 0.04) 30%,
        rgba(58, 16, 32, 0) 70%
    );
    opacity: 0;
    transition: none;
}

.fireplace-glow.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    transition: transform 1000ms ease-out, opacity 600ms ease-out;
}

.timber-beams {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.beam {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(26, 8, 16, 0.3) 20%,
        rgba(26, 8, 16, 0.5) 50%,
        rgba(26, 8, 16, 0.3) 80%,
        transparent 100%
    );
    opacity: 0.4;
}

.beam-1 { top: 15%; }
.beam-2 { top: 30%; }
.beam-3 { top: 50%; }
.beam-4 { top: 70%; }
.beam-5 { top: 88%; }

/* ---- Ember Particles ---- */
.ember-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.ember {
    position: absolute;
    bottom: -10px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: var(--ember-orange);
    opacity: 0;
    animation: emberRise linear infinite;
}

@keyframes emberRise {
    0% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 0.5;
    }
    50% {
        opacity: 0.4;
    }
    90% {
        opacity: 0.1;
    }
    100% {
        transform: translateY(-110vh) translateX(30px) scale(0.3);
        opacity: 0;
    }
}

/* Varied ember sizes */
.ember:nth-child(odd) {
    width: 4px;
    height: 4px;
}
.ember:nth-child(3n) {
    width: 6px;
    height: 6px;
}
.ember:nth-child(5n) {
    width: 8px;
    height: 8px;
    opacity: 0.6;
}
.ember:nth-child(7n) {
    width: 3px;
    height: 3px;
}

/* ---- Tavern Entrance (Hero) ---- */
.tavern-entrance {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    z-index: 2;
    padding: 40px 20px;
}

.hero-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.bauhaus-ornament {
    position: relative;
    width: clamp(250px, 40vw, 400px);
    height: clamp(250px, 40vw, 400px);
    margin-bottom: -60px;
    opacity: 0;
    transition: opacity 800ms ease-out;
}

.bauhaus-ornament.visible {
    opacity: 1;
}

.bauhaus-svg {
    width: 100%;
    height: 100%;
}

.bauhaus-draw {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    transition: stroke-dashoffset 2000ms ease-out;
}

.bauhaus-draw.drawn {
    stroke-dashoffset: 0;
}

.site-title {
    font-family: 'Bebas Neue', 'Arial Narrow', sans-serif;
    font-weight: 400;
    font-size: clamp(60px, 12vw, 140px);
    letter-spacing: 0.06em;
    color: var(--tavern-cream);
    text-transform: uppercase;
    position: relative;
    z-index: 3;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1000ms ease-out 400ms, transform 1000ms ease-out 400ms;
}

.site-title.visible {
    opacity: 1;
    transform: translateY(0);
}

.site-subtitle {
    font-family: 'Merriweather', Georgia, serif;
    font-weight: 400;
    font-style: italic;
    font-size: 12px;
    color: var(--parchment);
    opacity: 0;
    letter-spacing: 0.1em;
    margin-top: 8px;
    transition: opacity 1200ms ease-out 800ms;
}

.site-subtitle.visible {
    opacity: 0.7;
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    animation: scrollBounce 2s ease-in-out infinite;
    animation-delay: 2s;
    transition: opacity 1500ms ease-out 1500ms;
}

.scroll-indicator.visible {
    opacity: 0.6;
}

@keyframes scrollBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(8px); }
}

/* ---- Section Titles ---- */
.section-title {
    font-family: 'Bebas Neue', 'Arial Narrow', sans-serif;
    font-weight: 400;
    font-size: clamp(24px, 3vw, 48px);
    letter-spacing: 0.04em;
    color: var(--tavern-cream);
    text-align: center;
    margin-bottom: 8px;
}

.bauhaus-section-ornament {
    display: flex;
    justify-content: center;
    margin-bottom: 48px;
}

.section-ornament-svg {
    width: 200px;
    height: 20px;
    opacity: 0.6;
}

/* ---- Quest Portfolio ---- */
.quest-portfolio {
    position: relative;
    z-index: 2;
    padding: 80px 40px 120px;
    max-width: 1200px;
    margin: 0 auto;
}

.quest-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    grid-auto-flow: dense;
}

/* ---- Quest Cards ---- */
.quest-card {
    background-color: var(--parchment);
    color: var(--timber-dark);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 600ms ease-out, transform 600ms ease-out, box-shadow 300ms ease;
}

.quest-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.quest-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(216, 120, 56, 0.25), 0 2px 8px rgba(216, 120, 56, 0.15);
}

.quest-card.visible:hover {
    transform: translateY(-4px);
}

.quest-card--tall {
    grid-row: span 2;
}

.quest-card--wide {
    grid-column: span 2;
}

/* Card Illustration */
.card-illustration {
    position: relative;
    overflow: hidden;
}

.illustration-placeholder {
    filter: grayscale(0.7) sepia(0.3) contrast(1.1);
    transition: filter 400ms ease;
}

.quest-card:hover .illustration-placeholder {
    filter: grayscale(0.4) sepia(0.2) contrast(1.2);
}

.quest-illustration-svg {
    display: block;
    width: 100%;
    height: auto;
}

/* Card Content */
.card-content {
    padding: 32px 48px 48px;
}

.quest-card--tall .card-content {
    padding: 24px 36px 36px;
}

.npc-name {
    font-family: 'Bebas Neue', 'Arial Narrow', sans-serif;
    font-size: 18px;
    letter-spacing: 0.04em;
    color: var(--bauhaus-yellow);
    display: block;
    margin-bottom: 4px;
    transition: text-shadow 300ms ease;
}

.quest-card:hover .npc-name {
    text-shadow: 0 0 12px rgba(232, 200, 64, 0.5);
}

.quest-title {
    font-family: 'Bebas Neue', 'Arial Narrow', sans-serif;
    font-weight: 400;
    font-size: clamp(24px, 3vw, 48px);
    letter-spacing: 0.04em;
    line-height: 1.1;
    color: var(--timber-dark);
    margin-bottom: 12px;
}

.quest-description {
    font-family: 'Merriweather', Georgia, serif;
    font-weight: 400;
    font-size: clamp(14px, 0.9vw, 15px);
    line-height: 1.75;
    color: var(--burgundy-deep);
    margin-bottom: 20px;
}

/* Quest Meta */
.quest-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.difficulty-gauge {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.difficulty-label {
    font-family: 'Merriweather', Georgia, serif;
    font-weight: 400;
    font-style: italic;
    font-size: 8px;
    color: var(--timber-dark);
    position: absolute;
    bottom: -14px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    opacity: 0.6;
}

.quest-type {
    font-family: 'Merriweather', Georgia, serif;
    font-weight: 400;
    font-style: italic;
    font-size: 12px;
    color: var(--burgundy-deep);
    opacity: 0.7;
}

/* Card Bauhaus Accent */
.card-bauhaus-accent {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    opacity: 0.5;
    transition: transform 300ms ease, opacity 300ms ease;
}

.quest-card:hover .card-bauhaus-accent {
    transform: rotate(5deg);
    opacity: 0.8;
}

/* ---- Quest Log (Footer) ---- */
.quest-log {
    position: relative;
    z-index: 2;
    padding: 80px 40px 60px;
    max-width: 1000px;
    margin: 0 auto;
    border-top: 1px solid rgba(232, 200, 64, 0.15);
}

.quest-chains {
    display: flex;
    flex-direction: column;
    gap: 36px;
    margin-bottom: 60px;
}

.quest-chain {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 500ms ease-out, transform 500ms ease-out;
}

.quest-chain.visible {
    opacity: 1;
    transform: translateY(0);
}

.chain-npc {
    font-family: 'Bebas Neue', 'Arial Narrow', sans-serif;
    font-size: 18px;
    letter-spacing: 0.04em;
    color: var(--bauhaus-yellow);
    margin-bottom: 12px;
}

.chain-quests {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
}

.chain-node {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    position: relative;
}

.chain-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--bauhaus-blue);
    flex-shrink: 0;
    transition: background-color 300ms ease;
}

.chain-node--complete .chain-dot {
    background-color: var(--bauhaus-yellow);
    border-color: var(--bauhaus-yellow);
}

.chain-quest-name {
    font-family: 'Merriweather', Georgia, serif;
    font-weight: 400;
    font-size: 12px;
    color: var(--parchment);
    opacity: 0.7;
}

.chain-node--complete .chain-quest-name {
    opacity: 1;
}

.chain-connector {
    width: 24px;
    height: 2px;
    background: linear-gradient(90deg, var(--bauhaus-blue), var(--ember-orange));
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 400ms ease-out, opacity 400ms ease-out;
}

.chain-connector.drawn {
    opacity: 0.5;
    transform: scaleX(1);
}

/* Footer Bauhaus */
.footer-bauhaus {
    text-align: center;
    padding-top: 40px;
    border-top: 1px solid rgba(232, 200, 64, 0.1);
}

.footer-ornament-svg {
    width: min(600px, 90%);
    height: 60px;
    opacity: 0.4;
    margin-bottom: 20px;
}

.footer-text {
    font-family: 'Merriweather', Georgia, serif;
    font-weight: 400;
    font-style: italic;
    font-size: 12px;
    color: var(--parchment);
    opacity: 0.5;
    letter-spacing: 0.05em;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .quest-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .quest-portfolio {
        padding: 60px 24px 80px;
    }
}

@media (max-width: 680px) {
    .quest-grid {
        grid-template-columns: 1fr;
    }
    .quest-card--wide {
        grid-column: span 1;
    }
    .quest-card--tall {
        grid-row: span 1;
    }
    .card-content {
        padding: 24px 24px 32px;
    }
    .quest-portfolio {
        padding: 40px 16px 60px;
    }
    .quest-log {
        padding: 60px 16px 40px;
    }
    .chain-quests {
        flex-direction: column;
        align-items: flex-start;
    }
    .chain-connector {
        width: 2px;
        height: 16px;
        margin-left: 16px;
        background: linear-gradient(180deg, var(--bauhaus-blue), var(--ember-orange));
    }
    .bauhaus-ornament {
        width: 220px;
        height: 220px;
    }
}
