/* Noise Machine - Shared Design System
   Aesthetic: Sensory Immersion - Deep, atmospheric, meditative */

/* === FONTS === */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Crimson+Pro:ital,wght@0,400;0,500;1,400&display=swap');

/* === CSS RESET & BASE === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--bg-deep);
    color: var(--text-primary);
}

/* === GLOBAL CONTENT SECTIONS (Dark Theme) === */
.content-section {
    background: transparent;
}

.content-section--alt {
    background: rgba(255, 255, 255, 0.015);
}

/* === DESIGN TOKENS === */
:root {
    /* Base dark theme */
    --bg-deep: #050508;
    --bg-surface: rgba(12, 12, 15, 0.95);
    --bg-elevated: rgba(20, 20, 25, 0.9);
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);

    /* Text */
    --text-primary: #F8F8FA;
    --text-secondary: #A8B0BC;
    --text-muted: #8A929E;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;

    /* Typography */
    --font-display: 'Outfit', sans-serif;
    --font-body: 'Outfit', sans-serif;
    --font-serif: 'Crimson Pro', Georgia, serif;

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 800;
    letter-spacing: -0.035em;
}

h2 {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
}

h3 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
}

p {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

.lead {
    font-size: clamp(1.125rem, 2.5vw, 1.35rem);
    line-height: 1.7;
}

.serif {
    font-family: var(--font-serif);
    font-style: italic;
}

/* === LAYOUT === */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.container--narrow {
    max-width: 800px;
}

.container--wide {
    max-width: 1400px;
}

section {
    position: relative;
    z-index: 1;
}

/* === AMBIENT BACKGROUND SYSTEM === */
.ambient-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.ambient-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--bg-deep);
}

/* Animated gradient orbs */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0;
    animation: orb-fade-in 2s var(--ease-out) forwards;
}

@keyframes orb-fade-in {
    to { opacity: var(--orb-opacity, 0.4); }
}

@keyframes orb-drift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -20px) scale(1.05); }
    50% { transform: translate(-20px, 30px) scale(0.95); }
    75% { transform: translate(20px, 20px) scale(1.02); }
}

@keyframes orb-pulse {
    0%, 100% { opacity: var(--orb-opacity, 0.4); transform: scale(1); }
    50% { opacity: calc(var(--orb-opacity, 0.4) * 1.3); transform: scale(1.08); }
}

/* Wave system */
.waves-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100%;
    overflow: hidden;
    opacity: 0.15;
}

.wave {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 200%;
    height: 100%;
    transform: translateX(-50%);
    background-repeat: repeat-x;
    background-size: 50% 100px;
}

@keyframes wave-flow {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(-25%); }
}

/* Particle canvas */
#particles-canvas {
    position: absolute;
    inset: 0;
    opacity: 0.6;
}

/* Noise texture overlay */
.noise-overlay {
    position: absolute;
    inset: 0;
    opacity: 0.03;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* === NAVIGATION === */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: var(--space-md) var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom,
        rgba(5, 5, 8, 0.98) 0%,
        rgba(5, 5, 8, 0.85) 60%,
        transparent 100%);
    animation: nav-enter 0.8s var(--ease-out) both;
}

@keyframes nav-enter {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.nav__logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.05rem;
}

.nav__logo-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.nav__logo-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nav__links {
    display: none;
    gap: var(--space-xl);
    list-style: none;
}

@media (min-width: 768px) {
    .nav__links {
        display: flex;
    }
}

.nav__link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav__link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-accent, #fff);
    transform: scaleX(0);
    transition: transform 0.3s var(--ease-out);
}

.nav__link:hover {
    color: var(--text-primary);
}

.nav__link:hover::after {
    transform: scaleX(1);
}

.nav__link--active {
    color: var(--text-primary);
}

.nav__cta {
    background: var(--bg-elevated);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.3s var(--ease-out);
}

.nav__cta:hover {
    background: var(--bg-surface);
    border-color: var(--color-accent, #fff);
    box-shadow: 0 0 30px rgba(var(--color-accent-rgb, 255, 255, 255), 0.2);
}

/* Mobile menu */
.nav__mobile-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-xs);
}

@media (min-width: 768px) {
    .nav__mobile-toggle {
        display: none;
    }
}

.nav__mobile-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s ease;
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.9rem 1.75rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.3s var(--ease-out);
}

.btn--primary {
    background: linear-gradient(135deg,
        var(--color-accent-light, #fff) 0%,
        var(--color-accent, #ccc) 100%);
    color: var(--bg-deep);
    box-shadow:
        0 4px 20px rgba(var(--color-accent-rgb, 255, 255, 255), 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn--primary:hover {
    transform: translateY(-3px);
    box-shadow:
        0 8px 40px rgba(var(--color-accent-rgb, 255, 255, 255), 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn--secondary {
    background: var(--bg-elevated);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
}

.btn--secondary:hover {
    background: var(--bg-surface);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.btn--ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn--ghost:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.btn svg {
    width: 20px;
    height: 20px;
}

/* Store buttons */
.store-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--bg-elevated);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s var(--ease-out);
}

.store-btn:hover {
    background: var(--bg-surface);
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.store-btn svg {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
}

.store-btn__text {
    text-align: left;
}

.store-btn__label {
    font-size: 0.65rem;
    color: var(--text-muted);
    line-height: 1.2;
}

.store-btn__name {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.3;
}

/* === CARDS === */
.card {
    background: var(--bg-elevated);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    transition: all 0.35s var(--ease-out);
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--border-hover);
    box-shadow: 0 20px 50px -15px rgba(0, 0, 0, 0.5);
}

/* === ANIMATIONS === */
@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

@keyframes scale-in {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes breathe {
    0%, 100% { transform: scale(1); opacity: var(--breathe-opacity, 0.5); }
    50% { transform: scale(1.08); opacity: calc(var(--breathe-opacity, 0.5) * 1.4); }
}

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

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.animate-fade-up {
    animation: fade-up 0.8s var(--ease-out) both;
}

.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }
.animate-delay-5 { animation-delay: 0.5s; }

/* === FOOTER === */
.footer {
    padding: var(--space-xl) var(--space-lg) var(--space-2xl);
    text-align: center;
    border-top: 1px solid var(--border-subtle);
    position: relative;
    z-index: 1;
}

.footer__links {
    display: flex;
    justify-content: center;
    gap: var(--space-xl);
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
}

.footer__link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.3s ease;
}

.footer__link:hover {
    color: var(--text-secondary);
}

.footer__copy {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* === RESPONSIVE === */
@media (min-width: 768px) {
    .nav {
        padding: var(--space-lg) var(--space-2xl);
    }

    .container {
        padding: 0 var(--space-2xl);
    }
}

@media (min-width: 1024px) {
    html {
        font-size: 17px;
    }
}

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

:focus-visible {
    outline: 2px solid var(--color-accent, #fff);
    outline-offset: 3px;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-surface);
    color: var(--text-primary);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    z-index: 1000;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: var(--space-md);
}

/* === UTILITY CLASSES === */
.text-center { text-align: center; }
.text-gradient {
    background: linear-gradient(135deg, var(--color-accent-light) 0%, var(--color-accent) 50%, var(--color-accent-dark, var(--color-accent)) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Selection color */
::selection {
    background: rgba(var(--color-accent-rgb, 255, 255, 255), 0.3);
    color: var(--text-primary);
}

/* === AUDIO PLAYER === */
.audio-player {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    max-width: 480px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.audio-player::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light, var(--color-accent)));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.audio-player.is-playing::before {
    opacity: 1;
}

.audio-player__header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.audio-player__title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.audio-player__subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Play Button */
.audio-player__play {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--color-accent-light, var(--color-accent)), var(--color-accent));
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-xl);
    position: relative;
    transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
    box-shadow: 0 4px 20px rgba(var(--color-accent-rgb, 255, 255, 255), 0.3);
}

.audio-player__play:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(var(--color-accent-rgb, 255, 255, 255), 0.4);
}

.audio-player__play:active {
    transform: scale(0.98);
}

.audio-player__play svg {
    width: 32px;
    height: 32px;
    fill: var(--bg-deep);
    transition: transform 0.2s ease;
}

.audio-player__play .icon-pause {
    display: none;
}

.audio-player.is-playing .audio-player__play .icon-play {
    display: none;
}

.audio-player.is-playing .audio-player__play .icon-pause {
    display: block;
}

/* Pulse animation when playing */
.audio-player.is-playing .audio-player__play {
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(var(--color-accent-rgb, 255, 255, 255), 0.3);
    }
    50% {
        box-shadow: 0 4px 40px rgba(var(--color-accent-rgb, 255, 255, 255), 0.5);
    }
}

/* Preset Buttons */
.audio-player__presets {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}

.audio-player__presets-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.audio-player__preset-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.audio-player__preset {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    cursor: pointer;
    text-align: left;
    transition: all 0.3s var(--ease-out);
    color: var(--text-primary);
    font-family: inherit;
}

.audio-player__preset:hover {
    border-color: var(--border-hover);
    background: rgba(var(--color-accent-rgb, 255, 255, 255), 0.05);
}

.audio-player__preset.is-active {
    border-color: var(--color-accent);
    background: rgba(var(--color-accent-rgb, 255, 255, 255), 0.1);
}

.audio-player__preset-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.audio-player__preset-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: right;
}

/* Custom Controls */
.audio-player__custom {
    border-top: 1px solid var(--border-subtle);
    padding-top: var(--space-lg);
    margin-top: var(--space-lg);
}

.audio-player__custom-toggle {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    margin: 0 auto;
    padding: var(--space-sm) var(--space-md);
    transition: color 0.3s ease;
}

.audio-player__custom-toggle:hover {
    color: var(--text-primary);
}

.audio-player__custom-toggle svg {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    fill: currentColor;
    transition: transform 0.3s ease;
}

.audio-player__custom-toggle.is-open svg {
    transform: rotate(180deg);
}

.audio-player__sliders {
    display: none;
    flex-direction: column;
    gap: var(--space-lg);
    margin-top: var(--space-lg);
}

.audio-player__sliders.is-visible {
    display: flex;
}

.audio-player__slider-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.audio-player__slider-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.audio-player__slider-name {
    color: var(--text-secondary);
}

.audio-player__slider-value {
    color: var(--color-accent);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.audio-player__slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-elevated);
    outline: none;
    cursor: pointer;
}

.audio-player__slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-accent);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.audio-player__slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.audio-player__slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-accent);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Volume Control */
.audio-player__volume {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-subtle);
}

.audio-player__volume-icon {
    width: 20px;
    height: 20px;
    fill: var(--text-muted);
    flex-shrink: 0;
}

.audio-player__volume .audio-player__slider {
    flex: 1;
}

/* Mobile Responsive Styles for Audio Player */
@media (max-width: 600px) {
    .audio-player__card {
        padding: var(--space-lg);
    }

    .audio-player__preset {
        padding: var(--space-sm) var(--space-md);
    }

    .audio-player__play {
        width: 72px;
        height: 72px;
    }

    .audio-player__play svg {
        width: 28px;
        height: 28px;
    }
}
