:root {
    --sdhome-ink: #10211c;
    --sdhome-muted: #60716b;
    --sdhome-line: #cfe1da;
    --sdhome-soft: #f4faf7;
    --sdhome-green: #047657;
    --sdhome-green-dark: #013f35;
    --sdhome-gold: #f2c14e;
    --sdhome-shadow: 0 14px 34px rgba(7, 29, 24, 0.12);
}

body {
    background: #f4f8f6;
}

.sdhome {
    color: var(--sdhome-ink);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow: hidden;
}

.sdhome a {
    color: inherit;
    text-decoration: none;
}

.sdhome-wrap {
    width: min(1240px, calc(100% - 40px));
    margin: 0 auto;
}

/* Hero stack (z-order from back to front):
 *   0 — #064637 base fill (instant pre-image fallback)
 *   1 — .sdhome-hero__bg <picture> img (responsive AVIF/WebP)
 *   2 — .sdhome-hero::before — left→right dark gradient overlay for text legibility
 *   3 — .sdhome-hero__grid — H1/desc/cards content
 *   4 — .sdhome-hero__bottom — wave-shaped page-bg-color clipping into the next section
 */
.sdhome-hero {
    position: relative;
    min-height: 520px;
    background: #064637;
    color: #fff;
    /* overflow: visible so the wave-bottom can extend below hero's box
       into the .sdhome-choices area. The <picture> and ::before are
       absolute with inset:0, so they're already bounded inside hero. */
    overflow: visible;
}

.sdhome-hero__bg {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
}

.sdhome-hero__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.sdhome-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(90deg, rgba(2, 44, 36, 0.94) 0%, rgba(3, 77, 60, 0.78) 50%, rgba(3, 77, 60, 0.30) 100%);
    pointer-events: none;
}

/* Bottom edge — sine-wave clipping into page background. Wave extends
   ~50px BELOW hero into the choices section so the cards (z-index:2,
   margin-top:-32px) sit ON TOP of the wave's lower portion. The visible
   amplitude is now deeper (~64px crest-to-trough) for a more pronounced
   curve as requested. Fill = page bg color so the wave reads as the
   page section's wavy top edge curving up into the dark hero. */
.sdhome-hero__bottom {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -80px;
    z-index: 1;  /* below the choices section (z:2) so cards cover it */
    height: 96px;
    pointer-events: none;
}

.sdhome-hero__bottom svg {
    display: block;
    width: 100%;
    height: 100%;
}

.sdhome-hero__grid {
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    align-items: start;
    gap: 42px;
    /* top padding holds content below the global header; was 112px before
       which gave too much breathing room above the kicker. */
    padding: 72px 0 64px;
}

.sdhome-hero__copy {
    max-width: 760px;
}

.sdhome-kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 22px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: rgba(255, 240, 183, 0.9);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
    line-height: 1;
}

.sdhome-kicker::before {
    content: "";
    display: inline-block;
    width: 32px;
    height: 2px;
    background: var(--sdhome-gold);
}

.sdhome h1 {
    max-width: 720px;
    margin: 18px 0 18px;
    color: #fff;
    font-size: clamp(38px, 4.1vw, 56px);
    font-weight: 900;
    line-height: 1.02;
    letter-spacing: 0;
}

.sdhome-hero-desc-wrap {
    position: relative;
    max-width: 860px;
}

.sdhome-hero-desc {
    color: rgba(255, 255, 255, 0.82);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
}

.sdhome-hero-desc p {
    margin: 0 0 12px;
}

.sdhome-search {
    width: min(860px, 100%);
    margin-top: 22px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--sdhome-shadow);
}

.sdhome-search__tabs {
    display: inline-flex;
    gap: 6px;
    padding: 3px;
    border-radius: 8px;
    background: #eaf4ef;
}

.sdhome-search__tabs label {
    cursor: pointer;
}

.sdhome-search__tabs input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.sdhome-search__tabs span {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 12px;
    border-radius: 7px;
    color: #31524a;
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
}

.sdhome-search__tabs input:checked + span {
    background: var(--sdhome-green);
    color: #fff;
}

.sdhome-search__line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin-top: 8px;
}

.sdhome-search__line input {
    width: 100%;
    min-height: 50px;
    padding: 0 16px;
    border: 1px solid var(--sdhome-line);
    border-radius: 8px;
    background: #fff;
    color: var(--sdhome-ink);
    font: inherit;
    font-size: 17px;
    outline: 0;
}

.sdhome-search__line input:focus {
    border-color: var(--sdhome-green);
    box-shadow: 0 0 0 3px rgba(4, 118, 87, 0.14);
}

.sdhome-search__line button,
.sdhome-choice__actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid var(--sdhome-green);
    border-radius: 8px;
    background: var(--sdhome-green);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
}

.sdhome-search__line button {
    min-height: 50px;
}

.sdhome-hero__panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    width: 100%;
    padding-top: 36px;
}

.sdhome-primary-card {
    position: relative;
    display: grid;
    min-height: 136px;
    padding: 18px 20px 16px;
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 26px rgba(2, 25, 20, 0.14);
    overflow: hidden;
}

.sdhome-primary-card span {
    color: #e8fff7;
    font-size: 15px;
    font-weight: 900;
}

.sdhome-primary-card strong {
    align-self: end;
    color: #fff;
    font-size: 40px;
    font-weight: 900;
    line-height: 1;
}

.sdhome-primary-card em {
    color: rgba(255, 255, 255, 0.78);
    font-size: 13px;
    font-style: normal;
    font-weight: 800;
}

.sdhome-choices {
    position: relative;
    z-index: 2;
    margin-top: -32px;
    padding: 0 0 70px;
}

.sdhome-choices__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.sdhome-choice {
    display: grid;
    gap: 18px;
    min-height: 286px;
    padding: 24px;
    border: 1px solid var(--sdhome-line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 14px 30px rgba(13, 40, 33, 0.07);
}

/* Choice card icon — same SVG as the global-menu row-icon (Sound = EQ
   bars, Music = note). Sound carries the green brand gradient; Music
   the gold one (matches `sdino-global-menu__section--music`). */
.sdhome-choice__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-bottom: 12px;
    border-radius: 8px;
    background: linear-gradient(135deg, #e2f3ea 0%, #f1faf4 100%);
    color: #16805e;
    box-shadow: inset 0 0 0 1px rgba(22, 128, 94, .12);
}

.sdhome-choice__icon svg {
    display: block;
}

.sdhome-choice__icon--music {
    background: linear-gradient(135deg, #fff1d6 0%, #fff9ec 100%);
    color: #b87813;
    box-shadow: inset 0 0 0 1px rgba(184, 120, 19, .14);
}

.sdhome-choice h2 {
    margin: 0;
    color: var(--sdhome-ink);
    font-size: 27px;
    font-weight: 900;
    line-height: 1.08;
}

.sdhome-choice p {
    max-width: 520px;
    margin: 9px 0 0;
    color: var(--sdhome-muted);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.45;
}

.sdhome-choice__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-self: start;
}

.sdhome-choice__actions a + a {
    border-color: var(--sdhome-line);
    background: #fff;
    color: #21433a;
}

.sdhome-category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-self: end;
    padding-top: 8px;
    border-top: 1px solid #e5f0ec;
}

.sdhome-category-list a {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 8px;
    border: 1px solid #bcd8ce;
    border-radius: 7px;
    background: var(--sdhome-soft);
    color: #135646;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
}

.sdhome-category-list a:hover,
.sdhome-choice__actions a:hover,
.sdhome-primary-card:hover {
    border-color: var(--sdhome-green);
}

.sdhome-track-tops {
    padding: 0 0 76px;
}

.sdhome-track-tops__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.sdhome-track-panel {
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--sdhome-line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 14px 30px rgba(13, 40, 33, 0.07);
}

.sdhome-track-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.sdhome-track-panel__head h2 {
    margin: 0;
    color: var(--sdhome-ink);
    font-size: 26px;
    font-weight: 900;
    line-height: 1.08;
}

.sdhome-track-panel__head a {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid var(--sdhome-line);
    border-radius: 8px;
    color: #135646;
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
}

.sdhome-track-player-scope.zg-v3 {
    max-width: none;
    margin: 0;
    padding: 0;
    background: transparent;
}

.sdhome-track-player-scope .zg-v3__list {
    display: grid;
    gap: 10px;
}

/* ────────────────────────────────────────────────────────────────────
 * Home Trending panels: the two-up grid puts each card at ~50% screen
 * width on desktop, so the standard horizontal player (play | title |
 * waveform | time | download in one row) gets cramped — the waveform
 * collides with the time text and download icon. Switch to the
 * vertical layout we use on category pages below 768px (title row on
 * top, waveform row below, time/download anchored to corners). Same
 * grammar, no media query — these panels are always tight.
 * Mirrors the @media block in v3_category.css around line 1880+.
 * ──────────────────────────────────────────────────────────────── */

.sdhome-track-player-scope .playtrack {
    box-sizing: border-box;
    min-height: 92px;
    overflow: hidden;
    box-shadow: none;
}

/* ─── SOUND row ─── */
.sdhome-track-player-scope .playtrack:not(.playtrack-music) {
    padding-bottom: 12px;
}

.sdhome-track-player-scope .playtrack:not(.playtrack-music) .playerLeft {
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding-top: 0;
    height: auto;
    line-height: normal;
}

.sdhome-track-player-scope .playtrack:not(.playtrack-music) .play {
    margin-left: 0;
    margin-right: 0;
    height: 44px;
    line-height: 1;
}

.sdhome-track-player-scope .playtrack:not(.playtrack-music) .trackTitleWrap {
    flex: 1 1 0;
    min-width: 0;
    max-width: calc(100% - 60px);
    height: 44px;
    padding-top: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin-right: 0;
}

.sdhome-track-player-scope .playtrack:not(.playtrack-music) .trackTitleWrap .name {
    position: static;
    top: auto;
    left: auto;
    right: auto;
    margin: 0;
    width: auto;
    max-width: 100%;
    height: auto;
    padding: 0 56px 0 0;
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sdhome-track-player-scope .playtrack:not(.playtrack-music) .trackTitleWrap:hover .name {
    white-space: nowrap;
    overflow: hidden;
    background: transparent;
    padding: 0 56px 0 0;
    box-shadow: none;
}

.sdhome-track-player-scope .playtrack:not(.playtrack-music) .trackMeta {
    margin: 0;
    gap: 10px;
    flex-wrap: nowrap;
    height: auto;
    line-height: 1;
}

.sdhome-track-player-scope .playtrack:not(.playtrack-music) .peaks {
    order: 99;
    flex: 1 1 100%;
    width: calc(100% - 36px);
    max-width: calc(100% - 36px);
    height: 26px;
    overflow: hidden;
    margin: 8px 0 0;
}

.sdhome-track-player-scope .playtrack:not(.playtrack-music) .playerRight {
    position: absolute;
    inset: 0;
    display: block;
    width: auto;
    height: auto;
    padding: 0;
    pointer-events: none;
    flex: none;
}

.sdhome-track-player-scope .playtrack:not(.playtrack-music) .playerRight .time {
    position: absolute;
    top: 18px;
    right: 14px;
    height: 16px;
    margin: 0;
    padding-left: 18px;
    background-size: 14px 14px;
    background-position: left center;
    font-size: 12px;
    line-height: 16px;
    pointer-events: auto;
}

.sdhome-track-player-scope .playtrack:not(.playtrack-music) .playerRight .download {
    position: absolute;
    right: 8px;
    bottom: 18px;
    margin: 0;
    pointer-events: auto;
}

/* ─── MUSIC row ─── */
.sdhome-track-player-scope .playtrack-music .playerLeft {
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.sdhome-track-player-scope .playtrack-music .music-cover {
    width: 50px;
    min-width: 50px;
    height: 50px;
}

.sdhome-track-player-scope .playtrack-music .musicInfo {
    flex: 1 1 auto;
    max-width: calc(100% - 76px);
    min-width: 0;
}

.sdhome-track-player-scope .playtrack-music .musicInfo .name {
    max-width: 100%;
    min-width: 0;
}

.sdhome-track-player-scope .playtrack-music .musicDescBox {
    display: none;
}

.sdhome-track-player-scope .playtrack-music .musicTags {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x proximity;
}

.sdhome-track-player-scope .playtrack-music .musicTags::-webkit-scrollbar {
    display: none;
}

.sdhome-track-player-scope .playtrack-music .musicTags span {
    flex: 0 0 auto;
    max-width: 120px;
    scroll-snap-align: start;
}

.sdhome-track-player-scope .playtrack-music .peaks {
    height: 30px;
    overflow: hidden;
    flex: 1 1 auto;
    width: calc(100% - 36px);
    max-width: calc(100% - 36px);
    margin: 8px 0 0;
}

.sdhome-track-player-scope .playtrack-music .playerRight {
    position: absolute;
    inset: 0;
    display: block;
    width: auto;
    height: auto;
    padding: 0;
    pointer-events: none;
    flex: none;
}

.sdhome-track-player-scope .playtrack-music .playerRight .time {
    position: absolute;
    top: 18px;
    right: 14px;
    height: 16px;
    margin: 0;
    padding-left: 18px;
    background-size: 14px 14px;
    background-position: left center;
    font-size: 12px;
    line-height: 16px;
    pointer-events: auto;
}

.sdhome-track-player-scope .playtrack-music .playerRight .download {
    position: absolute;
    right: 8px;
    bottom: 18px;
    margin: 0;
    pointer-events: auto;
}

@media (max-width: 900px) {
    /* Bumped from 100%-24px to 100%-48px so tablet portrait (≤768-900px)
       has 24px of breathing room each side instead of 12px. */
    .sdhome-wrap {
        width: min(100% - 48px, 720px);
    }

    .sdhome-hero {
        min-height: auto;
    }

    .sdhome-hero__grid {
        grid-template-columns: 1fr;
        padding: 44px 0 56px;
    }

    .sdhome h1 {
        font-size: clamp(34px, 8vw, 48px);
        line-height: 1.04;
    }

    .sdhome-hero-desc {
        font-size: 16px;
    }

    .sdhome-hero__panel,
    .sdhome-choices__grid,
    .sdhome-track-tops__grid {
        grid-template-columns: 1fr;
    }

    .sdhome-hero__panel {
        padding-top: 0;
    }
}

/* Mobile (≤768px): keep image as full-bleed background. Cover with
   center-center positioning so the image stays visually centered
   inside the portrait hero box at any height. */
@media (max-width: 768px) {
    .sdhome-hero__bg img {
        object-position: center center;
    }
}

/* Narrow phones (≤480px): the hero search input's placeholder
   ("Find an effect, mood, or sound source...") doesn't fit at the
   default 17px font + 16px side padding. Shrink them so the full
   placeholder is visible without truncation. Touch target stays
   ≥44px via min-height. */
@media (max-width: 480px) {
    .sdhome-search__line input {
        font-size: 14px;
        padding: 0 12px;
        min-height: 46px;
    }
}

@media (max-width: 560px) {
    /* Phones — 16px gutter each side; tighter than tablet but readable. */
    .sdhome-wrap {
        width: calc(100% - 32px);
    }

    .sdhome-hero__grid {
        padding-top: 28px;
    }

    .sdhome-kicker {
        font-size: 13px;
    }

    .sdhome-search {
        padding: 8px;
    }

    .sdhome-search__tabs {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }

    .sdhome-search__tabs span {
        justify-content: center;
        padding: 7px 8px;
        font-size: 14px;
    }

    .sdhome-search__line {
        grid-template-columns: 1fr;
    }

    .sdhome-search__line button {
        width: 100%;
    }

    .sdhome-primary-card {
        min-height: 104px;
    }

    .sdhome-primary-card strong {
        font-size: 32px;
    }

    .sdhome-choice {
        min-height: auto;
        padding: 20px;
    }

    .sdhome-choice h2 {
        font-size: 24px;
    }

    .sdhome-choice__actions a {
        flex: 1 1 150px;
    }

    .sdhome-track-tops {
        padding-bottom: 52px;
    }

    .sdhome-track-panel {
        padding: 12px;
    }

    .sdhome-track-panel__head {
        align-items: flex-start;
        flex-direction: column;
    }

    .sdhome-track-panel__head h2 {
        font-size: 23px;
    }
}

/* ────────────────────────────────────────────────────────────────────
 * Below-Trending SEO block: a "long-form" section that replaces the
 * legacy text_site_morda_desc wall of text. Pattern mirrors
 * `.sdmuz-seo` + `.sdmuz-faq` on the music landing page so the visual
 * grammar is consistent across both hubs.
 * ──────────────────────────────────────────────────────────────── */

.sdhome-seo {
    margin-top: 56px;
    padding: 48px 0 64px;
    border-top: 1px solid var(--sdhome-line);
    background: linear-gradient(180deg, #f4faf7 0%, #fff 60%);
}

.sdhome-seo__wrap {
    display: flex;
    flex-direction: column;
    gap: 36px;
}

.sdhome-seo__intro {
    max-width: 760px;
}

.sdhome-seo__eyebrow {
    display: inline-block;
    margin-bottom: 8px;
    padding: 4px 11px;
    border-radius: 999px;
    background: #ecf6f1;
    color: var(--sdhome-green-dark);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.sdhome-seo__intro h2 {
    margin: 0 0 8px;
    color: var(--sdhome-ink);
    font-size: 30px;
    line-height: 1.15;
    font-weight: 800;
}

.sdhome-seo__intro p {
    margin: 0;
    color: var(--sdhome-muted);
    font-size: 17px;
    line-height: 1.55;
}

.sdhome-seo__articles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.sdhome-seo__block {
    padding: 22px 24px 24px;
    border: 1px solid var(--sdhome-line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(14, 36, 29, .04);
}

.sdhome-seo__block h3 {
    margin: 0 0 10px;
    padding-left: 12px;
    border-left: 3px solid var(--sdhome-green);
    color: var(--sdhome-ink);
    font-size: 21px;
    line-height: 1.22;
    font-weight: 800;
}

.sdhome-seo__block p {
    margin: 0;
    color: var(--sdhome-ink);
    font-size: 16px;
    line-height: 1.65;
}

.sdhome-faq {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sdhome-faq__head {
    margin: 0 0 6px;
    color: var(--sdhome-ink);
    font-size: 26px;
    line-height: 1.18;
    font-weight: 800;
    letter-spacing: -.005em;
}

.sdhome-faq__item {
    padding: 20px 24px 22px;
    border: 1px solid var(--sdhome-line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(14, 36, 29, .035);
}

.sdhome-faq__item h4 {
    margin: 0 0 10px;
    padding-left: 14px;
    border-left: 3px solid var(--sdhome-green);
    color: var(--sdhome-ink);
    font-size: 19px;
    line-height: 1.3;
    font-weight: 800;
}

.sdhome-faq__item p {
    margin: 0;
    color: var(--sdhome-ink);
    font-size: 16px;
    line-height: 1.65;
}

@media (max-width: 900px) {
    .sdhome-seo {
        margin-top: 36px;
        padding: 36px 0 48px;
    }

    .sdhome-seo__intro h2 {
        font-size: 26px;
    }

    .sdhome-seo__articles {
        grid-template-columns: 1fr;
    }

    .sdhome-seo__block,
    .sdhome-faq__item {
        padding: 18px 18px 20px;
    }

    .sdhome-seo__block h3,
    .sdhome-faq__item h4 {
        font-size: 18px;
    }

    .sdhome-seo__block p,
    .sdhome-faq__item p {
        font-size: 15px;
    }

    .sdhome-faq__head {
        font-size: 22px;
    }
}
