/*
 * ========================================
 * BASE
 * ========================================
 */

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-slogan, sans-serif);
    background: var(--home-color-background);
    color: var(--home-color-text);
}

img {
    display: block;
    max-width: 100%;
}

a {
    text-decoration: none;
    color: inherit;
}

button,
input {
    font: inherit;
}

.page {
    width: 100%;
}

.container {
    width: 100%;
    max-width: var(--home-content-width);
    margin: 0 auto;
    padding: 0 var(--home-side-padding);
}

/*
 * ========================================
 * HERO
 * ========================================
 */

.hero {
    min-height: 820px;
    color: var(--home-color-text);
    background:
        linear-gradient(
            to bottom,
            rgba(5, 11, 26, 0.18) 0%,
            rgba(5, 11, 26, 0.42) 45%,
            rgba(5, 11, 26, 0.7) 100%
        ),
        url("/public/static/img/hero.jpeg") center / cover no-repeat;
}

.site-header {
    position: relative;
    z-index: 20;
    width: 100%;
}

.header-top {
    display: flex;
    align-items: center;
    gap: 32px;
    padding-top: 28px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-family: var(--font-company, sans-serif);
    font-size: var(--home-text-logo);
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.07em;
    color: var(--home-color-text);
}

.logo-mark {
    display: inline-block;
    width: 76px;
    aspect-ratio: 213 / 120;
    flex-shrink: 0;
    background-color: currentColor;
    -webkit-mask: url("/public/static/assets/logo.svg") center / contain no-repeat;
    mask: url("/public/static/assets/logo.svg") center / contain no-repeat;
}

.logo-text {
    display: inline-block;
}

.header-main {
    display: flex;
    align-items: center;
}

.header-actions {
    display: flex;
    align-items: center;
    margin-left: auto;
    gap: 28px;
}

.header-link {
    font-size: var(--home-text-3);
    font-weight: 500;
    color: var(--home-color-text);
    opacity: 0.95;
    transition:
        opacity 0.2s ease,
        color 0.2s ease;
}

.header-link--with-icon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.header-link--button {
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
}

.header-link-icon {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    object-fit: contain;
}

.header-user {
    opacity: 1;
    color: var(--home-color-text);
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 230px;
    text-align: center;
}

.hero-title {
    margin: 0 0 18px;
    font-size: var(--home-text-1);
    font-weight: 700;
    line-height: 1.08;
    color: var(--home-color-text);
}

.hero-subtitle {
    margin: 0 0 42px;
    font-size: var(--home-text-3);
    font-weight: 600;
    line-height: 1.35;
    color: var(--home-color-text);
}

.search-form {
    display: flex;
    width: 100%;
    max-width: 690px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(215, 230, 255, 0.12);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(10px);
}

.search-input {
    flex: 1;
    min-width: 0;
    height: 70px;
    padding: 0 24px;
    border: none;
    outline: none;
    background: var(--color-input-midtone-1);
    color: var(--color-accent-1);
    font-size: var(--home-text-4);
}

.search-input::placeholder {
    color: var(--color-placeholder);
    opacity: 1;
}

.search-button {
    width: 86px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--home-color-brand);
    color: var(--home-color-text);
    opacity: 0.6;
    font-size: var(--home-text-2);
    transition:
        background-color 0.2s ease,
        transform 0.2s ease,
        opacity 0.2s ease;
}

.search-button-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

/*
 * ========================================
 * MAIN TOP
 * ========================================
 */

.main-top {
    padding: 54px 0 78px;
    color: var(--home-color-text);
    background: var(--home-color-main-top, linear-gradient(
        to bottom,
        #050B1B 0%,
        #616D86 24%,
        #DEE0E5 58%,
        #F5F5F5 100%
    ));
}

.places {
    padding-top: 6px;
}

.section-title {
    margin: 0 0 42px;
    text-align: left;
    font-size: var(--home-text-2);
    font-weight: 700;
    line-height: 1.2;
    color: var(--home-color-text);
}

.section-title--light {
    color: var(--home-color-text);
}

.places-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 72px 24px;
}

.card {
    min-width: 0;
    color: var(--home-color-text);
    padding: 12px;
    border: 1px solid transparent;
    border-radius: 18px;
    background: transparent;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease,
        background-color 0.2s ease;
}

.card-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 14px;
}

.card-title {
    display: block;
    max-width: 100%;
    margin: 0 0 4px;
    font-size: var(--home-text-4);
    font-weight: 600;
    line-height: 1.25;
    color: var(--home-color-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-text {
    margin: 0;
    font-size: var(--home-text-5);
    font-weight: 500;
    line-height: 1.45;
    color: var(--home-color-text-muted);
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

/*
 * ========================================
 * MAIN BOTTOM
 * ========================================
 */

.main-bottom {
    padding: 24px 0 56px;
    background: var(--color-blank);
}

.mood-layout {
    display: grid;
    grid-template-columns: 1.03fr 1fr;
    gap: 24px;
}

.mood-left {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.mood-card {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid transparent;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}

.mood-card--wide {
    grid-column: 1 / -1;
    height: 250px;
}

.mood-card:not(.mood-card--wide):not(.mood-card--tall) {
    height: 220px;
}

.mood-card--tall {
    height: 500px;
}

.mood-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mood-tag {
    position: absolute;
    left: 16px;
    bottom: 16px;
    display: inline-flex;
    align-items: center;
    max-width: calc(100% - 32px);
    min-height: 38px;
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--home-color-brand);
    color: var(--home-color-text);
    opacity: 0.9;
    backdrop-filter: blur(12px);
    font-size: var(--home-text-4);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition:
        background-color 0.2s ease,
        opacity 0.2s ease;
}

/*
 * ========================================
 * FOOTER
 * ========================================
 */

.footer {
    padding: 34px 0 22px;
    background: var(--home-color-surface);
    color: var(--home-color-text);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.footer-column {
    padding: 0 20px;
    border-right: 1px solid var(--home-color-border);
}

.footer-column:last-child {
    border-right: none;
}

.footer-title {
    margin: 0 0 14px;
    font-size: var(--home-text-4);
    font-weight: 600;
    color: var(--home-color-text);
}

.footer-text {
    margin: 0 0 10px;
    font-size: var(--home-text-5);
    line-height: 1.5;
}

.footer-link {
    display: block;
    margin-bottom: 10px;
    font-size: var(--home-text-5);
    text-decoration: underline;
    transition:
        color 0.2s ease,
        opacity 0.2s ease;
}

.footer-bottom {
    margin-top: 26px;
    text-align: center;
    font-size: var(--home-text-4);
    color: var(--home-color-text);
}

.footer-bottom p {
    margin: 0 0 10px;
}

.footer-bottom-links {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
}

.footer-bottom-links a {
    text-decoration: underline;
    transition:
        color 0.2s ease,
        opacity 0.2s ease;
}

/*
 * ========================================
 * STATES
 * ========================================
 */

.header-link:hover,
.header-link:focus-visible {
    opacity: 1;
    color: var(--home-color-brand-light);
}

.search-button:hover,
.search-button:focus-visible {
    background: var(--color-background-tone-1);
    opacity: 1;
    transform: translateY(-1px);
}

.search-button:active {
    background: var(--color-accent-2);
    transform: scale(0.98);
    transition: all 0.1s ease-out;
}

.card:hover,
.card:focus-within {
    transform: translateY(-4px);
    border-color: var(--home-color-border);
    background: var(--home-color-card-gradient, rgba(255, 255, 255, 0.22));
    box-shadow: 0 14px 30px var(--home-color-shadow);
}

.mood-card:hover,
.mood-card:focus-within {
    transform: translateY(-4px);
    border-color: var(--home-color-border);
    box-shadow: 0 14px 30px var(--home-color-shadow);
}

.mood-card:hover .mood-tag,
.mood-card:focus-within .mood-tag {
    background: var(--color-accent-3);
    opacity: 1;
}

.mood-card:active .mood-tag {
    background: var(--color-accent-2);
    opacity: 1;
}

.footer-link:hover,
.footer-link:focus-visible,
.footer-bottom-links a:hover,
.footer-bottom-links a:focus-visible {
    color: var(--home-color-brand);
}

@media (prefers-color-scheme: dark) {
    .hero {
        background:
            linear-gradient(
                to bottom,
                rgba(3, 8, 18, 0.28) 0%,
                rgba(3, 8, 18, 0.58) 45%,
                rgba(3, 8, 18, 0.84) 100%
            ),
            url("/public/static/img/hero.jpeg") center / cover no-repeat;
    }

    .search-form {
        border-color: rgba(139, 188, 233, 0.2);
        box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
    }

    .search-button,
    .mood-tag {
        background: var(--home-color-surface-soft);
    }

    .mood-tag {
        color: var(--home-color-text);
    }

    .search-button:hover,
    .search-button:focus-visible,
    .mood-card:hover .mood-tag,
    .mood-card:focus-within .mood-tag {
        background: var(--color-accent-3);
    }

    .search-button:active,
    .mood-card:active .mood-tag {
        background: var(--color-accent-2);
    }

    .main-bottom {
        background:
            linear-gradient(
                180deg,
                rgba(16, 25, 40, 1) 0%,
                rgba(22, 34, 53, 1) 100%
            );
    }

    .card {
        background: var(--home-color-card-gradient);
        border-color: rgba(139, 188, 233, 0.12);
    }

    .card-image {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    }

    .mood-card {
        border-color: rgba(139, 188, 233, 0.12);
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
    }

    .mood-tag {
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
    }

    .footer {
        border-top: 1px solid rgba(139, 188, 233, 0.16);
    }
}

/*
 * ========================================
 * ADAPTIVE
 * ========================================
 */

@media (max-width: 1100px) {
    .hero {
        min-height: 720px;
    }

    .hero-content {
        padding-top: 180px;
    }

    .hero-title {
        font-size: var(--home-text-hero-title-tablet);
    }

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

    .mood-layout {
        grid-template-columns: 1fr;
    }

    .mood-card--tall {
        height: 420px;
    }

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

    .footer-column {
        padding: 0 0 20px;
        border-right: none;
        border-bottom: 1px solid var(--home-color-border);
    }

    .footer-column:last-child {
        padding-bottom: 0;
        border-bottom: none;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 var(--home-side-padding-mobile);
    }

    .hero {
        min-height: 620px;
    }

    .header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .header-main {
        width: 100%;
    }

    .header-actions {
        margin-left: 0;
        flex-wrap: wrap;
        gap: 16px;
    }

    .logo {
        gap: 10px;
        font-size: var(--home-text-logo-mobile);
    }

    .logo-mark {
        width: 60px;
    }

    .hero-content {
        padding-top: 120px;
    }

    .hero-title {
        font-size: var(--home-text-hero-title-mobile);
    }

    .hero-subtitle {
        margin-bottom: 28px;
        font-size: var(--home-text-hero-subtitle-mobile);
    }

    .search-input {
        height: 58px;
        font-size: var(--home-text-input-mobile);
    }

    .search-button {
        width: 72px;
        font-size: var(--home-text-search-button-mobile);
    }

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

    .mood-left {
        grid-template-columns: 1fr;
    }

    .mood-card--wide {
        grid-column: auto;
    }

    .mood-card--wide,
    .mood-card:not(.mood-card--wide):not(.mood-card--tall),
    .mood-card--tall {
        height: 240px;
    }

    .section-title {
        margin-bottom: 30px;
        font-size: var(--home-text-section-title-mobile);
    }
}
