/* Stella Fire downloads page (build 1.7). Loaded on downloads/index.php only. Scoped under .dl. */

.dl {
    --dl-ink: #1a1f24;
    --dl-steel: #5f6a73;
    --dl-line: #dde1e4;
    --dl-ceiling: #f2f3f1;
    --dl-panel: #161b20;
    --dl-red: #e52329;
    --dl-red-deep: #b8151b;
    --dl-led: #42d17c;
    color: var(--dl-ink);
    background: #fff;
}
.dl h1, .dl h2, .dl h3 {
    font-family: "Outfit", Inter, ui-sans-serif, system-ui, sans-serif;
    text-wrap: balance;
    margin: 0;
}
.dl :focus-visible { outline: 3px solid var(--dl-red); outline-offset: 3px; border-radius: 4px; }
.dl a { color: inherit; }
.dl svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Buttons */
.dl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 22px;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}
.dl .dl-btn--red { background: var(--dl-red); color: #fff; }
.dl .dl-btn--red:hover { background: var(--dl-red-deep); transform: translateY(-1px); }
.dl .dl-btn--line { border: 1.5px solid var(--dl-ink); color: var(--dl-ink); }
.dl .dl-btn--line:hover { background: var(--dl-ink); color: #fff; }
.dl .dl-btn--ghost { border: 1.5px solid rgba(255, 255, 255, .5); color: #fff; }
.dl .dl-btn--ghost:hover { background: #fff; color: var(--dl-ink); }

/* ---------- Hero ---------- */
.dl-hero {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    padding: clamp(48px, 7vw, 96px) 0 clamp(40px, 5vw, 64px);
    background: var(--dl-panel);
    color: #fff;
}
/* A blueprint grid, fading out to the left, with a red glow behind it */
.dl-hero::before {
    content: "";
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: linear-gradient(100deg, transparent 25%, #000 85%);
    mask-image: linear-gradient(100deg, transparent 25%, #000 85%);
    animation: dl-grid 40s linear infinite;
}
.dl-hero::after {
    content: "";
    position: absolute;
    z-index: -1;
    width: 60vw;
    height: 60vw;
    max-width: 820px;
    max-height: 820px;
    right: -12vw;
    top: -18vw;
    background: radial-gradient(closest-side, rgba(229, 35, 41, .35), transparent);
}
@keyframes dl-grid { to { background-position: 44px 44px, 44px 44px; } }

.dl-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #ff8a8d;
}
.dl-eyebrow::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--dl-red);
    box-shadow: 0 0 0 0 rgba(229, 35, 41, .6);
    animation: dl-pulse 2.4s ease-out infinite;
}
@keyframes dl-pulse {
    0% { box-shadow: 0 0 0 0 rgba(229, 35, 41, .6); }
    70%, 100% { box-shadow: 0 0 0 12px rgba(229, 35, 41, 0); }
}
.dl-hero__title {
    font-size: clamp(2.8rem, 6vw, 4.6rem);
    font-weight: 700;
    letter-spacing: -.035em;
    line-height: .98;
}
.dl-hero__lede {
    max-width: 40em;
    margin: 18px 0 0;
    color: #c3cad0;
    font-size: 1.1rem;
    line-height: 1.55;
}

/* Search */
.dl-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 820px;
    margin-top: clamp(26px, 3vw, 36px);
    padding: 6px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
}
.dl-search__icon { position: absolute; left: 20px; width: 20px; height: 20px; color: var(--dl-steel); pointer-events: none; }
.dl-search input {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 48px;
    padding: 0 12px 0 44px;
    border: 0;
    background: transparent;
    color: var(--dl-ink);
    font: inherit;
    font-size: 1.02rem;
}
.dl-search input:focus { outline: none; }
.dl-search:focus-within { box-shadow: 0 0 0 3px var(--dl-red), 0 18px 40px rgba(0, 0, 0, .35); }
.dl-search__clear {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--dl-steel);
    font-size: 1.4rem;
    text-decoration: none;
}
.dl-search__clear:hover { background: var(--dl-ceiling); color: var(--dl-ink); }
.dl-search select {
    min-height: 48px;
    padding: 0 12px;
    border: 0;
    border-left: 1px solid var(--dl-line);
    background: transparent;
    color: var(--dl-ink);
    font: inherit;
    font-size: .95rem;
    cursor: pointer;
}
.dl-search button {
    min-height: 48px;
    padding: 0 24px;
    border: 0;
    border-radius: 8px;
    background: var(--dl-red);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .2s ease;
}
.dl-search button:hover { background: var(--dl-red-deep); }

.dl-stats {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 36px;
    margin: clamp(26px, 3vw, 36px) 0 0;
    padding: 0;
    color: #c3cad0;
}
.dl-stats strong {
    display: block;
    color: #fff;
    font-family: "Outfit", Inter, sans-serif;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

/* ---------- Filter bar ---------- */
.dl-bar {
    background: #fff;
    border-bottom: 1px solid var(--dl-line);
}
.dl-bar__inner {
    display: flex;
    align-items: center;
    gap: 16px 28px;
    padding-top: 14px;
    padding-bottom: 14px;
}
.dl-seg {
    display: inline-flex;
    flex: none;
    padding: 4px;
    border-radius: 999px;
    background: #eceeef;
}
.dl .dl-seg__btn {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 16px;
    border-radius: 999px;
    color: var(--dl-steel);
    font-weight: 700;
    font-size: .92rem;
    white-space: nowrap;
    text-decoration: none;
    transition: background-color .2s ease, color .2s ease;
}
.dl .dl-seg__btn:hover { color: var(--dl-ink); }
.dl .dl-seg__btn.is-active { background: var(--dl-red); color: #fff; box-shadow: 0 4px 12px rgba(229, 35, 41, .3); }
.dl-types {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent);
    mask-image: linear-gradient(90deg, #000 92%, transparent);
    padding-right: 24px;
}
.dl-types::-webkit-scrollbar { display: none; }
.dl .dl-type {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--dl-line);
    border-radius: 999px;
    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color .2s ease, background-color .2s ease;
}
.dl-type span { color: var(--dl-steel); font-weight: 500; font-variant-numeric: tabular-nums; }
.dl .dl-type:hover { border-color: var(--dl-ink); }
.dl .dl-type.is-active { border-color: var(--dl-ink); background: var(--dl-ink); color: #fff; }
.dl .dl-type.is-active span { color: #aab3ba; }

/* ---------- Installer access ---------- */
.dl-access { padding-top: clamp(28px, 3.5vw, 40px); }
.dl-access__card {
    display: flex;
    align-items: center;
    gap: 18px 22px;
    padding: 20px 24px;
    border: 1px solid #f3c6c8;
    border-radius: 14px;
    background: linear-gradient(100deg, #fff4f4, #fff 70%);
}
.dl-access__icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--dl-red);
    color: #fff;
}
.dl-access__icon svg { width: 22px; height: 22px; }
.dl-access__text { display: grid; gap: 3px; flex: 1 1 auto; }
.dl-access__text strong { font-size: 1.05rem; }
.dl-access__text span { color: var(--dl-steel); }
.dl-access__actions { display: flex; gap: 10px; flex: none; }

/* ---------- Sections ---------- */
.dl-section { padding-top: clamp(40px, 5vw, 64px); }
.dl-section__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 32px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}
.dl-section__head h2,
.dl-group__title {
    font-size: clamp(1.5rem, 2.4vw, 2rem);
    font-weight: 700;
    letter-spacing: -.015em;
}
.dl-section__head p { margin: 0; color: var(--dl-steel); max-width: 36em; }

/* Software cards */
.dl-soft {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: clamp(14px, 2vw, 20px);
}
.dl-soft__item {
    display: grid;
    grid-template-rows: auto 1fr;
    border: 1.5px solid var(--dl-line);
    border-radius: 14px;
    overflow: hidden;
    transition: border-color .2s ease, transform .3s cubic-bezier(.2, .7, .2, 1), box-shadow .3s ease;
}
.dl-soft__item:hover { border-color: var(--dl-ink); transform: translateY(-3px); box-shadow: 0 14px 30px rgba(26, 31, 36, .1); }
.dl-soft__photo {
    display: block;
    aspect-ratio: 2 / 1;
    background: linear-gradient(160deg, #20262c, #11161a);
}
.dl-soft__photo img { width: 100%; height: 100%; object-fit: contain; padding: 8% 18%; }
.dl-soft__body { display: grid; align-content: start; gap: 8px; padding: 18px 20px 20px; }
.dl-soft__for {
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--dl-red-deep);
}
.dl-soft__body h3 { font-size: 1.35rem; font-weight: 700; }
.dl-soft__body h3 a { text-decoration: none; }
.dl-soft__body h3 a:hover { color: var(--dl-red-deep); }
.dl-soft__body p { margin: 0; color: var(--dl-steel); font-size: .94rem; line-height: 1.5; }
.dl .dl-soft__link {
    margin-top: 6px;
    font-weight: 700;
    text-decoration: none;
    color: var(--dl-ink);
}
.dl-soft__link::after { content: " \2192"; display: inline-block; transition: transform .2s ease; }
.dl-soft__link:hover::after { transform: translateX(4px); }

/* ---------- Document list ---------- */
.dl-library { padding-bottom: clamp(56px, 7vw, 96px); }
.dl-group + .dl-group { margin-top: clamp(36px, 4.5vw, 56px); }
.dl-group__title {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 16px !important;
    scroll-margin-top: 90px;
}
.dl-group__title span {
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
    font-size: .95rem;
    font-weight: 600;
    color: var(--dl-steel);
}
.dl-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.dl-doc {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    border: 1.5px solid var(--dl-line);
    border-radius: 12px;
    background: #fff;
    transition: border-color .2s ease, box-shadow .25s ease, transform .25s cubic-bezier(.2, .7, .2, 1);
    animation: dl-in .5s cubic-bezier(.2, .8, .2, 1) both;
}
.dl-doc:hover { border-color: var(--dl-ink); box-shadow: 0 10px 24px rgba(26, 31, 36, .08); transform: translateY(-2px); }
.dl-list .dl-doc:nth-child(2) { animation-delay: 40ms; }
.dl-list .dl-doc:nth-child(3) { animation-delay: 80ms; }
.dl-list .dl-doc:nth-child(4) { animation-delay: 120ms; }
.dl-list .dl-doc:nth-child(n+5) { animation-delay: 160ms; }
@keyframes dl-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* File badge: a folded-corner sheet with the file type */
.dl-doc__file {
    position: relative;
    display: grid;
    place-items: end center;
    width: 46px;
    height: 56px;
    padding-bottom: 9px;
    border-radius: 6px 14px 6px 6px;
    background: var(--dl-ink);
    color: #fff;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .04em;
}
.dl-doc__file::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 14px;
    height: 14px;
    border-radius: 0 0 0 5px;
    background: rgba(255, 255, 255, .35);
}
.dl-doc__file--pdf { background: var(--dl-red); }
.dl-doc__file--zip, .dl-doc__file--rar { background: #c98a12; }
.dl-doc__file--exe, .dl-doc__file--msi { background: #2b6cb0; }
.dl-doc__file--dwg, .dl-doc__file--dxf, .dl-doc__file--rfa, .dl-doc__file--rvt { background: #2f855a; }

.dl-doc__main { display: grid; gap: 5px; min-width: 0; }
.dl-doc__title { font-size: 1.04rem; font-weight: 650; line-height: 1.3; }
.dl-doc__models { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.dl .dl-doc__models a {
    padding: 2px 8px;
    border-radius: 5px;
    background: var(--dl-ceiling);
    font-size: .8rem;
    font-weight: 700;
    text-decoration: none;
}
.dl .dl-doc__models a:hover { background: var(--dl-ink); color: #fff; }
.dl-doc__models span { font-size: .8rem; color: var(--dl-steel); align-self: center; }
.dl-doc__meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; color: var(--dl-steel); font-size: .84rem; }

.dl-doc__action { display: grid; justify-items: end; gap: 8px; }
.dl .dl-doc__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 8px;
    background: var(--dl-ink);
    color: #fff;
    font-size: .9rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .2s ease;
}
.dl-doc__btn svg { width: 18px; height: 18px; stroke-width: 2.2; transition: transform .25s ease; }
.dl .dl-doc__btn:hover { background: var(--dl-red); }
.dl-doc__btn:hover svg { transform: translateY(2px); }
.dl .dl-doc__btn--locked { background: transparent; color: var(--dl-ink); border: 1.5px solid var(--dl-line); }
.dl .dl-doc__btn--locked:hover { background: transparent; border-color: var(--dl-ink); color: var(--dl-ink); }
.dl-doc__badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--dl-red-deep);
}
.dl-doc__badge svg { width: 14px; height: 14px; stroke-width: 2.2; }
.dl-doc__badge--open { color: #2f855a; }
.dl-doc.is-locked .dl-doc__file { filter: grayscale(.6); opacity: .75; }

/* Empty and error states */
.dl-notice { padding: 18px 20px; border-radius: 10px; background: var(--dl-ceiling); color: #46515a; }
.dl-empty {
    display: grid;
    justify-items: center;
    gap: 10px;
    max-width: 560px;
    margin: 0 auto;
    padding: clamp(28px, 4vw, 48px) 0;
    text-align: center;
}
.dl-empty__icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--dl-ceiling);
    color: var(--dl-steel);
}
.dl-empty__icon svg { width: 30px; height: 30px; }
.dl-empty h2 { font-size: 1.5rem; }
.dl-empty p { margin: 0; color: var(--dl-steel); line-height: 1.55; }
.dl-empty a { color: var(--dl-red-deep); font-weight: 600; }

/* Help band */
.dl-help { padding: clamp(48px, 6vw, 80px) 0; background: #1d2329; color: #fff; }
.dl-help__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px 48px; flex-wrap: wrap; }
.dl-help h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 700; letter-spacing: -.02em; }
.dl-help p { max-width: 36em; margin: 10px 0 0; color: #c3cad0; line-height: 1.55; }
.dl-help__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Smaller screens ---------- */
@media (max-width: 1000px) {
    .dl-list { grid-template-columns: 1fr; }
    .dl-bar__inner { flex-direction: column; align-items: stretch; }
    .dl-seg { align-self: flex-start; }
}
@media (max-width: 700px) {
    .dl-search { flex-wrap: wrap; }
    .dl-search input { flex-basis: calc(100% - 44px); }
    .dl-search select { flex: 1 1 auto; border-left: 0; border-top: 1px solid var(--dl-line); border-radius: 0; }
    .dl-search button { flex: 1 1 auto; }
    .dl-search__icon { top: 20px; }
    .dl-access__card { flex-wrap: wrap; }
    .dl-access__actions { width: 100%; }
    .dl-access__actions .dl-btn { flex: 1 1 0; }
    .dl-doc { grid-template-columns: auto minmax(0, 1fr); }
    .dl-doc__action { grid-column: 1 / -1; grid-auto-flow: column; justify-content: space-between; align-items: center; }
    .dl-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; font-size: .86rem; line-height: 1.3; }
    .dl-stats strong { font-size: 1.6rem; }
    .dl-seg { align-self: stretch; display: grid; grid-template-columns: repeat(3, 1fr); }
    .dl .dl-seg__btn { justify-content: center; padding: 0 8px; }
    /* Software cards scroll sideways */
    .dl-soft {
        grid-auto-flow: column;
        grid-template-columns: none;
        grid-auto-columns: 78%;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-bottom: 6px;
        scrollbar-width: none;
    }
    .dl-soft::-webkit-scrollbar { display: none; }
    .dl-soft__item { scroll-snap-align: start; }
    .dl-soft__item:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .dl-hero::before, .dl-eyebrow::before, .dl-doc { animation: none; }
    .dl-doc, .dl-soft__item { transition: none; }
}
