/* diplomacy.quest - Isometric Strategy Quest */
/* Palette: #1e293b, #334155, #64748b, #eab308, #3b82f6, #22c55e, #f1f5f9 */

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

html {
    scroll-behavior: smooth;
}

body {
    background: #1e293b;
    color: #f1f5f9;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.65;
    overflow-x: hidden;
}

/* Labels */
.label {
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    color: #eab308;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    display: inline-block;
}

/* ==============================
   BRIEFING HERO
   ============================== */
.briefing {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.iso-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(59,130,246,0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59,130,246,0.08) 1px, transparent 1px);
    background-size: 60px 60px;
    transform: perspective(800px) rotateX(45deg) scale(2.5);
    transform-origin: center center;
    opacity: 0;
    animation: grid-materialize 2s ease-out 0.5s forwards;
}

@keyframes grid-materialize {
    0% {
        opacity: 0;
        background-size: 120px 120px;
    }
    100% {
        opacity: 0.5;
        background-size: 60px 60px;
    }
}

.briefing-content {
    position: relative;
    text-align: center;
    padding: 2rem;
    opacity: 0;
    animation: briefing-appear 1.2s ease-out 0.8s forwards;
}

@keyframes briefing-appear {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.brand-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 0.75rem 0 0.5rem;
}

.shield-icon {
    width: 36px;
    height: 42px;
    flex-shrink: 0;
    opacity: 0;
    animation: shield-appear 0.8s ease-out 1.5s forwards;
}

@keyframes shield-appear {
    0% {
        opacity: 0;
        transform: scale(0.5) rotateZ(-15deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotateZ(0deg);
    }
}

.brand {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 7vw, 5rem);
    color: #f1f5f9;
    letter-spacing: -0.02em;
}

.tagline {
    font-size: 1rem;
    color: #64748b;
    margin-bottom: 2rem;
}

/* Status Bar */
.status-bar {
    display: flex;
    gap: 4px;
    max-width: 300px;
    margin: 0 auto 0.75rem;
    height: 6px;
}

.status-bar.large {
    max-width: 400px;
    height: 10px;
    margin-top: 2rem;
}

.status-segment {
    flex: 1;
    border-radius: 3px;
    background: #334155;
    transition: background 0.6s ease;
}

.status-segment.completed {
    background: #22c55e;
}

.status-segment.active {
    background: #3b82f6;
    animation: pulse-segment 2s ease-in-out infinite;
}

.status-segment.pending {
    background: #334155;
}

@keyframes pulse-segment {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.status-label {
    font-family: 'Fira Code', monospace;
    font-size: 0.65rem;
    color: #64748b;
    letter-spacing: 0.1em;
}

/* Scroll Hint */
.scroll-hint {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    animation: hint-fade 1s ease-out 2.5s forwards;
}

@keyframes hint-fade {
    to { opacity: 0.6; }
}

.scroll-hint-text {
    font-family: 'Fira Code', monospace;
    font-size: 0.55rem;
    color: #64748b;
    letter-spacing: 0.2em;
}

.scroll-arrow {
    width: 12px;
    height: 12px;
    border-right: 2px solid #64748b;
    border-bottom: 2px solid #64748b;
    transform: rotateZ(45deg);
    animation: arrow-bounce 2s ease-in-out infinite;
}

@keyframes arrow-bounce {
    0%, 100% { transform: rotateZ(45deg) translateY(0); }
    50% { transform: rotateZ(45deg) translateY(6px); }
}

/* ==============================
   MISSIONS SECTION
   ============================== */
.missions {
    padding: 6rem 1.5rem 4rem;
}

.section-label-wrap {
    text-align: center;
    margin-bottom: 3rem;
}

.quest-path {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.path-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 0;
    border-left: 2px dashed #64748b;
    transform: translateX(-1px);
    opacity: 0.4;
}

.path-line.drawn {
    animation: draw-path 1.5s ease-out forwards;
}

@keyframes draw-path {
    0% { clip-path: inset(0 0 100% 0); }
    100% { clip-path: inset(0 0 0% 0); }
}

/* Mission Cards */
.mission-card {
    background: #334155;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 3rem;
    position: relative;
    border: 1px solid rgba(241,245,249,0.06);
    overflow: hidden;
    cursor: default;
}

.card-glow {
    position: absolute;
    inset: 0;
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.mission-card:hover .card-glow {
    opacity: 1;
}

.mission-card[data-status="completed"] .card-glow {
    box-shadow: inset 0 0 30px rgba(34,197,94,0.06);
}

.mission-card[data-status="active"] .card-glow {
    box-shadow: inset 0 0 30px rgba(59,130,246,0.1);
}

/* Isometric Tilt - matching design spec exactly */
.iso-tilt {
    transform: perspective(800px) rotateY(-5deg) rotateX(5deg);
    transition: transform 0.3s ease;
}

.iso-tilt:hover {
    transform: perspective(800px) rotateY(0deg) rotateX(0deg);
}

.active-card {
    border-color: #3b82f6;
    box-shadow: 0 0 24px rgba(59,130,246,0.15), 0 0 60px rgba(59,130,246,0.05);
}

.locked {
    opacity: 0.45;
    pointer-events: none;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.scenario-id {
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    color: #64748b;
    letter-spacing: 0.1em;
    transition: color 0.3s ease;
}

.mission-card:hover .scenario-id {
    color: #eab308;
}

.badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.mission-card:hover .badge {
    transform: scale(1.15);
}

.completed-badge {
    background: #22c55e;
    color: #1e293b;
}

.active-badge {
    background: #3b82f6;
    color: #f1f5f9;
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% { box-shadow: 0 0 0 0 rgba(59,130,246,0.4); }
    50% { box-shadow: 0 0 0 8px rgba(59,130,246,0); }
}

.pending-badge {
    background: #334155;
    border: 1px solid #64748b;
    color: #64748b;
    font-size: 0.4rem;
}

.card-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    color: #f1f5f9;
    margin-bottom: 0.5rem;
}

.card-desc {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.card-stats {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.stat-label {
    font-family: 'Fira Code', monospace;
    font-size: 0.6rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.stat-value {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    color: #eab308;
}

/* ==============================
   SUMMIT SECTION
   ============================== */
.summit {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 1.5rem;
    background: #334155;
    position: relative;
}

.summit::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #3b82f6, transparent);
    opacity: 0.3;
}

.summit-inner {
    max-width: 600px;
    text-align: center;
}

.summit-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    color: #f1f5f9;
    margin: 1rem 0;
}

.summit-desc {
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.7;
}

.summit-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2.5rem;
}

.summit-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.summit-stat-number {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 2rem;
    color: #eab308;
}

.summit-stat-label {
    font-family: 'Fira Code', monospace;
    font-size: 0.6rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ==============================
   DEBRIEF SECTION
   ============================== */
.debrief {
    padding: 6rem 1.5rem;
    text-align: center;
}

.debrief-inner {
    max-width: 650px;
    margin: 0 auto;
}

.debrief-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: #f1f5f9;
    margin: 0.75rem 0 2.5rem;
}

.achievements {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}

.achievement {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.3s ease;
}

.achievement:hover {
    transform: translateY(-4px);
}

.achievement-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.achievement:hover .achievement-icon {
    transform: scale(1.1);
}

.achievement-icon.gold {
    background: #eab308;
    color: #1e293b;
    box-shadow: 0 0 16px rgba(234,179,8,0.2);
}

.achievement:hover .achievement-icon.gold {
    box-shadow: 0 0 24px rgba(234,179,8,0.4);
}

.achievement-icon.dim {
    background: #334155;
    color: #64748b;
    border: 1px solid #64748b;
}

.achievement-name {
    font-family: 'Fira Code', monospace;
    font-size: 0.65rem;
    color: #64748b;
    letter-spacing: 0.05em;
}

.achievement-status {
    font-family: 'Fira Code', monospace;
    font-size: 0.55rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.achievement-icon.gold + .achievement-name + .achievement-status {
    color: #22c55e;
}

.achievement-icon.dim + .achievement-name + .achievement-status {
    color: #64748b;
}

.closing-bar {
    width: 60px;
    height: 2px;
    background: #64748b;
    margin: 0 auto 1.5rem;
    opacity: 0.4;
}

.closing-text {
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0;
}

/* ==============================
   FADE IN ANIMATIONS
   ============================== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in.visible.iso-tilt {
    transform: perspective(800px) rotateY(-5deg) rotateX(5deg);
}

.fade-in.visible.iso-tilt:hover {
    transform: perspective(800px) rotateY(0deg) rotateX(0deg);
}

/* Staggered card appearance */
.mission-card:nth-child(2) { transition-delay: 0s; }
.mission-card:nth-child(3) { transition-delay: 0.1s; }
.mission-card:nth-child(4) { transition-delay: 0.2s; }
.mission-card:nth-child(5) { transition-delay: 0.3s; }
.mission-card:nth-child(6) { transition-delay: 0.4s; }

/* ==============================
   RESPONSIVE
   ============================== */
@media (max-width: 600px) {
    .card-stats {
        gap: 1rem;
    }
    .achievements {
        gap: 1rem;
    }
    .mission-card {
        margin-bottom: 2rem;
    }
    .summit-stats {
        gap: 1.5rem;
    }
    .summit-stat-number {
        font-size: 1.5rem;
    }
    .shield-icon {
        width: 28px;
        height: 33px;
    }
    .brand-row {
        gap: 0.5rem;
    }
}
