/* CSS Variables */
html {
    font-size: 20px;
}

:root {
    --transition-fast: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.2rem;
    --radius-2xl: 1.6rem;
    --radius-full: 2.5rem;
    --pad-xs: 0.25rem 0.4rem;
    --pad-sm: 0.3rem 0.5rem;
    --pad-md: 0.4rem 0.6rem;
    --pad-lg: 0.6rem 0.8rem;
    --pad-xl: 0.6rem 1rem;
    --pad-2xl: 0.8rem 1.2rem;
    --pad-3xl: 0.8rem 2rem;
}

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

/* Weather app */
.weather-app {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    transition: background var(--transition-slow);
    background: linear-gradient(to bottom, rgba(30, 58, 95, 1) 0%, rgba(74, 123, 167, 1) 40%, rgba(135, 206, 235, 1) 67%, rgba(44, 82, 130, 1) 100%);
}

#weatherCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Start Screen */
.start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 20;
    background: linear-gradient(135deg, rgba(102, 126, 234, 1) 0%, rgba(118, 75, 162, 1) 100%);
    overflow-y: auto;
    padding: 1rem;
}

.start-content {
    text-align: center;
    color: rgba(255, 255, 255, 1);
    animation: fadeInUp 1s ease-out;
    max-width: 40rem;
    margin: 0 auto;
    padding: 1rem 1rem 2rem;
}

.start-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    text-shadow: 0 0.2rem 1rem rgba(0, 0, 0, 0.3);
}

.start-subtitle {
    font-size: 1rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    text-shadow: 0 0.1rem 0.5rem rgba(0, 0, 0, 0.2);
}

/* SEO Content */
.seo-content {
    text-align: left;
    margin: 2rem 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(0.5rem);
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 0.05rem solid rgba(255, 255, 255, 0.2);
}

.seo-heading {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
    color: #fff;
    text-shadow: 0 0.1rem 0.5rem rgba(0, 0, 0, 0.3);
}

.seo-description {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
}

/* Cards grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Common card styles */
.card,
.feature,
.tag,
.use-case,
.weather-type-card,
.use-case-card {
    background: rgba(255, 255, 255, 0.05);
    border: 0.05rem solid rgba(255, 255, 255, 0.2);
    transition: all var(--transition-fast);
}

.card:hover,
.tag:hover,
.weather-type-card:hover,
.use-case-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-0.1rem);
}

.feature {
    padding: 1.5rem;
    border-radius: var(--radius-md);
}

.feature h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    color: #fff;
}

.feature p {
    font-size: 0.85rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.8);
}

/* Tag lists */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.tag-list ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tag {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: var(--pad-md);
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    flex-shrink: 0;
}

.tag strong {
    color: #fff;
    font-weight: 600;
}

/* Section headings */
.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #fff;
    text-align: center;
}

/* Sound types and use cases layouts */
.sound-types,
.use-cases {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.sound-types > h3,
.use-cases > h3 {
    width: 100%;
    text-align: center;
    margin-bottom: 0.5rem;
}

/* Benefits */
.benefits {
    background: rgba(255, 255, 255, 0.05);
    border: 0.05rem solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.benefits h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #fff;
    text-align: center;
}

.benefits ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.benefits li {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
}

/* Visualization */
.visualization {
    background: rgba(255, 255, 255, 0.05);
    border: 0.05rem solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.visualization h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    color: #fff;
    text-align: center;
}

.visualization p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    line-height: 1.5;
}

/* Weather type and use case cards */
.weather-type-card,
.use-case-card {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: var(--pad-md);
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.weather-emoji {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.use-emoji {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.weather-info,
.use-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
}

.weather-name,
.use-name {
    font-weight: 600;
    color: #fff;
}

.weather-name {
    font-size: 1rem;
}

.use-name {
    font-size: 0.95rem;
}

.weather-desc,
.use-desc {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
}

.use-desc {
    font-size: 0.8rem;
}

.use-case {
    padding: 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.9);
}

/* Footer */
.seo-footer {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 0.05rem solid rgba(255, 255, 255, 0.2);
}

.seo-note {
    font-size: 0.9rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    font-style: italic;
}

/* Start button */
.start-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 0.1rem solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: var(--pad-3xl);
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    cursor: pointer;
    backdrop-filter: blur(1rem);
    transition: all var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 0.4rem 1.6rem rgba(0, 0, 0, 0.2);
}

.start-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.start-btn.floating {
    position: fixed;
    bottom: 1.5rem;
    left: 0;
    right: 0;
    margin: 0 auto;
    z-index: 30;
    box-shadow: 0 0.6rem 2rem rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
    min-width: 10rem;
    max-width: 17rem;
}

.start-btn.floating:hover {
    transform: translateY(-0.1rem);
    box-shadow: 0 0.8rem 2.5rem rgba(0, 0, 0, 0.5);
}

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

/* Controls */
.weather-controls {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(1rem);
    border-radius: var(--radius-2xl);
    padding: var(--pad-2xl);
    display: flex;
    gap: 0.4rem;
    align-items: center;
    box-shadow: 0 0.6rem 2rem rgba(0, 0, 0, 0.4);
    border: 0.05rem solid rgba(255, 255, 255, 0.2);
}

/* Common button styles */
.btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    border-radius: var(--radius-xl);
    font-weight: 500;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    transform: translateY(-0.1rem);
}

.btn.active {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    box-shadow: 0 0.2rem 0.8rem rgba(255, 255, 255, 0.1);
}

.weather-btn,
.back-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    border-radius: var(--radius-xl);
    font-weight: 500;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.weather-btn:hover,
.back-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    transform: translateY(-0.1rem);
}

.weather-btn.active,
.back-btn.active {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    box-shadow: 0 0.2rem 0.8rem rgba(255, 255, 255, 0.1);
}

.weather-btn {
    padding: var(--pad-xl);
    font-size: 0.9rem;
    min-width: 4rem;
}

.back-btn {
    padding: var(--pad-lg);
    font-size: 0.85rem;
    min-width: 3rem;
    margin-right: 0.2rem;
}

.weather-icon {
    font-size: 1.4rem;
    line-height: 1;
}

.back-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.weather-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.back-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Weather backgrounds */
.weather-app[data-weather="sunny"] {
    background:
        radial-gradient(ellipse at 70% 30%, rgba(255, 255, 200, 0.4) 0%, transparent 50%),
        linear-gradient(to bottom, #4a7c9e 0%, #7ba7c7 40%, #b8d4a3 67%, #6b8e5a 100%);
}

.weather-app[data-weather="snow"] {
    background: linear-gradient(to bottom, #1e3a5f 0%, #4a7ba7 40%, #87ceeb 67%, #2c5282 100%);
}

.weather-app[data-weather="windy"] {
    background:
        radial-gradient(ellipse at 50% 20%, rgba(180, 180, 180, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 15%, rgba(200, 200, 200, 0.2) 0%, transparent 60%),
        linear-gradient(to bottom, #4a5568 0%, #718096 40%, #a0aec0 67%, #718096 100%);
}

.weather-app[data-weather="rain"] {
    background:
        radial-gradient(ellipse at 60% 40%, rgba(120, 120, 130, 0.2) 0%, transparent 70%),
        linear-gradient(to bottom, #2d3748 0%, #4a5568 40%, #718096 67%, #4a5568 100%);
}

.weather-app[data-weather="thunder"] {
    background:
        radial-gradient(ellipse at 10% 15%, rgba(20, 20, 30, 0.8) 0%, transparent 40%),
        radial-gradient(ellipse at 85% 12%, rgba(25, 25, 35, 0.7) 0%, transparent 45%),
        radial-gradient(ellipse at 5% 25%, rgba(15, 15, 25, 0.6) 0%, transparent 35%),
        radial-gradient(ellipse at 90% 30%, rgba(30, 30, 40, 0.5) 0%, transparent 40%),
        radial-gradient(ellipse at 15% 35%, rgba(20, 20, 30, 0.6) 0%, transparent 35%),
        linear-gradient(to bottom, #000000 0%, #1a202c 40%, #4a5568 67%, #1a1a1a 100%);
}

.weather-app[data-weather="foggy"] {
    background: linear-gradient(to bottom, #d3d3d3 0%, #b8b8b8 50%, #808080 100%);
}

.weather-app[data-weather="ocean"] {
    background:
        linear-gradient(to bottom,
            transparent 0%,
            transparent 49%,
            rgba(168, 137, 168, 0.15) 50.1%,
            rgba(139, 107, 157, 0.12) 60%,
            rgba(107, 76, 138, 0.08) 70%,
            rgba(74, 44, 125, 0.05) 80%,
            rgba(45, 27, 105, 0.02) 90%,
            transparent 100%),
        linear-gradient(to bottom,
            #1a1a2e 0%,
            #2d1b69 15%,
            #4a2c7d 30%,
            #6b4c8a 40%,
            #8b6b9d 45%,
            #a889a8 49.9%,
            #1e4a6b 50.1%,
            #2c5f7d 75%,
            #1a4d66 100%);
    position: relative;
}

.weather-app[data-weather="ocean"]::before {
    content: '';
    position: absolute;
    top: 49.95%;
    left: 0;
    right: 0;
    height: 0.1vh;
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0.1) 100%);
    z-index: 2;
    pointer-events: none;
}

.weather-app[data-weather="cloudy"] {
    background: linear-gradient(to bottom, #1f2937 0%, #2c3e50 50%, #34495e 100%);
}

/* Responsive */
@media (max-width: 38rem) {
    .start-title {
        font-size: 2.5rem;
    }

    .start-subtitle {
        font-size: 1rem;
    }

    .start-btn {
        padding: 0.7rem 1.6rem;
        font-size: 1rem;
    }

    .weather-controls {
        bottom: 1rem;
        padding: var(--pad-md);
        gap: 0.15rem;
        max-width: calc(100vw - 2rem);
        overflow-x: auto;
        justify-content: flex-start;
        flex-wrap: nowrap;
    }

    .weather-btn {
        padding: var(--pad-md);
        min-width: 3.25rem;
        flex-shrink: 0;
    }

    .back-btn {
        padding: var(--pad-md);
        min-width: 2.75rem;
        flex-shrink: 0;
    }

    .weather-icon {
        font-size: 1.1rem;
    }

    .back-icon {
        font-size: 1rem;
    }

    .weather-label,
    .back-label {
        font-size: 0.6rem;
        letter-spacing: 0.02em;
    }

    .weather-emoji {
        font-size: 1.3rem;
    }

    .use-emoji {
        font-size: 1.1rem;
    }
}

@media (max-width: 24rem) {
    .start-title {
        font-size: 2rem;
    }

    .weather-controls {
        bottom: 0.75rem;
        left: 1rem;
        right: 1rem;
        transform: none;
        padding: var(--pad-sm);
        gap: 0.1rem;
        border-radius: 1.25rem;
    }

    .weather-btn {
        padding: var(--pad-sm);
        min-width: 2.9rem;
    }

    .back-btn {
        padding: var(--pad-sm);
        min-width: 2.5rem;
    }

    .weather-icon {
        font-size: 1rem;
    }

    .back-icon {
        font-size: 0.9rem;
    }

    .weather-label,
    .back-label {
        font-size: 0.55rem;
        line-height: 1.2;
    }

    .weather-controls::-webkit-scrollbar {
        display: none;
    }
}

@media (max-width: 18rem) {
    .weather-controls {
        bottom: 0.5rem;
        left: 0.75rem;
        right: 0.75rem;
        padding: var(--pad-xs);
        gap: 0.05rem;
    }

    .weather-btn {
        padding: var(--pad-xs);
        min-width: 2.6rem;
    }

    .back-btn {
        padding: var(--pad-xs);
        min-width: 2.25rem;
    }

    .weather-icon {
        font-size: 0.9rem;
    }

    .back-icon {
        font-size: 0.8rem;
    }

    .weather-label,
    .back-label {
        font-size: 0.5rem;
    }
}