:root {
    --text-color: #333333;
    --border-color: #e0e0e0;
    --button-bg: #f5f5f5;
    --button-hover: #e8e8e8;
    --shadow: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --text-color: #e0e0e0;
    --border-color: #404040;
    --button-bg: #2a2a2a;
    --button-hover: #3a3a3a;
    --shadow: rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #fafaf9 0%, #d6d3d1 100%);
    color: var(--text-color);
    transition: background 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

[data-theme="dark"] body {
    background: linear-gradient(135deg, #1c1917 0%, #44403c 100%);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(250, 250, 249, 0.8);
    backdrop-filter: blur(10px);
    transition: background 0.3s ease;
}

[data-theme="dark"] header {
    background: rgba(28, 25, 23, 0.8);
}

.back-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: var(--button-bg);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
}

.back-button:hover {
    background-color: var(--button-hover);
    transform: translateX(-2px);
}

.back-button svg {
    width: 20px;
    height: 20px;
}

.logo {
    height: 30px;
    width: auto;
    filter: invert(0);
    transition: filter 0.3s ease;
}

[data-theme="dark"] .logo {
    filter: invert(1);
}

.theme-toggle {
    position: relative;
    width: 44px;
    height: 44px;
    border: none;
    background-color: var(--button-bg);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    background-color: var(--button-hover);
    transform: scale(1.05);
}

.theme-toggle svg {
    position: absolute;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.sun-icon {
    opacity: 1;
    transform: rotate(0deg);
}

.moon-icon {
    opacity: 0;
    transform: rotate(-90deg);
}

[data-theme="dark"] .sun-icon {
    opacity: 0;
    transform: rotate(90deg);
}

[data-theme="dark"] .moon-icon {
    opacity: 1;
    transform: rotate(0deg);
}

main {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.controls {
    width: 100%;
    max-width: 600px;
}

.slider-container {
    background-color: transparent;
    padding: 20px;
    border-radius: 12px;
}

.slider-container label {
    display: block;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
}

#heightSlider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border-color);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    margin-bottom: 8px;
}

#heightSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--text-color);
    cursor: pointer;
    transition: transform 0.2s ease;
}

#heightSlider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

#heightSlider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--text-color);
    cursor: pointer;
    transition: transform 0.2s ease;
}

#heightSlider::-moz-range-thumb:hover {
    transform: scale(1.2);
}


.metronome-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.hero-section {
    width: 100%;
    max-width: 900px;
    text-align: center;
    margin-bottom: 40px;
}

.hero-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
    color: var(--text-color);
}

.hero-section .intro {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--text-color);
    opacity: 0.9;
}

.features-section {
    width: 100%;
    max-width: 900px;
    margin-top: 60px;
    padding: 40px 20px;
}

.features-section h2 {
    font-size: 1.875rem;
    font-weight: 600;
    margin-bottom: 30px;
    text-align: center;
    color: var(--text-color);
}

.features-list {
    list-style: none;
    padding: 0;
    display: grid;
    gap: 20px;
}

.features-list li {
    padding-left: 30px;
    position: relative;
    line-height: 1.6;
    font-size: 1rem;
    color: var(--text-color);
}

.features-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #4CAF50;
    font-weight: bold;
    font-size: 1.2rem;
}

[data-theme="dark"] .features-list li::before {
    color: #66BB6A;
}

.features-list strong {
    font-weight: 600;
    color: var(--text-color);
}

.why-section {
    width: 100%;
    max-width: 900px;
    margin-top: 60px;
    padding: 40px 20px;
}

.why-section h2 {
    font-size: 1.875rem;
    font-weight: 600;
    margin-bottom: 30px;
    text-align: center;
    color: var(--text-color);
}

.why-section p {
    font-size: 1.0625rem;
    line-height: 1.7;
    margin-bottom: 20px;
    color: var(--text-color);
    text-align: left;
}

.benefits-list {
    list-style: none;
    padding: 0;
    margin: 20px 0 30px 0;
    display: grid;
    gap: 15px;
}

.benefits-list li {
    padding-left: 30px;
    position: relative;
    line-height: 1.6;
    font-size: 1rem;
    color: var(--text-color);
}

.benefits-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: #2196F3;
    font-weight: bold;
    font-size: 1.2rem;
}

[data-theme="dark"] .benefits-list li::before {
    color: #64B5F6;
}

#metronomeFrame {
    width: 100%;
    height: 800px;
    border: none;
    border-radius: 12px;
    background: transparent;
    transition: height 0.3s ease;
}

@media (max-width: 768px) {
    header {
        padding: 15px 20px;
    }
    
    main {
        padding: 20px;
    }
    
    .back-button span {
        display: none;
    }
    
    .back-button {
        padding: 10px;
    }
    
    .hero-section h1 {
        font-size: 1.75rem;
    }
    
    .hero-section .intro {
        font-size: 1rem;
    }
    
    .features-section {
        padding: 30px 15px;
    }
    
    .features-section h2 {
        font-size: 1.5rem;
    }
    
    .features-list li {
        font-size: 0.95rem;
    }
    
    #metronomeFrame {
        height: 600px;
    }
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-color: #1a1a1a;
        --text-color: #e0e0e0;
        --border-color: #404040;
        --button-bg: #2a2a2a;
        --button-hover: #3a3a3a;
        --shadow: rgba(0, 0, 0, 0.3);
    }
    
    :root:not([data-theme="light"]) .sun-icon {
        opacity: 0;
        transform: rotate(90deg);
    }
    
    :root:not([data-theme="light"]) .moon-icon {
        opacity: 1;
        transform: rotate(0deg);
    }
}