/* ============================================
   ZONE SOUVERAINE - Style Principal
   Célébration des Nations du Canada
   ============================================ */

/* Variables de couleurs sacrées */
:root {
    /* Couleurs de la roue médicinale */
    --sacred-red: #C41E3A;
    --sacred-black: #1A1A1A;
    --sacred-yellow: #F4C430;
    --sacred-white: #F5F5F5;
    
    /* Couleurs naturelles */
    --earth-brown: #5D4037;
    --forest-green: #2C5530;
    --sky-blue: #4A90A4;
    --sunset-orange: #D4652F;
    --copper: #B87333;
    --gold: #D4AF37;
    
    /* Couleurs de fond */
    --bg-deep: #0D0D0D;
    --bg-medium: #1A1A1A;
    --bg-light: #2A2A2A;
    
    /* Texte */
    --text-primary: #E8E8E8;
    --text-secondary: #A0A0A0;
    --text-accent: #D4AF37;
    
    /* Timing */
    --ease-sacred: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-flow: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Canvas de fond */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.6;
}

/* Conteneur principal */
.sacred-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: 4rem 2rem 12rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 3rem;
}

/* ============================================
   BORDURES DÉCORATIVES
   ============================================ */

.pattern-border {
    position: fixed;
    width: 150px;
    height: 150px;
    z-index: 2;
    opacity: 0;
    animation: fadeInCorner 2s var(--ease-flow) forwards;
}

.pattern-border::before,
.pattern-border::after {
    content: '';
    position: absolute;
    background: linear-gradient(90deg, var(--gold), var(--copper));
}

.top-left {
    top: 20px;
    left: 20px;
    animation-delay: 0.2s;
}

.top-left::before {
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
}

.top-left::after {
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
}

.top-right {
    top: 20px;
    right: 20px;
    animation-delay: 0.4s;
}

.top-right::before {
    top: 0;
    right: 0;
    width: 100%;
    height: 2px;
}

.top-right::after {
    top: 0;
    right: 0;
    width: 2px;
    height: 100%;
}

.bottom-left {
    bottom: 20px;
    left: 20px;
    animation-delay: 0.6s;
}

.bottom-left::before {
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
}

.bottom-left::after {
    bottom: 0;
    left: 0;
    width: 2px;
    height: 100%;
}

.bottom-right {
    bottom: 20px;
    right: 20px;
    animation-delay: 0.8s;
}

.bottom-right::before {
    bottom: 0;
    right: 0;
    width: 100%;
    height: 2px;
}

.bottom-right::after {
    bottom: 0;
    right: 0;
    width: 2px;
    height: 100%;
}

@keyframes fadeInCorner {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   ROUE MÉDICINALE
   ============================================ */

.medicine-wheel {
    width: min(350px, 80vw);
    height: min(350px, 80vw);
    position: relative;
    animation: wheelReveal 3s var(--ease-sacred) forwards;
    opacity: 0;
}

.wheel-svg {
    width: 100%;
    height: 100%;
    color: var(--gold);
    filter: drop-shadow(0 0 30px rgba(212, 175, 55, 0.3));
    animation: wheelSpin 120s linear infinite;
}

.outer-ring {
    stroke-dasharray: 1230;
    stroke-dashoffset: 1230;
    animation: drawCircle 2s var(--ease-flow) 0.5s forwards;
}

@keyframes wheelReveal {
    from {
        opacity: 0;
        transform: scale(0.5) rotate(-180deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

@keyframes wheelSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes drawCircle {
    to {
        stroke-dashoffset: 0;
    }
}

/* ============================================
   EN-TÊTE PRINCIPAL
   ============================================ */

.main-header {
    text-align: center;
    margin-top: 2rem;
}

.title-sovereign {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.title-line {
    display: block;
    font-weight: 300;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    opacity: 0;
    animation: titleReveal 1.5s var(--ease-flow) forwards;
}

.title-line[data-lang="fr"] {
    font-size: clamp(2rem, 8vw, 5rem);
    color: var(--text-primary);
    animation-delay: 1s;
    text-shadow: 0 0 60px rgba(212, 175, 55, 0.4);
}

.title-line[data-lang="en"] {
    font-size: clamp(1rem, 4vw, 2rem);
    color: var(--text-secondary);
    animation-delay: 1.3s;
    letter-spacing: 0.6em;
}

@keyframes titleReveal {
    from {
        opacity: 0;
        transform: translateY(30px);
        letter-spacing: 0.8em;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        letter-spacing: 0.4em;
    }
}

/* ============================================
   LANGUES AUTOCHTONES
   ============================================ */

.indigenous-languages {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    max-width: 1200px;
    width: 100%;
    padding: 3rem 0;
}

.language-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    opacity: 0;
    animation: groupFadeIn 1s var(--ease-flow) forwards;
}

/* Animation décalée pour chaque groupe */
.language-group[data-family="algonquian"] { animation-delay: 1.5s; }
.language-group[data-family="iroquoian"] { animation-delay: 1.7s; }
.language-group[data-family="inuit"] { animation-delay: 1.9s; }
.language-group[data-family="athabaskan"] { animation-delay: 2.1s; }
.language-group[data-family="salishan"] { animation-delay: 2.3s; }
.language-group[data-family="wakashan"] { animation-delay: 2.5s; }
.language-group[data-family="haida"] { animation-delay: 2.7s; }
.language-group[data-family="tsimshian"] { animation-delay: 2.9s; }
.language-group[data-family="tlingit"] { animation-delay: 3.1s; }
.language-group[data-family="siouan"] { animation-delay: 3.3s; }
.language-group[data-family="metis"] { animation-delay: 3.5s; }

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

.lang-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.03) 0%, 
        rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 4px;
    transition: all 0.4s var(--ease-sacred);
    position: relative;
    overflow: hidden;
}

.lang-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(212, 175, 55, 0.1), 
        transparent);
    transition: left 0.6s var(--ease-flow);
}

.lang-item:hover {
    border-color: rgba(212, 175, 55, 0.4);
    transform: translateY(-4px);
    box-shadow: 0 10px 40px rgba(212, 175, 55, 0.15);
}

.lang-item:hover::before {
    left: 100%;
}

.script {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: var(--text-primary);
    font-weight: 400;
    letter-spacing: 0.05em;
    text-align: center;
    line-height: 1.4;
}

.script.syllabic {
    font-size: clamp(1.4rem, 3.5vw, 2rem);
    color: var(--gold);
}

.nation-name {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    opacity: 0.7;
}

/* ============================================
   ART FORMLINE (CÔTE OUEST)
   ============================================ */

.decorative-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.formline-art {
    position: absolute;
    width: 120px;
    height: 400px;
    opacity: 0.15;
}

.formline-art.left {
    left: 2%;
    top: 50%;
    transform: translateY(-50%);
}

.formline-art.right {
    right: 2%;
    top: 50%;
    transform: translateY(-50%) scaleX(-1);
}

.formline-primary {
    fill: none;
    stroke: var(--sacred-red);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    animation: drawFormline 4s var(--ease-flow) 2s forwards;
}

.formline-secondary {
    fill: none;
    stroke: var(--gold);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    animation: drawFormline 4s var(--ease-flow) 2.5s forwards;
}

.ovoid {
    fill: none;
    stroke: var(--sacred-black);
    stroke-width: 3;
    opacity: 0;
    animation: ovoidReveal 1s var(--ease-flow) 4s forwards;
}

@keyframes drawFormline {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes ovoidReveal {
    from {
        opacity: 0;
        transform: scale(0);
    }
    to {
        opacity: 0.3;
        transform: scale(1);
    }
}

/* ============================================
   MOTIFS GÉOMÉTRIQUES DES PLAINES
   ============================================ */

.geometric-patterns {
    position: fixed;
    bottom: 25%;
    left: 8%;
    transform: none;
    z-index: 0;
    pointer-events: none;
}

.plains-pattern {
    width: 80px;
    height: 80px;
    opacity: 0.2;
}

.geo-shape {
    fill: none;
    stroke: var(--sunset-orange);
    stroke-width: 2;
    opacity: 0;
    animation: geoReveal 1s var(--ease-flow) forwards;
    transform-origin: center;
}

.geo-shape.delay-1 {
    animation-delay: 3.2s;
    stroke: var(--sacred-yellow);
}

.geo-shape.delay-2 {
    animation-delay: 3.4s;
    stroke: var(--copper);
}

@keyframes geoReveal {
    from {
        opacity: 0;
        transform: scale(0) rotate(-30deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* ============================================
   INUKSHUK
   ============================================ */

.inukshuk-container {
    position: fixed;
    bottom: 10%;
    right: 5%;
    z-index: 0;
    pointer-events: none;
}

.inukshuk {
    width: 60px;
    height: 90px;
    opacity: 0;
    animation: inukshukRise 2s var(--ease-flow) 3.5s forwards;
}

.inukshuk rect,
.inukshuk ellipse {
    fill: var(--text-secondary);
    opacity: 0.2;
}

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

/* ============================================
   PIED DE PAGE
   ============================================ */

.site-footer {
    position: relative;
    margin-top: auto;
    padding: 4rem 2rem 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    z-index: 10;
    opacity: 0;
    animation: footerReveal 1s var(--ease-flow) 4s forwards;
}

/* Logo IAIA triangulaire */
.footer-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 0.5rem;
}

.iaia-logo {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.3));
}

.logo-tri {
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.logo-tri.outer {
    stroke: var(--gold);
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    animation: drawTri 1.5s var(--ease-flow) 4.2s forwards;
}

.logo-tri.middle {
    stroke: var(--copper);
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    animation: drawTri 1.2s var(--ease-flow) 4.5s forwards;
}

.logo-tri.inner {
    stroke: var(--gold);
    stroke-dasharray: 120;
    stroke-dashoffset: 120;
    animation: drawTri 1s var(--ease-flow) 4.8s forwards;
}

@keyframes drawTri {
    to {
        stroke-dashoffset: 0;
    }
}

.footer-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    letter-spacing: 0.4em;
    text-transform: uppercase;
    font-weight: 300;
}

/* Section partenaires */
.partners-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(212, 175, 55, 0.1);
    width: 100%;
    max-width: 600px;
}

.partners-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.6;
}

.partners-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.partner-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    transition: all 0.3s var(--ease-sacred);
    padding: 0.5rem 0.75rem;
    border-radius: 3px;
}

.partner-link:hover {
    color: var(--gold);
    background: rgba(212, 175, 55, 0.05);
}

.partner-link:hover .partner-icon {
    filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.5));
}

.partner-icon {
    width: 24px;
    height: 24px;
    transition: all 0.3s var(--ease-sacred);
}

.partner-icon polygon {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linejoin: round;
}

.partner-separator {
    width: 1px;
    height: 16px;
    background: rgba(212, 175, 55, 0.2);
}

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

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .sacred-container {
        padding: 2rem 1rem 10rem;
    }
    
    .medicine-wheel {
        width: min(280px, 70vw);
        height: min(280px, 70vw);
    }
    
    .formline-art {
        display: none;
    }
    
    .lang-item {
        padding: 1rem 1.5rem;
    }
    
    .pattern-border {
        width: 80px;
        height: 80px;
    }
    
    .partners-links {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .partner-separator {
        display: none;
    }
}

@media (max-width: 480px) {
    .language-group {
        flex-direction: column;
        align-items: center;
    }
    
    .lang-item {
        width: 100%;
        max-width: 300px;
    }
    
    .inukshuk-container,
    .geometric-patterns {
        display: none;
    }
}

/* ============================================
   ANIMATIONS SUBTILES CONTINUES
   ============================================ */

@keyframes gentlePulse {
    0%, 100% {
        opacity: 0.15;
    }
    50% {
        opacity: 0.25;
    }
}

.formline-art {
    animation: gentlePulse 8s ease-in-out infinite;
}

/* Effet de respiration sur les éléments */
.medicine-wheel {
    animation: wheelReveal 3s var(--ease-sacred) forwards,
               breathe 6s ease-in-out 3s infinite;
}

@keyframes breathe {
    0%, 100% {
        filter: drop-shadow(0 0 30px rgba(212, 175, 55, 0.3));
    }
    50% {
        filter: drop-shadow(0 0 50px rgba(212, 175, 55, 0.5));
    }
}

