/* ============================================
   TABLE OF CONTENTS
   1. CSS Custom Properties (variables)
   2. Reset & Base
   3. Layout (container)
   4. Animated Background
   5. Header (sticky + main)
   6. Video Player + Frame
   7. Footer
   8. Responsive
   9. Animations
   10. Utility
   ============================================ */

/* 1. CSS Custom Properties */
:root {
    /* Primary Colors - Brand Aligned */
    --lufs-teal: #78BEBA;
    --lufs-red: #D35233;
    --lufs-yellow: #E7B225;
    --lufs-blue: #2069af;
    --lufs-black: #111111;
    --lufs-white: #fbf9e2;

    /* Retro Grays */
    --retro-gray: #c0c0c0;
    --retro-dark-gray: #808080;
    --retro-light-gray: #e0e0e0;
    --retro-border: #888888;

    /* Typography */
    --font-title: 'Host Grotesk', monospace;
    --font-body: 'Public Sans', sans-serif;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* No rounded corners - flat design */
    --radius: 0px;

    /* Flat shadows - retro feel */
    --shadow-flat: 2px 2px 0 var(--retro-border);
    --shadow-inset: inset 1px 1px 0 var(--retro-light-gray);
}

/* 2. Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--lufs-white);
    background-color: var(--lufs-black);
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(120, 190, 186, 0.03) 2px,
            rgba(120, 190, 186, 0.03) 4px
        );
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    position: relative;
    overflow-x: hidden;
}

/* 3. Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-lg);
}

/* 4. Animated Background */
.animated-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.floating-shape {
    position: absolute;
    opacity: 0.1;
    animation: floatAround 15s ease-in-out infinite;
}

.floating-shape.square {
    background: var(--lufs-teal);
    border: 1px solid var(--lufs-white);
}

.floating-shape.circle {
    background: var(--lufs-blue);
    border-radius: 50%;
    border: 1px solid var(--lufs-white);
}

.floating-shape.triangle {
    width: 0;
    height: 0;
    background: transparent;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 20px solid var(--lufs-yellow);
    opacity: 0.15;
}

.floating-shape.diamond {
    background: var(--lufs-red);
    transform: rotate(45deg);
    border: 1px solid var(--lufs-white);
}

@keyframes floatAround {
    0% { 
        transform: translateY(0px) translateX(0px) rotate(0deg);
        opacity: 0.05;
    }
    25% { 
        transform: translateY(-30px) translateX(20px) rotate(90deg);
        opacity: 0.15;
    }
    50% { 
        transform: translateY(-10px) translateX(-15px) rotate(180deg);
        opacity: 0.1;
    }
    75% { 
        transform: translateY(-40px) translateX(10px) rotate(270deg);
        opacity: 0.2;
    }
    100% { 
        transform: translateY(0px) translateX(0px) rotate(360deg);
        opacity: 0.05;
    }
}

/* 5. Header Components */

/* Sticky Header */
.sticky-header {
    position: fixed;
    top: -80px;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--lufs-black);
    border-bottom: 2px solid var(--lufs-teal);
    transition: top 0.3s ease;
    padding: var(--spacing-sm) 0;
}

.sticky-header.visible {
    top: 0;
}

.sticky-header .header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.sticky-header .logo {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.sticky-header .logo svg {
    width: 100%;
    height: 100%;
}

.sticky-header .header-text h1 {
    font-family: var(--font-title);
    font-size: 18px;
    font-weight: 600;
    color: var(--lufs-white);
    text-shadow: 0 0 2px var(--lufs-teal);
}

.sticky-header .header-text p {
    font-size: 12px;
    color: var(--lufs-teal);
    font-weight: 400;
}

/* Main Header */
.main-header {
    background: var(--lufs-black);
    border: 3px solid var(--lufs-teal);
    padding: var(--spacing-xl) 0;
    margin-bottom: var(--spacing-xl);
    position: relative;
}

.main-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--lufs-teal), var(--lufs-blue), var(--lufs-yellow), var(--lufs-red));
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.logo-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.logo-link {
    text-decoration: none;
    transition: transform 0.2s ease;
}

.logo-link:hover {
    transform: scale(1.1);
}

.logo {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--lufs-white);
    box-shadow: var(--shadow-flat);
    cursor: pointer;
    background: var(--lufs-black);
}

.logo svg {
    width: 100%;
    height: 100%;
}

.header-text h1 {
    font-family: var(--font-title);
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: var(--lufs-white);
    text-shadow: 0 0 3px var(--lufs-teal);
}

.header-text p {
    font-size: 1.1rem;
    color: var(--lufs-teal);
    font-weight: 400;
}

/* 6. Video Player + Frame */
.reel-container {
    width: 100%;
    max-width: 960px;
    margin: 0 auto var(--spacing-xl);
    border: 3px solid var(--lufs-teal);
    background: var(--lufs-black);
    position: relative;
}

.reel-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--lufs-teal), var(--lufs-blue), var(--lufs-yellow), var(--lufs-red));
    z-index: 1;
}

/* Corner frame decorations */
.reel-container::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    pointer-events: none;
    /* Corner borders using box-shadow approach */
}

/* Corner elements using additional markup in HTML */
.corner {
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid var(--lufs-teal);
    pointer-events: none;
    z-index: 2;
}

.corner-tl {
    top: -2px;
    left: -2px;
    border-right: none;
    border-bottom: none;
}

.corner-tr {
    top: -2px;
    right: -2px;
    border-left: none;
    border-bottom: none;
}

.corner-bl {
    bottom: -2px;
    left: -2px;
    border-right: none;
    border-top: none;
}

.corner-br {
    bottom: -2px;
    right: -2px;
    border-left: none;
    border-top: none;
}

.reel-video {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: block;
    border: none;
}

/* 7. Footer */
.footer {
    text-align: center;
    padding: var(--spacing-xl) 0;
    border-top: 2px solid var(--lufs-teal);
    margin-top: var(--spacing-xl);
}

.footer p {
    color: var(--lufs-teal);
    font-size: 0.9rem;
    font-family: var(--font-body);
}

/* 8. Responsive Adjustments */

/* Tablet */
@media (max-width: 768px) {
    .container {
        padding: var(--spacing-md);
    }

    .header-content {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-lg);
    }

    .header-text h1 {
        font-size: 2rem;
    }

    .logo {
        width: 60px;
        height: 60px;
    }

    .corner {
        width: 12px;
        height: 12px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .header-text h1 {
        font-size: 1.8rem;
    }

    .logo {
        width: 50px;
        height: 50px;
    }

    .sticky-header .logo {
        width: 30px;
        height: 30px;
    }

    .sticky-header .header-text h1 {
        font-size: 14px;
    }

    .sticky-header .header-text p {
        font-size: 10px;
    }

    .corner {
        width: 10px;
        height: 10px;
    }
}

/* 9. Retro Buttons (Webring) */
.retro-buttons {
    margin: var(--spacing-xl) 0;
    text-align: center;
    padding: var(--spacing-lg);
    border: 2px solid var(--lufs-teal);
    background: var(--lufs-black);
}

.buttons-container {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

/* Retro Button Styling - from original button files */
@keyframes pulseShadow {
    0%, 100% {
        box-shadow: 2px 2px 0 #b0b0b0;
    }
    50% {
        box-shadow: 4px 4px 0 #888;
    }
}

@keyframes subtle-float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-2px);
    }
}

@keyframes sparkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0.5);
    }
    50% {
        opacity: 0.8;
        transform: scale(1);
    }
}

@keyframes dr-pulseShadow {
    0%, 100% {
        box-shadow: 2px 2px 0 #b0b0b0;
    }
    50% {
        box-shadow: 4px 4px 0 #888;
    }
}

@keyframes dr-float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-2px);
    }
}

@keyframes dr-eyeBlink {
    0%, 95%, 100% { transform: scaleY(1); }
    97% { transform: scaleY(0.1); }
}

@keyframes dr-sparkle {
    0%, 100% { opacity: 0; transform: scale(0.5); }
    50% { opacity: 0.8; transform: scale(1); }
}

.webring-button {
    animation: pulseShadow 2s infinite, subtle-float 3s ease-in-out infinite;
    width: 88px;
    height: 31px;
    display: inline-block;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    background: #e0e0e0;
    border: 2px solid #b0b0b0;
    box-shadow:
        0 0 0 4px #f8f8f8,
        0 0 0 6px #888,
        2px 2px 0 0 #b0b0b0;
    margin: 8px;
    padding: 0;
    transition: background 0.1s;
    position: relative;
}

.webring-button:hover {
    animation-play-state: paused;
    box-shadow: none;
    background: #d0d0d0;
}

.webring-button svg {
    width: 88px;
    height: 31px;
    display: block;
    margin: 0 auto;
    background: #e0e0e0;
}

/* Sparkle elements */
.sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #fff;
    border-radius: 50%;
    z-index: 10;
    animation: sparkle 2s infinite;
    pointer-events: none;
}

.dr-sparkle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #fff;
    border-radius: 50%;
    z-index: 10;
    animation: dr-sparkle 2s infinite;
    pointer-events: none;
}

/* Eye blink animation for danialrami button */
.dr-cloud-eye {
    animation: dr-eyeBlink 4s infinite;
    transform-origin: center;
}

/* 10. Animations */

/* Floating animations */
@keyframes floatSlow {
    0%, 100% { 
        transform: translateY(0px) translateX(0px);
        opacity: 0.08;
    }
    50% { 
        transform: translateY(-20px) translateX(15px);
        opacity: 0.15;
    }
}

@keyframes floatFast {
    0%, 100% { 
        transform: translateY(0px) translateX(0px) scale(1);
        opacity: 0.1;
    }
    33% { 
        transform: translateY(-15px) translateX(-10px) scale(1.1);
        opacity: 0.2;
    }
    66% { 
        transform: translateY(-25px) translateX(20px) scale(0.9);
        opacity: 0.15;
    }
}

/* Pulsing background elements */
.pulse-element {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, var(--lufs-teal) 0%, transparent 70%);
    animation: pulseGlow 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes pulseGlow {
    0%, 100% { 
        opacity: 0.03;
        transform: scale(1);
    }
    50% { 
        opacity: 0.08;
        transform: scale(1.2);
    }
}

/* 10. Utility */

/* Selection styling */
::selection {
    background-color: var(--lufs-yellow);
    color: var(--lufs-black);
}

::-moz-selection {
    background-color: var(--lufs-yellow);
    color: var(--lufs-black);
}

/* Focus states for accessibility */
a:focus, button:focus {
    outline: 2px solid var(--lufs-yellow);
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
