/* ==========================================================================
   CSS Reset & Base Styles
   ========================================================================== */

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

:root {
    /* Color Palette */
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #3498db;
    --text-color: #333;
    --light-text: #555;
    --bg-overlay: rgba(255, 255, 255, 0.95);
    
    /* Typography */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Lato', sans-serif;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

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

body {
    font-family: var(--font-body);
    color: var(--text-color);
    line-height: 1.6;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 100vh;
    
    /* Fixed Background Image */
    background-image: url('bg.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* ==========================================================================
   Overlay System
   ========================================================================== */

.overlay-1 {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
      270deg,
      rgba(226, 224, 211, 0) 0%,
      rgba(0, 0, 0, 0.8687850140056023) 100%
    );
    pointer-events: none;
    z-index: 1;
}

.overlay-2 {
    position: fixed;
    top: 0;
    left: 0;
    width: 250.625em;
    height: 43.75em;
    background: url(cloud-overlay.png) 0 100% repeat-x;
    animation: cloudLoop 80s linear infinite;
    z-index: 2;
    pointer-events: none;
}

@keyframes cloudLoop {
    0% {
        transform: translate3d(0, 0, 0);
    }
    100% {
        transform: translate3d(-50%, 0, 0);
    }
}

/* ==========================================================================
   Main Layout
   ========================================================================== */

.main-container {
    position: relative;
    z-index: 3;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: var(--spacing-md);
    padding-top: 10vh;
}

/* ==========================================================================
   Content Box
   ========================================================================== */

.content-box {
    background: transparent;
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    max-width: 700px;
    width: 100%;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.15),
        0 6px 16px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    animation: fadeInUp 0.8s ease-out;
    backdrop-filter: blur(0px);
    margin: 0 auto var(--spacing-xl) auto;
}

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

/* ==========================================================================
   Header Section
   ========================================================================== */

.box-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.logo {
    width: 180px;
    height: 180px;
    margin-bottom: var(--spacing-md);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.box-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: #ddd;
    margin-bottom: var(--spacing-sm);
    line-height: 1.2;
    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.8),
        0 1px 2px rgba(0, 0, 0, 0.6),
        0 0 1px rgba(255, 255, 255, 0.3);
}

.title-underline {
    width: 60px;
    height: 3px;
    background: linear-gradient(to right, var(--accent-color), var(--secondary-color));
    margin: 0 auto;
    border-radius: 2px;
}

/* ==========================================================================
   Content Section
   ========================================================================== */

.box-content {
    margin-bottom: var(--spacing-lg);
}

.history-text {
    font-size: 1rem;
    color: #ffffff;
    margin-bottom: var(--spacing-md);
    text-align: justify;
    line-height: 1.8;
    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.9),
        0 1px 2px rgba(0, 0, 0, 0.7),
        0 0 1px rgba(0, 0, 0, 0.5);
    font-weight: 500;
}

.history-text:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   Footer Section
   ========================================================================== */

.box-footer {
    text-align: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.social-link {
    font-size: 0.95rem;
    color: #ffffff;
    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.9),
        0 1px 2px rgba(0, 0, 0, 0.7);
}

.social-link a {
    color: #5dade2;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.8),
        0 1px 2px rgba(0, 0, 0, 0.6);
}

.social-link a:hover {
    color: #85c1e9;
}

.social-link a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.social-link a:hover::after {
    width: 100%;
}

/* ==========================================================================
   Responsive Design - Mobile First
   ========================================================================== */

/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575px) {
    .main-container {
        padding: var(--spacing-sm);
    }
    
    .content-box {
        padding: var(--spacing-md);
        margin: 0 var(--spacing-sm);
    }
    
    .logo {
        width: 100px;
        height: 100px;
    }
    
    .box-title {
        font-size: 1.5rem;
    }
    
    .history-text {
        font-size: 0.9rem;
    }
    
    .social-link {
        font-size: 0.85rem;
    }
    
    .overlay-2 {
        width: 200em;
        height: 35em;
        animation-duration: 60s;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
    .box-title {
        font-size: 2.25rem;
    }
    
    .content-box {
        padding: var(--spacing-xl);
    }
    
    .logo {
        width: 120px;
        height: 120px;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
    :root {
        --spacing-lg: 2.5rem;
        --spacing-xl: 4rem;
    }
    
    .box-title {
        font-size: 2.5rem;
    }
    
    .history-text {
        font-size: 1.05rem;
    }
    
    .main-container {
        padding: var(--spacing-lg);
    }
    
    .logo {
        width: 140px;
        height: 140px;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .box-title {
        font-size: 2.75rem;
    }
    
    .history-text {
        font-size: 1.1rem;
        line-height: 1.9;
    }
    
    .content-box {
        max-width: 800px;
    }
    
    .logo {
        width: 160px;
        height: 160px;
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .content-box {
        max-width: 900px;
        padding: 3rem 4rem;
    }
    
    .logo {
        width: 180px;
        height: 180px;
    }
}

/* Ultra-wide devices (1440px and up) */
@media (min-width: 1440px) {
    .content-box {
        max-width: 1000px;
    }
    
    .box-title {
        font-size: 3rem;
    }
    
    .history-text {
        font-size: 1.2rem;
    }
}

/* 4K and ultra-wide screens (1920px and up) */
@media (min-width: 1920px) {
    .overlay-2 {
        width: 300em;
        height: 50em;
    }
    
    .content-box {
        max-width: 1200px;
        padding: 4rem 5rem;
    }
    
    .box-title {
        font-size: 3.5rem;
    }
    
    .history-text {
        font-size: 1.3rem;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    body {
        background: white;
    }
    
    .clouds-container {
        display: none;
    }
    
    .content-box {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ==========================================================================
   Accessibility & Performance
   ========================================================================== */

/* Screen reader only content */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
a:focus,
button:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .content-box {
        border: 2px solid var(--primary-color);
    }
}
