/* ==========================================================
   HassApps — Main Site Styles
   ========================================================== */

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #090f1a;
    color: #f8fafc;
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Tahoma,
        Arial,
        sans-serif;
}

img {
    max-width: 100%;
}

a {
    color: inherit;
}

button,
input,
textarea,
select {
    font: inherit;
}


/* ==========================================================
   Shared Layout
   ========================================================== */

.shell {
    width: min(
        1180px,
        calc(100% - 32px)
    );
    margin: 0 auto;
}

.home-main,
.page-main {
    padding: 42px 0 70px;
}


/* ==========================================================
   Header
   ========================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom:
        1px solid
        rgba(255, 255, 255, .07);
    background:
        rgba(9, 15, 26, .94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.header-inner {
    min-height: 84px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
    color: #f8fafc;
    text-decoration: none;
}

.brand-mark,
.brand-logo {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: 15px;
}

.brand-mark {
    display: grid;
    place-items: center;
    font-size: 1rem;
    font-weight: 1000;
    color: #fff;
    background:
        linear-gradient(
            145deg,
            #2563eb,
            #7c3aed,
            #db2777
        );
    box-shadow:
        0 10px 28px
        rgba(79, 70, 229, .28);
}

.brand-logo {
    display: block;
    object-fit: contain;
    background:
        rgba(255, 255, 255, .03);
    border:
        1px solid
        rgba(255, 255, 255, .06);
}

.brand > span:last-child {
    min-width: 0;
}

.brand strong {
    display: block;
    color: #f8fafc;
    font-size: 1.08rem;
    font-weight: 950;
    line-height: 1.2;
}

.brand small {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: .7rem;
    font-weight: 750;
    line-height: 1.2;
}

.main-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
}

.main-nav a {
    min-height: 40px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border:
        1px solid
        transparent;
    border-radius: 11px;
    color: #a8b4c5;
    text-decoration: none;
    font-size: .8rem;
    font-weight: 850;
    white-space: nowrap;
    transition:
        color .18s ease,
        background .18s ease,
        border-color .18s ease,
        transform .18s ease;
}

.main-nav a:hover {
    color: #fff;
    border-color:
        rgba(129, 140, 248, .18);
    background:
        rgba(99, 102, 241, .08);
    transform: translateY(-1px);
}

.main-nav .nav-link.is-active {
    color: #fff;
    border-color:
        rgba(129, 140, 248, .30);
    background:
        rgba(99, 102, 241, .11);
    box-shadow:
        inset 0 0 0 1px
        rgba(255, 255, 255, .015);
}

.main-nav .nav-link.is-active:hover {
    color: #fff;
    border-color:
        rgba(129, 140, 248, .38);
    background:
        rgba(99, 102, 241, .15);
}

.main-nav .language-link,
.main-nav .language-link:visited,
.main-nav .language-link:hover,
.main-nav .language-link:focus,
.main-nav .language-link:focus-visible,
.main-nav .language-link:active {
    margin-inline-start: 6px;
    color: #a855f7;
    border-color: transparent;
    background: transparent;
    -webkit-text-fill-color: #a855f7;
    filter: none;
    transform: none;
    box-shadow: none;
    outline: none;
    transition: none;
}


/* ==========================================================
   Content Date
   ========================================================== */

.content-date {
    margin-bottom: 7px;
    color: #94a3b8;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .02em;
    line-height: 1.3;
}


/* ==========================================================
   Hero
   ========================================================== */

.hero {
    padding: 44px 30px;
    overflow: hidden;
    text-align: center;
    border:
        1px solid
        rgba(255, 255, 255, .08);
    border-radius: 28px;
    background:
        radial-gradient(
            circle at 15% 0%,
            rgba(37, 99, 235, .22),
            transparent 37%
        ),
        radial-gradient(
            circle at 86% 0%,
            rgba(124, 58, 237, .22),
            transparent 37%
        ),
        #111827;
    box-shadow:
        0 22px 55px
        rgba(0, 0, 0, .18);
}

.hero .eyebrow,
.section-kicker {
    color: #7dd3fc;
    font-size: .68rem;
    font-weight: 950;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.hero h1 {
    margin: 10px 0 0;
    font-size:
        clamp(
            2rem,
            6vw,
            4rem
        );
    line-height: 1.05;
    font-weight: 1000;
    letter-spacing: -.025em;
}

.hero p {
    max-width: 760px;
    margin: 16px auto 0;
    color: #94a3b8;
    font-size: .96rem;
    line-height: 1.8;
}


/* ==========================================================
   Sections
   ========================================================== */

.section {
    margin-top: 34px;
}

.section-head {
    margin-bottom: 18px;
    text-align: center;
}

.section-head h2 {
    margin: 7px 0 0;
    font-size:
        clamp(
            1.55rem,
            4vw,
            2.35rem
        );
    line-height: 1.15;
    font-weight: 1000;
}

.section-head p {
    max-width: 720px;
    margin: 8px auto 0;
    color: #64748b;
    font-size: .86rem;
    line-height: 1.7;
}


/* ==========================================================
   Generic Grid / Cards
   ========================================================== */

.grid {
    display: grid;
    grid-template-columns:
        repeat(
            3,
            minmax(0, 1fr)
        );
    gap: 14px;
}

.card {
    padding: 23px;
    border:
        1px solid
        rgba(255, 255, 255, .075);
    border-radius: 22px;
    background: #111827;
    box-shadow:
        0 16px 40px
        rgba(0, 0, 0, .10);
    transition:
        transform .18s ease,
        border-color .18s ease,
        background .18s ease;
}

.card:hover {
    transform: translateY(-2px);
    border-color:
        rgba(129, 140, 248, .18);
    background: #121b2b;
}

.card h3 {
    margin: 0;
    font-size: 1.15rem;
    line-height: 1.35;
    font-weight: 950;
}

.card p {
    margin: 11px 0 0;
    color: #94a3b8;
    line-height: 1.72;
}


/* ==========================================================
   Buttons / Links
   ========================================================== */

.card-link {
    width: fit-content;
    min-width: 112px;
    min-height: 42px;
    margin-top: 18px;
    padding: 0 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border:
        1px solid
        rgba(129, 140, 248, .24);
    border-radius: 12px;
    color: #dbeafe;
    text-decoration: none;
    font-size: .77rem;
    font-weight: 900;
    background:
        rgba(99, 102, 241, .07);
    box-shadow:
        inset 0 1px 0
        rgba(255, 255, 255, .025);
    transition:
        transform .18s ease,
        color .18s ease,
        background .18s ease,
        border-color .18s ease;
}

.card-link:hover {
    transform: translateY(-1px);
    color: #fff;
    border-color:
        rgba(129, 140, 248, .38);
    background:
        rgba(99, 102, 241, .14);
}


/* ==========================================================
   Ready Projects
   ========================================================== */

.ready-grid {
    display: grid;
    gap: 14px;
}

.ready-count-1 {
    grid-template-columns:
        minmax(0, 580px);
    justify-content: center;
}

.ready-count-2 {
    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );
}

.ready-count-3 {
    grid-template-columns:
        repeat(
            3,
            minmax(0, 1fr)
        );
}

.ready-card {
    min-height: 220px;
    display: flex;
    flex-direction: column;
}

.ready-card p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
}

.ready-card .card-link {
    margin-top: auto;
    align-self: flex-start;
}


/* ==========================================================
   Latest Topics on Single Article
   ========================================================== */

.latest-topic-excerpt {
    display: -webkit-box;
    overflow: hidden;
    margin-bottom: 0;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    text-overflow: ellipsis;
}

.latest-topic-card .card-link {
    margin-top: 16px;
}


/* ==========================================================
   All Topics Filter
   ========================================================== */

.topics-filter {
    margin: 22px 0 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.topics-filter-link {
    min-height: 38px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border:
        1px solid
        rgba(129, 140, 248, .18);
    border-radius: 999px;
    color: #94a3b8;
    text-decoration: none;
    font-size: .76rem;
    font-weight: 850;
    background:
        rgba(99, 102, 241, .035);
    transition:
        color .18s ease,
        border-color .18s ease,
        background .18s ease;
}

.topics-filter-link:hover {
    color: #fff;
    border-color:
        rgba(129, 140, 248, .34);
    background:
        rgba(99, 102, 241, .09);
}

.topics-filter-link.is-selected {
    color: #fff;
    border-color:
        rgba(129, 140, 248, .38);
    background:
        rgba(99, 102, 241, .13);
}

@media (max-width: 620px) {

    .topics-filter {
        gap: 6px;
    }

    .topics-filter-link {
        min-height: 36px;
        padding: 0 11px;
        font-size: .72rem;
    }

}


/* ==========================================================
   Content Lists
   ========================================================== */

.content-list {
    display: grid;
    gap: 12px;
}

.content-card {
    padding: 22px;
    border:
        1px solid
        rgba(255, 255, 255, .075);
    border-radius: 20px;
    background: #111827;
    transition:
        border-color .18s ease,
        background .18s ease;
}

.content-card:hover {
    border-color:
        rgba(129, 140, 248, .16);
    background: #121b2b;
}

.content-card h3 {
    margin: 0;
    line-height: 1.4;
}

.content-card p {
    color: #94a3b8;
    line-height: 1.75;
}


/* ==========================================================
   Content / Article
   ========================================================== */

.content-hero-image {
    display: block;
    width: 100%;
    height: auto;
    margin: 20px 0;
    border:
        1px solid
        rgba(255, 255, 255, .08);
    border-radius: 20px;
}

.article-body {
    margin-top: 20px;
    padding: 28px;
    border:
        1px solid
        rgba(255, 255, 255, .075);
    border-radius: 22px;
    background: #111827;
    color: #dbe4ef;
    line-height: 1.9;
}

.article-body h2,
.article-body h3 {
    color: #fff;
}

.article-body h2:first-child,
.article-body h3:first-child {
    margin-top: 0;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 16px;
}

.article-body a {
    color: #7dd3fc;
}

.badge {
    min-height: 26px;
    padding: 0 9px;
    display: inline-flex;
    align-items: center;
    border:
        1px solid
        rgba(255, 255, 255, .09);
    border-radius: 999px;
    color: #94a3b8;
    font-size: .64rem;
    font-weight: 800;
}


/* ==========================================================
   Empty State
   ========================================================== */

.empty {
    padding: 30px;
    text-align: center;
    color: #94a3b8;
    border:
        1px solid
        rgba(255, 255, 255, .07);
    border-radius: 18px;
    background: #111827;
}




/* ==========================================================
   Contact Page
   ========================================================== */

.contact-layout {
    display: grid;
    grid-template-columns:
        minmax(0, .9fr)
        minmax(0, 1.1fr);
    gap: 18px;
    margin-top: 20px;
    align-items: start;
}

.contact-intro {
    margin-top: 0;
}

.contact-form-card {
    padding: 28px;
    border:
        1px solid
        rgba(255, 255, 255, .075);
    border-radius: 22px;
    background: #111827;
    box-shadow:
        0 18px 48px
        rgba(0, 0, 0, .12);
}

.contact-form-card h2 {
    margin: 0;
    color: #fff;
    font-size: 1.45rem;
    line-height: 1.25;
}

.contact-form-note {
    margin: 9px 0 20px;
    color: #94a3b8;
    font-size: .86rem;
    line-height: 1.7;
}

.contact-form {
    display: grid;
    gap: 16px;
}

.contact-form-grid {
    display: grid;
    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );
    gap: 14px;
}

.contact-field {
    display: grid;
    gap: 7px;
}

.contact-field label {
    color: #dbe4ef;
    font-size: .78rem;
    font-weight: 900;
}

.contact-field input,
.contact-field textarea {
    width: 100%;
    border:
        1px solid
        rgba(255, 255, 255, .11);
    border-radius: 12px;
    outline: none;
    background: #08111f;
    color: #fff;
    font: inherit;
    transition:
        border-color .18s ease,
        box-shadow .18s ease,
        background .18s ease;
}

.contact-field input {
    min-height: 46px;
    padding: 0 13px;
}

.contact-field textarea {
    min-height: 180px;
    padding: 13px;
    resize: vertical;
    line-height: 1.7;
}

.contact-field input:focus,
.contact-field textarea:focus {
    border-color:
        rgba(129, 140, 248, .48);
    box-shadow:
        0 0 0 3px
        rgba(79, 70, 229, .09);
    background: #091321;
}

.contact-submit {
    width: fit-content;
    min-width: 150px;
    min-height: 44px;
    padding: 0 20px;
    border:
        1px solid
        rgba(129, 140, 248, .32);
    border-radius: 12px;
    color: #fff;
    font: inherit;
    font-size: .8rem;
    font-weight: 900;
    cursor: pointer;
    background:
        linear-gradient(
            110deg,
            rgba(37, 99, 235, .35),
            rgba(124, 58, 237, .32)
        );
    transition:
        transform .18s ease,
        border-color .18s ease,
        filter .18s ease;
}

.contact-submit:hover {
    transform: translateY(-1px);
    border-color:
        rgba(129, 140, 248, .5);
    filter: brightness(1.1);
}

.contact-alert {
    margin-bottom: 18px;
    padding: 13px 15px;
    border:
        1px solid
        rgba(255, 255, 255, .08);
    border-radius: 12px;
    font-size: .8rem;
    line-height: 1.65;
}

.contact-alert ul {
    margin: 0;
    padding-inline-start: 20px;
}

.contact-alert-success {
    color: #86efac;
    border-color:
        rgba(34, 197, 94, .18);
    background:
        rgba(22, 101, 52, .12);
}

.contact-alert-error {
    color: #fecaca;
    border-color:
        rgba(248, 113, 113, .2);
    background:
        rgba(127, 29, 29, .12);
}

.contact-honeypot {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

html[dir="rtl"] .contact-submit {
    justify-self: start;
}

@media (max-width: 850px) {

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

}

@media (max-width: 620px) {

    .contact-form-card {
        padding: 19px;
        border-radius: 18px;
    }

    .contact-form-grid {
        grid-template-columns: 1fr;
    }

    .contact-submit {
        width: 100%;
    }

}

/* ==========================================================
   Footer
   ========================================================== */

.site-footer {
    margin-top: 20px;
    border-top:
        1px solid
        rgba(255, 255, 255, .07);
    background: #070c15;
}

.footer-inner {
    min-height: 150px;
    padding: 30px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
}

.footer-title {
    display: inline-block;
    background-image:
        linear-gradient(
            135deg,
            #60a5fa,
            #8b5cf6,
            #ec4899
        );
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #a855f7;
    font-size: 1.28rem;
    font-weight: 1000;
    line-height: 1.25;
}

.footer-domain {
    display: inline-block;
    color: #f8fafc;
    -webkit-text-fill-color: #f8fafc;
    background: none;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: .02em;
    line-height: 1.25;
}

.footer-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 3px;
}

.footer-nav a {
    min-height: 34px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border:
        1px solid
        transparent;
    border-radius: 9px;
    color: #94a3b8;
    text-decoration: none;
    font-size: .76rem;
    font-weight: 750;
    transition:
        color .18s ease,
        background .18s ease,
        border-color .18s ease;
}

.footer-nav a:hover {
    color: #fff;
    border-color:
        rgba(129, 140, 248, .16);
    background:
        rgba(99, 102, 241, .07);
}


/* ==========================================================
   RTL
   ========================================================== */

html[dir="rtl"] .ready-card .card-link {
    align-self: flex-start;
}


/* ==========================================================
   Tablet
   ========================================================== */

@media (max-width: 850px) {

    .header-inner {
        min-height: auto;
        padding: 15px 0;
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }

    .main-nav {
        width: 100%;
        justify-content: flex-start;
    }

    .grid,
    .ready-count-3 {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );
    }

    .ready-count-1 {
        grid-template-columns:
            minmax(0, 580px);
    }

}


/* ==========================================================
   Latest Topics — View All Button
   ========================================================== */

.latest-topics-more {
    width: 100%;
    margin-top: 30px;
    display: flex !important;
    align-items: center;
    justify-content: center !important;
    text-align: center;
}

.latest-topics-more .card-link {
    width: 210px;
    min-width: 210px;
    min-height: 52px;
    margin: 0 auto !important;
    padding: 0 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center !important;
    text-align: center;
    font-size: .9rem;
}

/* ==========================================================
   Mobile
   ========================================================== */

@media (max-width: 620px) {

    .shell {
        width:
            min(
                calc(100% - 22px),
                1180px
            );
    }

    .home-main,
    .page-main {
        padding:
            24px 0
            52px;
    }

    .brand-mark,
    .brand-logo {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
        border-radius: 13px;
    }

    .brand strong {
        font-size: 1rem;
    }

    .main-nav {
        gap: 5px;
    }

    .main-nav a {
        min-height: 38px;
        padding: 0 10px;
        font-size: .76rem;
    }

    .grid,
    .ready-grid,
    .ready-count-1,
    .ready-count-2,
    .ready-count-3 {
        grid-template-columns: 1fr;
    }

    .ready-card {
        min-height: 0;
    }

    .hero {
        padding:
            32px
            18px;
        border-radius: 22px;
    }

    .card,
    .content-card,
    .article-body {
        padding: 19px;
        border-radius: 18px;
    }

    .footer-inner {
        min-height: auto;
        padding: 28px 0;
        gap: 10px;
    }

    .footer-title {
        font-size: 1.18rem;
    }

    .footer-domain {
        font-size: .94rem;
    }

    .footer-nav {
        width: 100%;
    }

}
