/* ================================================
   work.toys - Major UI/UX Overhaul
   Modern, new-age, minimalistic, conversion-focused
   ================================================ */

/* ------------------------------------------------
   0. FULL-WIDTH LAYOUT - No fixed container caps
   Content uses 100% available width with padding
   ------------------------------------------------ */
:root {
    --container-max: 100%;
    --container-narrow: 100%;
}

.container,
.header__container {
    max-width: 100%;
    padding: 0 var(--space-6);
}

.hero__container {
    max-width: 100%;
    padding: 0 var(--space-6);
}

/* Increase side padding on larger screens for readability */
@media (min-width: 769px) {
    .container,
    .header__container,
    .hero__container {
        padding: 0 var(--space-8, 2rem);
    }
}

@media (min-width: 1200px) {
    .container,
    .header__container,
    .hero__container {
        padding: 0 clamp(2rem, 4vw, 4rem);
    }
}

/* ------------------------------------------------
   1. SCROLL REVEAL ANIMATIONS
   Elements fade in as they enter viewport
   ------------------------------------------------ */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* Stagger children */
.stagger-children > * {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.stagger-children.revealed > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-children.revealed > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-children.revealed > *:nth-child(3) { transition-delay: 0.15s; }
.stagger-children.revealed > *:nth-child(4) { transition-delay: 0.2s; }
.stagger-children.revealed > *:nth-child(5) { transition-delay: 0.25s; }
.stagger-children.revealed > *:nth-child(6) { transition-delay: 0.3s; }
.stagger-children.revealed > *:nth-child(7) { transition-delay: 0.35s; }
.stagger-children.revealed > *:nth-child(8) { transition-delay: 0.4s; }

.stagger-children.revealed > * {
    opacity: 1;
    transform: translateY(0);
}

/* ------------------------------------------------
   2. HERO - Dramatic, bold, conversion-focused
   ------------------------------------------------ */
.hero {
    padding: calc(var(--header-height) + var(--space-24)) 0 var(--space-20);
    min-height: 85vh;
    display: flex;
    align-items: center;
    position: relative;
}

.hero__background {
    opacity: 0.8;
    background:
        radial-gradient(ellipse 80% 60% at 50% -10%, rgba(139, 92, 246, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 50%, rgba(255, 92, 77, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse 50% 40% at 20% 80%, rgba(139, 92, 246, 0.08) 0%, transparent 50%);
}

/* Animated gradient orb behind hero */
.hero::after {
    content: '';
    position: absolute;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 92, 77, 0.06) 0%, transparent 70%);
    filter: blur(60px);
    animation: pulse-glow 8s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes pulse-glow {
    0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.6; }
    50% { transform: translateX(-50%) scale(1.15); opacity: 1; }
}

.hero__title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.05;
    margin-bottom: var(--space-6);
}

.hero__title-accent {
    background: linear-gradient(135deg, var(--color-accent) 0%, #c44dff 50%, var(--color-secondary) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 6s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 100% center; }
}

.hero__subtitle {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    max-width: 540px;
    line-height: 1.7;
    color: var(--color-text-secondary);
}

.hero__cta {
    margin-top: var(--space-8);
    margin-bottom: var(--space-10);
}

.hero__cta .btn--primary {
    padding: var(--space-4) var(--space-8);
    font-size: var(--font-size-lg);
    font-weight: 700;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--color-accent) 0%, #e84040 100%);
    box-shadow: 0 4px 20px rgba(255, 92, 77, 0.3);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero__cta .btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(255, 92, 77, 0.4);
}

.hero__secondary-links a {
    position: relative;
}

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

.hero__secondary-links a:hover::after {
    width: 100%;
}

/* ------------------------------------------------
   3. SECTION HEADERS - Bolder, cleaner
   ------------------------------------------------ */
.section-title {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.section-badge {
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.7rem;
    font-weight: 700;
    padding: var(--space-1) var(--space-3);
}

/* ------------------------------------------------
   4. CARDS - Glass morphism + deeper interactions
   ------------------------------------------------ */
.toy-card {
    border: 1px solid var(--color-border);
    background: var(--color-bg-elevated);
    border-radius: var(--radius-xl);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

/* Subtle gradient border on hover */
.toy-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255, 92, 77, 0.5), rgba(139, 92, 246, 0.5));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.toy-card:hover::before {
    opacity: 1;
}

.toy-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.15);
    border-color: transparent;
}

[data-theme="dark"] .toy-card:hover {
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.5);
}

.toy-card__preview {
    height: 140px;
    position: relative;
    overflow: hidden;
}

/* Shine effect on card hover */
.toy-card__preview::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.6s ease;
    z-index: 1;
}

.toy-card:hover .toy-card__preview::after {
    left: 150%;
}

.toy-card__arrow {
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.toy-card:hover .toy-card__arrow {
    transform: translateX(6px);
    color: var(--color-accent);
}

/* ------------------------------------------------
   5. CATEGORY CARDS - More modern
   ------------------------------------------------ */
.category-card {
    border-radius: var(--radius-2xl);
    padding: var(--space-6) var(--space-4);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.category-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--color-accent-subtle), var(--color-secondary-subtle));
    opacity: 0;
    transition: opacity 0.35s ease;
    z-index: 0;
}

.category-card:hover::after {
    opacity: 1;
}

.category-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.12);
    border-color: var(--color-accent);
}

.category-card > * {
    position: relative;
    z-index: 1;
}

.category-card__icon {
    font-size: 2.5rem;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.category-card:hover .category-card__icon {
    transform: scale(1.15);
}

/* ------------------------------------------------
   6. COLLECTION CARDS - Richer hover
   ------------------------------------------------ */
.collection-card {
    border-radius: var(--radius-2xl);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.collection-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.15);
}

.collection-card__header {
    height: 120px;
    transition: height 0.35s ease;
}

.collection-card:hover .collection-card__header {
    height: 130px;
}

.collection-card__icon {
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.collection-card:hover .collection-card__icon {
    transform: scale(1.2) rotate(-5deg);
}

/* ------------------------------------------------
   7. CTA SECTION - More impactful
   ------------------------------------------------ */
.cta-card {
    border-radius: var(--radius-2xl);
    padding: var(--space-16) var(--space-8);
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #FF5C4D 0%, #c44dff 50%, #8B5CF6 100%);
    background-size: 200% 200%;
    animation: cta-gradient 8s ease infinite;
}

@keyframes cta-gradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.cta-card__title {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.cta-card .btn--primary {
    padding: var(--space-4) var(--space-8);
    font-size: var(--font-size-lg);
    font-weight: 700;
    border-radius: var(--radius-full);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cta-card .btn--primary:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* ------------------------------------------------
   8. NEWSLETTER - Glass card
   ------------------------------------------------ */
.newsletter {
    background: var(--color-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--color-glass-border);
    border-radius: var(--radius-2xl);
    padding: var(--space-10);
}

/* ------------------------------------------------
   9. FEATURED SLIDER - Better card sizing
   ------------------------------------------------ */
.featured__track .toy-card {
    flex: 0 0 300px;
}

/* ------------------------------------------------
   10. FOOTER - Cleaner, more minimal
   ------------------------------------------------ */
.footer {
    padding: var(--space-16) 0 var(--space-10);
    background: var(--color-bg);
    border-top: none;
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-border), transparent);
}

.footer__logo {
    font-size: var(--font-size-2xl);
}

.footer__disclosure {
    margin-top: var(--space-4);
    padding: var(--space-4) 0;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    text-align: center;
}

/* ------------------------------------------------
   11. TOY SPOTLIGHT - More dramatic
   ------------------------------------------------ */
.toy-spotlight__card {
    border-radius: var(--radius-2xl);
    overflow: hidden;
    transition: all 0.35s ease;
}

.toy-spotlight__card:hover {
    box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.12);
}

.toy-spotlight__badge {
    backdrop-filter: blur(8px);
    background: rgba(255, 92, 77, 0.9);
}

/* ------------------------------------------------
   12. TRAITS LEGEND - More visual
   ------------------------------------------------ */
.traits-legend__card {
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
}

.traits-legend__title {
    font-size: var(--font-size-xl);
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* ------------------------------------------------
   13. HEADER - Tighter, more polished
   ------------------------------------------------ */
.header {
    height: 56px;
    --header-height: 56px;
}

.header__logo {
    font-weight: 800;
    letter-spacing: -0.02em;
}

.header__search {
    border-radius: var(--radius-lg);
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
}

.header__search:focus-within {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(255, 92, 77, 0.1);
}

/* ------------------------------------------------
   14. SMOOTH SCROLLBAR
   ------------------------------------------------ */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--color-text-muted);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-secondary);
}

/* ------------------------------------------------
   15. SELECTION COLOR
   ------------------------------------------------ */
::selection {
    background: rgba(255, 92, 77, 0.2);
    color: var(--color-text);
}

/* ------------------------------------------------
   16. SECTION DIVIDERS - Gradient lines
   ------------------------------------------------ */
.categories,
.toys-grid-section {
    position: relative;
}

.categories::before,
.toys-grid-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-border), transparent);
}

/* ------------------------------------------------
   17. BUTTONS - More pill-shaped, modern
   ------------------------------------------------ */
.btn--primary {
    border-radius: var(--radius-full);
    font-weight: 700;
}

.btn--secondary {
    border-radius: var(--radius-full);
}

.btn--ghost {
    border-radius: var(--radius-full);
}

/* ------------------------------------------------
   18. REDUCED MOTION - Respect accessibility
   ------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .stagger-children > * {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .hero::after {
        animation: none;
    }
    .hero__title-accent {
        animation: none;
    }
    .cta-card {
        animation: none;
    }
    .toy-card__preview::after {
        display: none;
    }
}

/* ------------------------------------------------
   19. RESPONSIVE - Comprehensive mobile/tablet/desktop
   ------------------------------------------------ */

/* === SMALL MOBILE (≤480px) === */
@media (max-width: 480px) {
    .hero {
        min-height: 60vh;
        padding-top: calc(56px + var(--space-10));
        padding-bottom: var(--space-8);
    }

    .hero__title {
        font-size: 1.875rem;
        line-height: 1.1;
    }

    .hero__subtitle {
        font-size: 1rem;
        line-height: 1.6;
    }

    .hero__cta {
        margin-top: var(--space-6);
        margin-bottom: var(--space-6);
    }

    .hero__cta .btn--primary {
        width: 100%;
        justify-content: center;
        padding: var(--space-4) var(--space-5);
        font-size: var(--font-size-base);
    }

    .hero__secondary-links {
        flex-direction: column;
        gap: var(--space-2);
    }

    .hero__link-divider {
        display: none;
    }

    .section-title {
        font-size: 1.25rem;
    }

    .categories__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-3);
    }

    .category-card {
        padding: var(--space-4) var(--space-3);
    }

    .category-card__icon {
        font-size: 1.75rem;
    }

    .toys-grid,
    .this-week__grid,
    .new-noteworthy__grid,
    .tiny-new__grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .collections__grid {
        grid-template-columns: 1fr;
    }

    .cta-card {
        padding: var(--space-8) var(--space-5);
    }

    .cta-card__title {
        font-size: 1.25rem;
    }

    .toy-card:hover,
    .collection-card:hover,
    .category-card:hover {
        transform: none;
    }

    .toy-card__preview::after {
        display: none;
    }

    .footer__content {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }

    .footer__links {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-4);
    }

    .traits-legend__card {
        padding: var(--space-5);
    }

    /* Fix touch targets - min 44px */
    .btn, .category-card, .toy-card__save {
        min-height: 44px;
    }

    .header__mobile-menu {
        min-width: 44px;
        min-height: 44px;
    }
}

/* === MOBILE (≤768px) === */
@media (max-width: 768px) {
    .hero {
        min-height: 65vh;
        padding-top: calc(56px + var(--space-12));
        padding-bottom: var(--space-10);
    }

    .hero__title {
        font-size: 2.25rem;
    }

    .hero__cta .btn--primary {
        width: 100%;
        justify-content: center;
        padding: var(--space-4) var(--space-6);
    }

    .cta-card {
        padding: var(--space-10) var(--space-6);
    }

    .toy-card:hover {
        transform: translateY(-3px);
    }

    /* Stack newsletter on mobile */
    .newsletter-inline {
        flex-direction: column;
        text-align: center;
    }

    .newsletter-inline__form {
        width: 100%;
        flex-direction: column;
    }

    .newsletter-inline__form input[type="email"] {
        width: 100%;
    }

    /* Staff picks horizontal scroll on mobile */
    .staff-picks__track {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: var(--space-4);
    }

    .staff-picks__track::-webkit-scrollbar {
        display: none;
    }

    .staff-picks__track .toy-card {
        flex: 0 0 260px;
    }

    /* Featured partners same */
    .featured__track {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .featured__track::-webkit-scrollbar {
        display: none;
    }

    /* Footer stacked */
    .footer__bottom {
        flex-direction: column;
        text-align: center;
        gap: var(--space-4);
    }

    /* Disable hover effects on touch */
    .toy-card::before {
        display: none;
    }
}

/* === TABLET (769px - 1024px) === */
@media (min-width: 769px) and (max-width: 1024px) {
    .hero {
        min-height: 75vh;
    }

    .hero__title {
        font-size: 3rem;
    }

    .categories__grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .toys-grid,
    .this-week__grid,
    .new-noteworthy__grid,
    .tiny-new__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .collections__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .staff-picks__track .toy-card {
        flex: 0 0 280px;
    }
}

/* === LARGE DESKTOP (≥1200px) === */
@media (min-width: 1200px) {
    .hero__title {
        font-size: 4.5rem;
    }

    .toys-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .collections__grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* === ULTRA-WIDE (≥1440px) === */
@media (min-width: 1440px) {
    .container {
        max-width: 100%;
        padding: 0 clamp(2rem, 5vw, 5rem);
    }

    .toys-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ------------------------------------------------
   20. DARK MODE ENHANCEMENTS
   ------------------------------------------------ */
[data-theme="dark"] .hero::after {
    background: radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
}

[data-theme="dark"] .hero__background {
    opacity: 0.5;
    background:
        radial-gradient(ellipse 80% 60% at 50% -10%, rgba(139, 92, 246, 0.2) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 50%, rgba(255, 92, 77, 0.12) 0%, transparent 50%);
}

[data-theme="dark"] .hero__cta .btn--primary {
    box-shadow: 0 4px 20px rgba(255, 92, 77, 0.2);
}

[data-theme="dark"] .category-card:hover {
    box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .collection-card:hover {
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .footer::before,
[data-theme="dark"] .categories::before,
[data-theme="dark"] .toys-grid-section::before {
    background: linear-gradient(90deg, transparent, var(--color-border-subtle), transparent);
}

[data-theme="dark"] .cta-card .btn--primary:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
