/* =============================================
   munju.org — Frutiger Aero Design System
   ============================================= */

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
    font-weight: 400;
    color: #2c3e50;
    background-color: #fdf6ec;
    line-height: 1.6;
    letter-spacing: 0.01em;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* --- Background Gradient --- */
.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 151, 167, 0.08), rgba(245, 166, 35, 0.08));
    pointer-events: none;
    z-index: 0;
}

/* --- Masonry Grid --- */
.masonry-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: 180px;
    gap: 24px;
    max-width: 1440px;
    margin: 0 auto;
    padding: 48px;
    perspective: 1200px;
    position: relative;
    z-index: 1;
}

/* --- Tile Base --- */
.tile {
    background: linear-gradient(135deg, rgba(0, 151, 167, 0.15), rgba(245, 166, 35, 0.1));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    padding: 32px;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.4s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tile:hover {
    transform: translateZ(40px) translateY(-4px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* --- Tile Variants --- */
.tile--hero {
    transform: translateZ(20px);
    background: linear-gradient(135deg, rgba(0, 151, 167, 0.2), rgba(245, 166, 35, 0.12));
    justify-content: center;
    align-items: flex-start;
}

.tile--hero:hover {
    transform: translateZ(40px) translateY(-4px);
}

.tile--small {
    transform: translateZ(10px);
    padding: 24px;
}

.tile--small:hover {
    transform: translateZ(30px) translateY(-4px);
}

.tile--medium {
    transform: translateZ(15px);
}

.tile--medium:hover {
    transform: translateZ(35px) translateY(-4px);
}

.tile--large {
    transform: translateZ(12px);
}

.tile--large:hover {
    transform: translateZ(32px) translateY(-4px);
}

.tile--circuit {
    transform: translateZ(8px);
}

.tile--circuit:hover {
    transform: translateZ(28px) translateY(-4px);
}

.tile--farewell {
    transform: translateZ(5px);
    background: linear-gradient(135deg, rgba(245, 166, 35, 0.2), rgba(0, 151, 167, 0.15));
    display: flex;
    align-items: center;
    justify-content: center;
}

.tile--farewell:hover {
    transform: translateZ(25px) translateY(-4px);
}

.tile--palette {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 12px;
}

.tile--gradient-showcase {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 24px 32px;
}

/* --- Typography --- */
.hero-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 6vw, 5rem);
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: #2c3e50;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 2;
}

.hero-subtitle {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.5vw, 1.3rem);
    color: #005f6b;
    margin-top: 12px;
    letter-spacing: 0.05em;
    position: relative;
    z-index: 2;
}

.tile-heading {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: #2c3e50;
    margin-bottom: 8px;
}

.section-heading {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: #2c3e50;
    margin-bottom: 16px;
}

.tile-body {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.6;
    color: #2c3e50;
    letter-spacing: 0.01em;
}

.tile-body--large {
    font-size: clamp(1rem, 1.4vw, 1.2rem);
}

.tile-caption {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #005f6b;
    display: block;
}

.tile-label {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    color: #2c3e50;
    display: block;
}

.farewell-text {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: #2c3e50;
    text-align: center;
    letter-spacing: -0.01em;
}

/* --- Icon System --- */
.aero-icon {
    width: 48px;
    height: 48px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.12));
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
}

.aero-icon--lg {
    width: 64px;
    height: 64px;
}

.aero-icon--xl {
    width: 96px;
    height: 96px;
    margin: 0 auto 16px;
    display: block;
}

.tile:hover .aero-icon {
    transform: rotate(3deg) scale(1.08);
}

/* --- Tile Icon Row --- */
.tile-icon-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.tile-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* --- Icon Cluster --- */
.icon-cluster {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 16px;
}

/* --- Glossy Orbs --- */
.glossy-orb {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}

.glossy-orb--teal {
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.8), rgba(0, 151, 167, 0.4) 50%, rgba(0, 151, 167, 0.1));
    box-shadow: 0 4px 12px rgba(0, 151, 167, 0.2);
}

.glossy-orb--amber {
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.8), rgba(245, 166, 35, 0.4) 50%, rgba(245, 166, 35, 0.1));
    box-shadow: 0 4px 12px rgba(245, 166, 35, 0.2);
}

/* --- Light Beams --- */
.light-beam {
    position: absolute;
    width: 300px;
    height: 4px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    pointer-events: none;
    z-index: 1;
}

/* --- Circuit Tile Background --- */
.circuit-tile-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.15;
    background-image: url("data:image/svg+xml,%3Csvg width='200' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 20h40v0h20M80 20v40M80 60h40M120 60v40M120 100h-40M80 100v40M80 140h-40M40 140v-40M40 100h-40' fill='none' stroke='%23b2ebf2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='20' cy='20' r='4' fill='%23b2ebf2'/%3E%3Ccircle cx='80' cy='20' r='4' fill='%23b2ebf2'/%3E%3Ccircle cx='80' cy='60' r='4' fill='%23b2ebf2'/%3E%3Ccircle cx='120' cy='60' r='4' fill='%23b2ebf2'/%3E%3Ccircle cx='120' cy='100' r='4' fill='%23b2ebf2'/%3E%3Ccircle cx='80' cy='100' r='4' fill='%23b2ebf2'/%3E%3Ccircle cx='80' cy='140' r='4' fill='%23b2ebf2'/%3E%3Ccircle cx='40' cy='140' r='4' fill='%23b2ebf2'/%3E%3Ccircle cx='40' cy='100' r='4' fill='%23b2ebf2'/%3E%3C/svg%3E");
    background-repeat: repeat;
    border-radius: 24px;
    pointer-events: none;
}

/* --- Swatches --- */
.swatch-row {
    display: flex;
    gap: 10px;
}

.swatch {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    cursor: pointer;
}

.swatch:hover {
    transform: scale(1.15);
}

/* --- Toggle Widgets --- */
.widget-toggle-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

.aero-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.aero-toggle__track {
    width: 52px;
    height: 28px;
    border-radius: 14px;
    background: linear-gradient(135deg, #0097a7, #b2ebf2);
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.4);
    transition: background 0.3s ease;
}

.aero-toggle__track--off {
    background: linear-gradient(135deg, #b2ebf2, #fdf6ec);
}

.aero-toggle__thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #ffffff, #f9fbfc);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    position: absolute;
    top: 3px;
    left: 27px;
    transition: left 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.aero-toggle__thumb--off {
    left: 3px;
}

.aero-toggle__label {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: #2c3e50;
}

/* --- Slider Widgets --- */
.aero-slider-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 16px;
}

.aero-slider {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.aero-slider__label {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    color: #005f6b;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.aero-slider__track {
    width: 100%;
    height: 10px;
    border-radius: 5px;
    background: rgba(178, 235, 242, 0.3);
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

.aero-slider__fill {
    height: 100%;
    border-radius: 5px;
    background: linear-gradient(90deg, #0097a7, #b2ebf2);
    box-shadow: 0 0 8px rgba(0, 151, 167, 0.3);
    transition: width 0.5s ease;
}

.aero-slider__fill--amber {
    background: linear-gradient(90deg, #c17d10, #f5a623);
    box-shadow: 0 0 8px rgba(245, 166, 35, 0.3);
}

.aero-slider__thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #ffffff, #f9fbfc);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), 0 0 0 2px rgba(0, 151, 167, 0.2);
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    transition: left 0.5s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.aero-slider__thumb:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2), 0 0 0 4px rgba(0, 151, 167, 0.15);
}

/* --- Progress Ring --- */
.progress-ring-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 16px auto 0;
}

.progress-ring {
    width: 100%;
    height: 100%;
}

.progress-ring__value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 1.4rem;
    color: #0097a7;
}

/* --- Badge --- */
.aero-badge {
    position: relative;
    display: inline-flex;
}

.aero-badge__count {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f5a623, #c17d10);
    color: #f9fbfc;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(193, 125, 16, 0.3);
}

/* --- Gradient Bars --- */
.gradient-bar {
    flex: 1;
    height: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.gradient-bar--teal {
    background: linear-gradient(90deg, #005f6b, #0097a7, #b2ebf2);
}

.gradient-bar--amber {
    background: linear-gradient(90deg, #c17d10, #f5a623, #fdf6ec);
}

.gradient-bar--mixed {
    background: linear-gradient(90deg, #0097a7, #b2ebf2, #fdf6ec, #f5a623);
}

/* --- Color Picker --- */
.color-picker {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 16px 0;
}

.color-picker__swatch {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 16px;
    border: 3px solid transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
}

.color-picker__swatch:hover {
    transform: scale(1.1);
}

.color-picker__swatch--active {
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.color-picker__preview {
    width: 100%;
    height: 40px;
    border-radius: 12px;
    background: #0097a7;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.4s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 2px 8px rgba(0, 0, 0, 0.1);
}

.color-picker__hex {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: #f9fbfc;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* --- Pulse-Attention Animation --- */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 0 0 0 rgba(0, 151, 167, 0.3);
    }
    50% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 0 20px 8px rgba(0, 151, 167, 0.15);
    }
}

.pulse-element {
    animation: pulse-glow 3s ease-in-out infinite;
}

/* --- Responsive: Tablet --- */
@media (max-width: 768px) {
    .masonry-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 16px;
        padding: 24px;
    }

    .tile--hero {
        grid-column: span 6 !important;
        grid-row: span 2 !important;
    }

    .tile--farewell {
        grid-column: span 6 !important;
    }

    [style*="grid-column: span 8"] {
        grid-column: span 6 !important;
    }

    [style*="grid-column: span 6"] {
        grid-column: span 6 !important;
    }

    [style*="grid-column: span 4"] {
        grid-column: span 3 !important;
    }

    [style*="grid-column: span 3"] {
        grid-column: span 3 !important;
    }

    [style*="grid-column: span 12"] {
        grid-column: span 6 !important;
    }
}

/* --- Responsive: Mobile --- */
@media (max-width: 480px) {
    .masonry-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 16px;
        perspective: none;
    }

    .tile {
        grid-column: span 2 !important;
        grid-row: span 1 !important;
        min-height: 160px;
        transform: none;
        padding: 20px;
    }

    .tile--hero {
        min-height: 240px;
    }

    .tile:hover {
        transform: translateY(-2px);
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .aero-icon--xl {
        width: 64px;
        height: 64px;
    }

    .icon-cluster {
        gap: 12px;
    }

    .gradient-bar {
        height: 16px;
    }

    .tile--gradient-showcase {
        flex-wrap: wrap;
        gap: 8px;
    }
}
