/* ============================================
   SUPREMACY.CLOUD - STYLESHEET
   Brutalist-Luxury Design System
   ============================================ */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: #000000;
    color: #f5f5f5;
    font-family: 'Lora', serif;
    font-size: clamp(1rem, 1.05vw, 1.15rem);
    line-height: 1.8;
    overflow-x: hidden;
    position: relative;
}

/* Typography System */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
}

h1 {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(4rem, 12vw, 9rem);
    letter-spacing: -0.03em;
    text-transform: uppercase;
}

h2 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 1.5em;
}

p {
    max-width: 65ch;
    margin-bottom: 1.8em;
    font-size: clamp(1rem, 1.05vw, 1.15rem);
}

/* Accent Colors */
.gold-accent {
    color: #d4af37;
    font-weight: 600;
}

.gold-accent-large {
    color: #d4af37;
    font-weight: 600;
    font-size: 1.15em;
}

/* Page Container */
#page-container {
    width: 100%;
    position: relative;
}

/* Tier System */
.tier {
    width: 100%;
    padding: clamp(2rem, 5vw, 4rem);
    position: relative;
    border-width: 0;
    border-style: solid;
    border-color: #ffffff;
    transition: all 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.tier-1 {
    width: 100vw;
    background-color: #000000;
    margin: 0 auto;
    padding-left: clamp(2rem, 5vw, 4rem);
    padding-right: clamp(2rem, 5vw, 4rem);
    border-top: 1px solid #ffffff;
}

.tier-2 {
    width: 95vw;
    background-color: #000000;
    margin: 0 auto;
    border-top: 1px solid #ffffff;
}

.tier-3 {
    width: 85vw;
    background: linear-gradient(180deg, #1a1a1a 0%, #000000 100%);
    margin: 0 auto;
    border: 2px solid #d4af37;
    position: relative;
}

.tier-4 {
    width: 90vw;
    background-color: #000000;
    margin: 0 auto;
    border-top: 1px solid #ffffff;
}

.tier-5 {
    width: 98vw;
    background-color: #000000;
    margin: 0 auto;
    border-top: 1px solid #ffffff;
}

.tier-content {
    position: relative;
    z-index: 2;
}

.tier-marker {
    position: fixed;
    left: 2rem;
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    color: #d4af37;
    opacity: 0.4;
    font-weight: 700;
    transition: opacity 600ms ease-out;
    pointer-events: none;
}

.tier.active .tier-marker {
    opacity: 1;
}

/* Apex Hero */
#apex-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000000;
    position: relative;
}

.apex-container {
    width: 65ch;
    max-width: 90vw;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 2px solid #d4af37;
    background: linear-gradient(180deg, #1a1a1a 0%, #000000 100%);
    padding: 4rem;
    position: relative;
    animation: apexGenesisIn 3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.apex-title {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(3rem, 10vw, 7rem);
    letter-spacing: -0.03em;
    text-transform: uppercase;
    color: #f5f5f5;
    margin-bottom: 1.5rem;
    animation: apexTitleIn 2.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.5s forwards;
    opacity: 0;
}

.apex-divider {
    width: 60%;
    height: 1px;
    background-color: #d4af37;
    margin: 1.5rem 0;
    animation: apexDividerIn 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94) 2s forwards;
    opacity: 0;
}

.apex-subtitle {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(0.9rem, 1.5vw, 1.2rem);
    letter-spacing: 0.04em;
    color: #cccccc;
    font-weight: 500;
    animation: apexSubtitleIn 500ms cubic-bezier(0.25, 0.46, 0.45, 0.94) 2.6s forwards;
    opacity: 0;
}

/* Geometric Accents */
.geometric-accent {
    width: 100px;
    height: 100px;
    margin: 2rem auto;
    position: relative;
}

.accent-pyramid {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
}

.accent-pyramid::before,
.accent-pyramid::after {
    content: '';
    display: block;
    border-left: 25px solid transparent;
    border-right: 25px solid transparent;
    border-bottom: 20px solid #d4af37;
}

.accent-pyramid::before {
    border-bottom-color: #d4af37;
    width: 50px;
    height: 20px;
}

.accent-pyramid::after {
    border-bottom: 40px solid transparent;
    border-left: 50px solid #d4af37;
    border-right: 0;
    width: 100px;
    height: 40px;
    margin-top: 5px;
}

.accent-seal {
    width: 80px;
    height: 80px;
    margin: 2rem auto;
    border: 2px solid #d4af37;
    border-radius: 50%;
    position: relative;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.1) 0%, transparent 70%);
}

.accent-seal::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 1px solid #d4af37;
    border-radius: 50%;
}

.accent-seal::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 15px;
    height: 15px;
    background-color: #d4af37;
    border-radius: 50%;
}

/* Margin Notes */
.margin-note {
    position: absolute;
    width: 120px;
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.75rem, 0.95vw, 0.9rem);
    letter-spacing: 0.05em;
    color: #cccccc;
    padding: 1rem;
    border: 1px solid #ffffff;
    line-height: 1.6;
    animation: marginNoteIn 400ms cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    opacity: 0;
}

.margin-note[data-side="left"] {
    left: -150px;
    top: 2rem;
}

.margin-note[data-side="right"] {
    right: -150px;
    top: 2rem;
}

.note-label {
    display: block;
    color: #d4af37;
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 0.85em;
}

/* Tier Navigator (Fixed) */
.tier-navigator {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: #000000;
    border: 1px solid #ffffff;
    padding: 1rem;
    cursor: pointer;
    z-index: 100;
    font-family: 'Space Mono', monospace;
    transition: all 300ms ease-out;
}

.navigator-tier-number {
    color: #d4af37;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.05em;
    text-align: center;
}

.navigator-expanded {
    background-color: #1a1a1a;
    border: 1px solid #d4af37;
    padding: 1rem;
    margin-top: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

.navigator-tier-item {
    padding: 0.5rem;
    margin: 0.3rem 0;
    font-size: 0.75rem;
    color: #cccccc;
    border-left: 2px solid transparent;
    padding-left: 0.8rem;
    transition: all 300ms ease-out;
    cursor: pointer;
}

.navigator-tier-item:hover {
    color: #d4af37;
    border-left-color: #d4af37;
}

/* Animations */
@keyframes apexGenesisIn {
    0% {
        opacity: 0;
        border-color: #ffffff;
        transform: scale(0.95);
    }
    30% {
        border-color: #d4af37;
    }
    100% {
        opacity: 1;
        border-color: #d4af37;
        transform: scale(1);
    }
}

@keyframes apexTitleIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes apexDividerIn {
    0% {
        opacity: 0;
        width: 0%;
    }
    100% {
        opacity: 1;
        width: 60%;
    }
}

@keyframes apexSubtitleIn {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes marginNoteIn {
    0% {
        opacity: 0;
        transform: translateX(20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes tierBorderPulse {
    0% {
        border-color: #ffffff;
    }
    50% {
        border-color: #d4af37;
    }
    100% {
        border-color: #ffffff;
    }
}

@keyframes tierMarkerGlow {
    0% {
        opacity: 0.4;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.4;
    }
}

/* Scroll Animations */
.tier-content p {
    animation: fadeInUp 400ms cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    opacity: 0;
}

.tier.visible p {
    animation-play-state: running;
}

.tier.visible p:nth-child(1) {
    animation-delay: 0ms;
}

.tier.visible p:nth-child(2) {
    animation-delay: 150ms;
}

.tier.visible p:nth-child(3) {
    animation-delay: 300ms;
}

.tier.visible p:nth-child(4) {
    animation-delay: 450ms;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes headingScale {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.tier-heading {
    animation: headingScale 500ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    opacity: 0;
}

.tier.visible .tier-heading {
    animation: headingScale 500ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .tier-marker {
        position: relative;
        left: 0;
        display: inline-block;
        margin-bottom: 1rem;
        opacity: 0.6;
    }
    
    .margin-note {
        position: relative;
        left: 0 !important;
        right: 0 !important;
        width: 100%;
        margin: 1.5rem 0;
        max-width: 100%;
    }
    
    .margin-note[data-side="left"],
    .margin-note[data-side="right"] {
        left: auto !important;
        right: auto !important;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 1rem;
    }
    
    h1 {
        font-size: clamp(2.5rem, 8vw, 4rem);
        letter-spacing: -0.02em;
    }
    
    h2 {
        font-size: clamp(1.1rem, 2vw, 1.5rem);
        letter-spacing: 0.02em;
    }
    
    .tier {
        padding: 1.5rem;
    }
    
    .apex-container {
        width: 90vw;
        max-width: 100%;
        aspect-ratio: auto;
        min-height: auto;
        padding: 2rem;
    }
    
    .tier-navigator {
        bottom: 1rem;
        right: 1rem;
        padding: 0.8rem;
    }
    
    p {
        max-width: 100%;
    }
    
    .geometric-accent {
        width: 60px;
        height: 60px;
    }
    
    .accent-seal {
        width: 60px;
        height: 60px;
    }
}

/* Print Styles */
@media print {
    .tier-navigator {
        display: none;
    }
    
    .margin-note {
        position: static;
        width: 100%;
        margin: 1rem 0;
    }
}

/* Dark Mode (already native) */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #000000;
        color: #f5f5f5;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
