@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Crimson+Text:ital,wght@0,400;0,600;1,400&display=swap');

:root {
    --stark-color: #7a8b99;
    --lannister-color: #c9a961;
    --targaryen-color: #8b0000;
    --baratheon-color: #f4c430;
    --tyrell-color: #3a7c3a;
    --greyjoy-color: #4a6f7c;
    --martell-color: #d4721e;
    --arryn-color: #5b7fa8;
    
    --parchment: #f4e8d0;
    --dark-parchment: #e5d7b8;
    --ink: #2c1810;
    --border-color: #8b6f47;
}

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

body {
    font-family: 'Crimson Text', serif;
    background: linear-gradient(135deg, #2c1810 0%, #4a3728 100%);
    color: var(--ink);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.parchment-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0,0,0,.03) 2px,
            rgba(0,0,0,.03) 4px
        ),
        var(--parchment);
    z-index: -1;
    opacity: 0.95;
}

.main-header {
    text-align: center;
    padding: 3rem 2rem 2rem;
    background: linear-gradient(180deg, rgba(44,24,16,0.2) 0%, transparent 100%);
    border-bottom: 3px double var(--border-color);
    margin-bottom: 2rem;
}

.main-header h1 {
    font-family: 'Cinzel', serif;
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--ink);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
}

.tagline {
    font-size: 1.3rem;
    font-style: italic;
    color: #5a4a3a;
    letter-spacing: 1px;
}

.house-selector {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    padding: 0 2rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.house-btn {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    padding: 0.8rem 1.5rem;
    background: var(--dark-parchment);
    border: 2px solid var(--border-color);
    color: var(--ink);
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}

.house-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.house-btn:hover::before {
    left: 100%;
}

.house-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    border-color: var(--ink);
}

.house-btn.active {
    background: var(--ink);
    color: var(--parchment);
    border-color: var(--border-color);
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.5);
}

.content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.house-section {
    display: none;
    animation: fadeIn 0.5s ease;
}

.house-section.active {
    display: block;
}

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

.house-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 3rem;
    padding: 2rem;
    background: var(--dark-parchment);
    border: 3px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.sigil {
    font-size: 5rem;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--border-color);
    border-radius: 50%;
    background: var(--parchment);
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.1);
}

.stark-sigil { background: linear-gradient(135deg, #a8b8c4 0%, var(--stark-color) 100%); }
.lannister-sigil { background: linear-gradient(135deg, #f4e4bc 0%, var(--lannister-color) 100%); }
.targaryen-sigil { background: linear-gradient(135deg, #b22222 0%, var(--targaryen-color) 100%); }
.baratheon-sigil { background: linear-gradient(135deg, #ffeb99 0%, var(--baratheon-color) 100%); }
.tyrell-sigil { background: linear-gradient(135deg, #5cb85c 0%, var(--tyrell-color) 100%); }
.greyjoy-sigil { background: linear-gradient(135deg, #6fa3b8 0%, var(--greyjoy-color) 100%); }
.martell-sigil { background: linear-gradient(135deg, #ff9955 0%, var(--martell-color) 100%); }
.arryn-sigil { background: linear-gradient(135deg, #87b3d4 0%, var(--arryn-color) 100%); }

.house-info h2 {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--ink);
}

.words {
    font-size: 1.5rem;
    font-style: italic;
    font-weight: 600;
    color: #5a4a3a;
    margin-bottom: 0.3rem;
}

.region {
    font-size: 1.2rem;
    color: #6a5a4a;
}

.lineage-tree {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.generation {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    position: relative;
    padding: 1rem 0;
}

.generation::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 2px;
    background: repeating-linear-gradient(
        90deg,
        var(--border-color) 0px,
        var(--border-color) 10px,
        transparent 10px,
        transparent 20px
    );
}

.generation:first-child::before {
    display: none;
}

.member {
    flex: 1 1 300px;
    max-width: 350px;
    min-width: 280px;
    padding: 1.5rem;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    position: relative;
}

.member::before {
    content: '';
    position: absolute;
    top: -1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 1rem;
    background: var(--border-color);
}

.generation:first-child .member::before {
    display: none;
}

.member:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.25);
    border-color: var(--ink);
}

.member h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: var(--ink);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.member .title {
    font-size: 1rem;
    font-weight: 600;
    color: #5a4a3a;
    margin-bottom: 0.8rem;
    font-style: italic;
}

.member .desc {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #4a3a2a;
}

.member.founder {
    background: linear-gradient(135deg, #fff9e6 0%, #ffffff 100%);
    border: 3px solid var(--border-color);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

.member.founder h3 {
    color: #8b6f47;
}

.member.important {
    background: linear-gradient(135deg, #fffef7 0%, #f9f5e8 100%);
    border: 2px solid #a08040;
}

.member.important h3 {
    color: #8b6f47;
}

.member.alive {
    background: linear-gradient(135deg, #f0fff0 0%, #ffffff 100%);
    border-color: #3a7c3a;
}

.member.alive h3 {
    color: #2d5a2d;
}

.member.deceased {
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    opacity: 0.85;
}

.member.deceased h3 {
    color: #666;
}

.footer {
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
    border-top: 3px double var(--border-color);
    background: linear-gradient(0deg, rgba(44,24,16,0.2) 0%, transparent 100%);
    font-family: 'Cinzel', serif;
}

.footer p {
    color: var(--ink);
    margin: 0.3rem 0;
}

.footer .small {
    font-size: 0.9rem;
    color: #6a5a4a;
    font-family: 'Crimson Text', serif;
    font-style: italic;
}

/* Responsive design */
@media (max-width: 768px) {
    .main-header h1 {
        font-size: 2.5rem;
    }
    
    .tagline {
        font-size: 1.1rem;
    }
    
    .house-selector {
        gap: 0.5rem;
    }
    
    .house-btn {
        font-size: 0.9rem;
        padding: 0.6rem 1rem;
    }
    
    .house-header {
        flex-direction: column;
        text-align: center;
    }
    
    .house-info h2 {
        font-size: 2rem;
    }
    
    .words {
        font-size: 1.2rem;
    }
    
    .member {
        flex: 1 1 100%;
    }
}

@media (max-width: 480px) {
    .main-header h1 {
        font-size: 2rem;
    }
    
    .content {
        padding: 1rem;
    }
    
    .house-header {
        padding: 1rem;
    }
    
    .sigil {
        font-size: 3rem;
        width: 80px;
        height: 80px;
    }
}
