/*========================
ASOIAF ATLAS
=========================*/

/*-----CSS VARIABLES-----*/
:root {
    --gold: #c9a84c;
    --gold-light: #e8c97a;
    --gold-dim: #8a6e2f;
    --ink: #0d0d14;
    --parchment: #f0e6cc;
    --blood: #7a1e1e;
    --ice: #b8d4e8;
    --dark-panel: rgba(10, 10, 10, 0.96);
    --border: rgba(201, 168, 76, 0.3);
    --font-display: 'Cinzel Decorative', serif;
    --font-heading: 'Cinzel Decorative', serif;
    --font-body: 'Cinzel Decorative', serif;
    --panel-width: 50vw;
    --transition: 0.45s cubic-bezier(0.77, 0, 0.175, 1);    
}

/*-----RESET AND BASE-----*/
*,*::before,*::after {
    box-sizing: border-box; margin: 0; padding: 0;}
    html{ scroll-behavior: smooth; font-size:16px;}

    body{
        background: var(--ink);
        color: var(--parchment);
        font-family: var(--font-body);
        overflow-x: hidden;
        cursor: default;

    }

    a{ color:inherit; text-decoration: none;}
    img{ display:block; max-width: 100%;}
    button {cursor: pointer; background: none; border: none; font-family: inherit;}

/*-----HERO-------*/
.hero {
    position: relative;
    height: 100vh;
    background: url('https://images.unsplash.com/photo-1506744038136-46273834b3fb?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8Mnx8d2VzdGVyb3N8ZW58MHx8MHx8fDA%3D&auto=format&fit=crop&w=800&q=60') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: radial-gradient(ellipse at 50% 60%,#1a1228 0%, #0a0a14 60%,#050508 100%);   
} 
.hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/*starfield effect*/
.hero-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
       radial-gradient(1px 1px at 20% 30%, rgba(201,168,76,0.4) 0%, transparent 100%),
       radial-gradient(1px 1px at 80% 20%, rgba(255,255,255,0.3) 0%, transparent 100%),
       radial-gradient(1px 1px at 60% 70%, rgba(255,255,255,0.2) 0%, transparent 100%),
       radial-gradient(1px 1px at 10% 80%, rgba(201,168,76,0.3) 0%, transparent 100%),
       radial-gradient(1px 1px at 90% 60%, rgba(255,255,255,0.2) 0%, transparent 100%),
       radial-gradient(1px 1px at 40% 10%, rgba(255,255,255,0.3) 0%, transparent 100%),
       radial-gradient(1px 1px at 70% 90%, rgba(201,168,76,0.2) 0%, transparent 100%),
       radial-gradient(1px 1px at 50% 50%, rgba(255,255,255,0.1) 0%, transparent 100%);
    animation: twinkle 6s ease-in-out infinite alternate;  
}  
@keyframes twinkle {
    0% {opacity: 0.6;}
    100% {opacity: 1;}
} 
/*top border glow*/
.hero-bg::after{
    content:'';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);  
}


/* SVG RAVENS*/
.ravens-svg {
    position: absolute;
    top: 0%;
    left: 0%;
    width: 100%;
    height: 100%;
    opacity: 0.6;
    z-index: 1;
    
}

.ravens-1, ravens-2, .ravens-3 {
    transform-box: fill-box;
    transform-origin: center;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
    max-width: 800px;
}

.hero-eyebrow {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeUp 1s ease forwards 0.3s;
}

.hero-title{
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
}

.title-line{
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 7rem);
    font-weight: 700;
    color: var(--gold-light);
    line-height: 1;
    text-shadow: 0 0 60px rgba(201, 168, 76, 0.3), 0 2px 4px rgba(0,0,0,0.8);
    opacity: 0;
    animation: fadeUp 1s ease forwards 0.5s;
}

.title-sub{
    font-family: var(--font-heading);
    font-size: clamp(1rem, 2.5vw, 1.8rem);
    font-weight: 400;
    color: var(--parchment);
    letter-spacing: 0.15em;
    opacity: 0;
    animation: fadeUp 1s ease forwards 0.7s;
}

.hero-desc{
    font-size:1.15rem;
    line-height: 1.8;
    color: rgba(240,230,204,0.7);
    max-width: 560px;
    margin: 0 auto 2.5rem;
    opacity: 0;
    animation:fadeUp 1s ease forwards 0.9s;
}

.hero-cta{
    display:inline-flex;
    align-items:center;
    gap: 0.6rem;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    letter-spacing: 0.2rem;
    text-transform: uppercase;
    color: var(--ink);
    background: var(--gold);
    padding: 0.85rem 2rem;
    border: 1px solid var(--gold-light);
    transition: all 0.3s ease;
    opacity: 0;
    animation: fadeUp 1s ease forwards 1.1s;
}

.hero-cta:hover{
    background: var(--gold-light);
    border-color: var(--gold-dim);
    color: var(--parchment);
    transform: translateY(-2px);
}

.hero-cta svg { transition: transform 0.3s;}
.hero-cta:hover svg { transform: translateY(3px); }

/* scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}
.scroll-line {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, transparent, var(--gold), transparent);
    margin: 0 auto;
    animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.8); }
    50% { opacity:1; transform: scaleY(1)};
}

@keyframes fadeUp {
    from{ opacity:0 ; transform: translateY(30px);}
    to{ opacity:1; transform: translateY(0);}
}

/*-----MAP SECTIONA----*/
.map-section {
    padding: 6rem 2rem;
    background: linear-gradient(180deg, #0a0a14 0%, #0a0a18 100%);
}

.map-header {
    text-align: center;
    margin-bottom: 3rem;
}

.map-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3.5rem);
    color: var(--gold-light);
    margin-bottom: 0.75rem;
}

.mapsubtitle {
    font-family: var(--font-heading);
    font-size: clamp(1rem, 2.5vw, 1.8rem);
    color: rgba(240,230,204,0.75);
    letter-spacing: 0.1em;
}

.map-container {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
    border: 1px solid var(--border);
    box-shadow: 0 0 80px rgba(201,168,76,0.08), 0 0 0 1px rgba(201,168,76,0.05);
    transition: box-shadow 0.4s;
}
 .map-container:hover {
    box-shadow: 0 0 100px rgba(201,168,76,0.15), 0 0 0 1px rgba(201,168,76,0.1);
 }

.map-image {
    display: block;
    width: 100%;
    height: auto;
    filter: sepia(20%) brightness(0.9) contrast(1.05);
    transition: filter 0.4s ease;
}

/*----DARKENS MAO WHEN PANEL IS OPEN---*/
.map-overlay {
    position: absolute;
    inset: 0;
    background: rgba(5,5,15,0);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    z-index: 1;
}

.map-overlay.active {
    background: rgba(5,5,15,0.55);

}
/*----hotspots---*/
.hotspot {
    position: absolute;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: none;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
}

.hotspot-label {
    font-family: var(--font-family);
    font-size: 0.6rem;
    color: rgba(201,168,76,0.6);
    text-transform: uppercase;
    white-space: nowrap;
    transition: color 0.25s ease, font-weight 0.25s ease;
    text-shadow: 0 1px 3px rgba(0,0,0,0.9), 0 0 8px rgba(0,0,0,0.9);
    pointer-events: none;
    order: -1;  
}

.hotspot-dot {
    width: 10px;
    height: 10px;
    background: var(--gold);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(201,168,76,0.8), 0 0 0 2px rgba(201,168,76,0.4);
    transition: all 0.25s ease;
    position: relative;
}

/*----PLUSE RING------*/
.hotspot-dot::after {
    content: '';
    position: absolute;
    inset: -4px;
    background: rgba(201,168,76,0.4);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    animation: pulseRing 2.5s ease-out infinite;
}

@keyframes pulseRing {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.6;
    }
    100% {
        transform: translate(-50%, -50%) scale(2.2);
        opacity: 0;
    }
}

.hotspot:hover .hotspot-label {
    color: var(--gold-light);
    font-weight: 600;
}

.hotspot:hover .hotspot-dot {
    background:#fff;
    box-shadow: 0 0 20px rgba(255,255,255,0.6);
}

/*----wiki panel---*/
.wiki-panel {
    position: fixed;
    top: 0;
    right: -55vw;
    width: var(--panel-width);
    height: 100vh;
    background: var(--dark-panel);
    border-left: 1px solid var(--border);
    z-index: 100;
    transition: right var(--transition);
    overflow-y: auto;
    will-change: right;
    box-shadow: -20px 0 80px rgba(0,0,0,0.8);
}
.wiki-panel.open{
    right: 0;
}

.wiki-panel::-webkit-scrollbar {width:4px; }
.wiki-panel::-webkit-scrollbar-track { background: transparent;}
.wiki-panel::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 2px;}

.wiki-close{
    position: sticky;
    top: 1.5rem;
    right: 1.5rem;
    float: right;
    margin: 1.5rem 1.5rem 0 0;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    color: var(--gold);
    transition: all 0.2s;
    z-index: 10;
    background: rgba(10,10,20,0.8);
}

.wiki-close:hover {
    background: var(--gold);
    color: var(--ink);
    transform: rotate(90deg) scale(1.1);
}

.wiki-inner{
    padding: 2rem 2rem 4rem;
    clear: both;
}

/*----svg sigil----*/
.wiki-sigil {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wiki-sigil svg{
    animation: sigilReveal 0.8s ease forwards;
}

@keyframes sigilReveal {
    0% { transform: scale(0.5) rotate(0deg); opacity: 0;}
    100% { transform: scale(1) rotate(360deg); opacity: 1;}
}

.wiki-header{
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.wiki-region{
    font-family: var(--font-heading);
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.wiki-name{
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    color: var(--gold-light);
    margin-bottom: 0.75rem;
    line-height: 1.1;
}

.wiki-words{
    font-style: italic;
    font-size: 1rem;
    color: rgba(240,230,204,0.6);
}

/*----stats---*/
.wiki-stats{
    margin-bottom: 2rem;
}

.stat-row {
    display: felx;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.stat-label{
    font-family: var(--font-heading);
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(240,230,204,0.5);
    min-width: 120px;
}

.stat-row sl-progress-bar {
    flex: 1;
    --indicator-color: var(--gold);
    --track-color: rgba(201,168,76,0.1);
}

/*----SHOELACE TAB OVERRIDES*/

.wiki-tabs{
    --track-color: var(--border);
    --track-width: 1px;
}

sl-tab{
    font-family:var(--font-heading);
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

sl-tab[active]{
    color: var(--gold-light);
}
sl-tab-panel{
    --padding: 1.5rem 0 0;
}
.tab-content {
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(240,230,204,0.85);
}

.tab-content p { margin-bottom: 1rem;}

/*----character grid-----*/
.character-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.character-card {
    background: rgba(201,168,76,0.04);
    border: 1px solid var(--border);
    padding: 1rem;
    transition: border-color 0.2s;
}

.character-card:hover {
    border-color: var(--gold);
}
.character-name {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: var(--gold-light);
    margin-bottom: 0.25rem;
}
.character-title {
    font-size: 0.75rem;
    color: rgba(201,168,76,0.6);
    font-style: italic;
}

/*GALLERY GRID---*/
.gallery-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.gallery-item {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    border: 1px solid var(--border);
    cursor: pointer;
    background: rgba(201,168,76,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery-item:hover img { transform: scale(1.08);}

.gallery-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: rgba(201,168,76,0.3);
    font-family: var (--font-heading);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 1rem;
    text-align: center;
}
.gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(201,168,76,0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    background: rgba(201,168,76,0.1);
}

/*------LIGHTBOX------*/
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(5,5,15,0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 200;
}

.lightbox.open {
    opacity: 1;
    pointer-events: all;
}

.lightbox-close{
    position:absolute;
    top: 1.5rem;
    right: 1.5rem;
    color: var(--gold);
    transition: color 0.2s;
}
.lightbox-close:hover {
    color: var(--gold-light);
}
.lightbox-img {
    max-width: 85vw;
    max-height: 80vh;
    object-fit: contain;
    border: 1px solid var(--border);
    box-shadow: 0 0 80px rgba(201,168,76,0.2), 0 0 0 1px rgba(201,168,76,0.1);
}
.lightbox-caption {
    margin-top: 1rem;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    letter-spacing: 0.15rem;
    color: rgba(201,168,76,0.6);
    text-align: center;
    text-transform: uppercase;
}

/*-----HOUSES SECTION------*/
.houses-section {
    padding: 6rem 2rem;
    background: linear-gradient(180deg, #0a0a14 0%, #0a0a18 100%);
    border-top: 1px solid var(--border);
}

.houses-header{
    text-align: center;
    margin-bottom: 3.5rem;
}

.section-title{
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--gold-light);
    margin-bottom: 0.75rem;
}

.section-sub{
    color: rgba(240,230,204,0.5);
    font-size: 1rem;
}

.houses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1,5rem;
    max-width: 1100px;
    margin: 0 auto;
}

.house-card {
    background: rgba(201,168,76,0.03);
    border: 1px solid var(--border);
    padding:1.75rem 1.25rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.house-card::before{
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    inset: 0;
    background: radial-gradient(circle, rgba(201,168,76,0.5) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.house-card:hover::before {
    opacity: 1;
}

.house-card:hover {
    border-color: var(--gold);
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 20px rgba(201,168,76,0.08);
}

.house-sigil-mini{
    width: 50px;
    height: 50px;
    margin: 0 auto 1rem;
}

/*----FOOTER---*/
.site-footer{
    border-top: 1px solid var(--border);
    padding: 3rem 2rem;
    background: #070710;
}

.footer-inner{
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: rgba(201,168,76,0.5);
    font-size: 0.9rem;
}

.footer-brand{
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--gold);
}

.footer-copy{
    font-size: 0.85rem;
    color: rgba(240,230,204,0.3);
}

/*----RESPONSIVE---*/
@media (max-width:768px){
    :root{--panel-width: 100vw;}

    .wiki-panel { right: -105vw;}

    .hero-title .title-line { font-size: 3rem;}

    .map-section {padding: 3rem 1rem;}

    .hotspot-label { font-size: 0.5rem;}
    .hotspot-dot { width: 8px; height: 8px;}

    .characters-grid { grid-template-columns: 1fr;}
    .gallery-grid { grid-template-columns: 1fr;}

    .houses-grid { grid-template-columns: repeat(2, 1fr);gap: 1rem;}

    .wiki-inner { padding: 1.5rem 1.25rem 4rem;}

    .stat-label { min-width: 90px; font-size: 0.6rem;}
}

@media(max-width:480px){
    .houses-grid { grid-template-columns: 1fr;}
    .wiki-name {
        font-size: 1.2rem;
    }
}   