@import "./shared/design-tokens.css";

/* ========== Quick Edit ========== */
/* Use this block for homepage rhythm, spacing, and section density tweaks. */

/* ========== Base Layout ========== */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--page);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.5;
}

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

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

.home-page #siteHeader {
    position: fixed;
    z-index: 30;
    top: 0;
    right: 0;
    left: 0;
}

.home-page .site-header {
    border-bottom-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.86);
}

.home-hero {
    position: relative;
    display: grid;
    min-height: 100vh;
    overflow: hidden;
    align-items: center;
    padding: 120px clamp(20px, 7vw, 96px) 98px;
    color: #fff;
}

.hero-visual,
.home-hero::before {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.hero-visual {
    background: var(--hero-fallback-image) center / cover no-repeat;
    opacity: 1;
    transition: opacity 0.45s ease, transform 0.8s ease;
}

.hero-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.home-hero::before {
    z-index: -2;
    content: "";
    background: var(--hero-fallback-image) center / cover no-repeat;
}

.primary-button,
.ghost-button,
.pill-button,
.ghost-dark-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 24px;
    border-radius: 999px;
    font-weight: 800;
}

.primary-button,
.pill-button {
    background: var(--primary);
    color: #fff;
}

.primary-button:hover,
.pill-button:hover {
    background: var(--primary-dark);
}

.ghost-button {
    border: 1px solid rgba(255, 255, 255, 0.62);
    color: #fff;
}

.ghost-dark-button {
    border: 1px solid rgba(255, 255, 255, 0.46);
    color: #fff;
}

.home-section {
    width: var(--space-content-width);
    margin-inline: auto;
    padding: 68px 0 0;
}

.section-title {
    margin-bottom: 24px;
}

.section-title.centered {
    text-align: center;
}

.section-title-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.section-title p,
.case-band p {
    margin: 0 0 8px;
    color: var(--accent-dark);
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
}

.section-title h2,
.case-band h2 {
    margin: 0;
    color: var(--ink);
    font-size: clamp(28px, 3.5vw, 38px);
    line-height: 1.2;
}

.section-title > span {
    display: block;
    max-width: 680px;
    margin: 14px auto 0;
    color: var(--muted);
    font-size: 16px;
}

.section-title-row a {
    color: var(--accent-dark);
    font-weight: 900;
}

.product-mosaic {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    grid-template-rows: repeat(2, minmax(220px, 1fr));
    gap: 18px;
}

.product-card {
    position: relative;
    isolation: isolate;
    display: grid;
    min-height: 260px;
    overflow: hidden;
    align-content: end;
    gap: 18px;
    padding: 30px;
    color: #fff;
}

.product-card-large {
    grid-row: span 2;
    min-height: 520px;
}

.product-card::before {
    position: absolute;
    z-index: -2;
    inset: 0;
    content: "";
    background: var(--card-image) center / cover no-repeat;
    transition: transform 0.5s ease, filter 0.5s ease;
}

.product-card::after {
    position: absolute;
    z-index: -1;
    inset: 0;
    content: "";
    background:
        linear-gradient(90deg, rgba(3, 15, 25, 0.72), rgba(3, 15, 25, 0.16)),
        linear-gradient(0deg, rgba(3, 15, 25, 0.58), rgba(3, 15, 25, 0.08));
    transition: opacity 0.5s ease;
}

.product-card:hover::before {
    transform: scale(1.055);
    filter: saturate(1.08);
}

.product-card:hover::after {
    opacity: 0.62;
}

.product-card small {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.product-card span {
    padding-left: 12px;
    border-left: 3px solid var(--primary);
    font-size: 22px;
    font-weight: 900;
}

.product-card strong {
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.35s ease, transform 0.35s ease;
    white-space: nowrap;
}

.product-card:hover strong {
    opacity: 1;
    transform: translateX(0);
}

.solution-section {
    width: 100%;
    padding-top: 76px;
    padding-bottom: 66px;
    background: #edf2ef;
}

.solution-section > .section-title,
.solution-tabs,
.solution-feature {
    width: var(--space-content-width);
    margin-inline: auto;
}

.solution-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    margin-bottom: 20px;
    border: 1px solid #dce5dd;
    background: #fff;
}

.solution-tab {
    min-height: 58px;
    border: 0;
    border-right: 1px solid #dce5dd;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-weight: 900;
}

.solution-tab:last-child {
    border-right: 0;
}

.solution-tab.active {
    background: var(--primary);
    color: #fff;
}

.solution-feature {
    display: grid;
    grid-template-columns: minmax(300px, 0.78fr) minmax(0, 1.22fr);
    overflow: hidden;
    border-radius: var(--radius-card);
    background: #fff;
    box-shadow: var(--shadow);
}

.solution-copy {
    display: grid;
    align-content: center;
    gap: 16px;
    padding: clamp(28px, 5vw, 56px);
}

.solution-copy p,
.solution-copy h3,
.solution-copy span {
    margin: 0;
}

.solution-copy p {
    color: var(--accent-dark);
    font-size: 25px;
    font-weight: 900;
}

.solution-copy h3 {
    color: var(--ink);
    font-size: clamp(23px, 3vw, 42px);
    line-height: 1.22;
}

.solution-copy span {
    color: var(--muted);
    font-size: 17px;
}

.solution-points {
    display: grid;
    gap: 10px;
    margin: 4px 0 0;
    padding: 0;
    list-style: none;
}

.solution-points li {
    position: relative;
    padding-left: 20px;
    color: #3b4a5b;
    font-size: 15px;
    font-weight: 700;
}

.solution-points li::before {
    position: absolute;
    top: 9px;
    left: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    content: "";
}

.solution-copy .pill-button {
    justify-self: start;
    margin-top: 12px;
}

.solution-feature img {
    width: 100%;
    height: 100%;
    min-height: 420px;
    object-fit: cover;
    transition: transform 0.6s ease, opacity 0.6s ease;
}

.solution-feature:hover img {
    opacity: 0.94;
    transform: scale(1.035);
}

.solution-card-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    width: var(--space-content-width);
    margin: 22px auto 0;
}

.solution-mini-card {
    position: relative;
    isolation: isolate;
    display: grid;
    min-height: 154px;
    overflow: hidden;
    align-content: end;
    gap: 8px;
    padding: 22px;
    color: #fff;
}

.solution-mini-card::before,
.solution-mini-card::after {
    position: absolute;
    inset: 0;
    content: "";
}

.solution-mini-card::before {
    z-index: -2;
    background: var(--solution-card-image) center / cover no-repeat;
    transition: transform 0.45s ease;
}

.solution-mini-card::after {
    z-index: -1;
    background: linear-gradient(0deg, rgba(4, 18, 31, 0.72), rgba(4, 18, 31, 0.18));
}

.solution-mini-card:hover::before {
    transform: scale(1.055);
}

.solution-mini-card span {
    color: var(--accent);
    font-size: 13px;
    font-weight: 900;
}

.solution-mini-card strong {
    font-size: 18px;
    line-height: 1.35;
}

.legacy-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: var(--space-content-width);
    margin: 56px auto 0;
    border: 1px solid var(--line);
    background: #fff;
}

.legacy-stats div {
    display: grid;
    min-height: 132px;
    align-content: center;
    gap: 8px;
    padding: 24px;
    border-right: 1px solid var(--line);
    text-align: center;
}

.legacy-stats div:last-child {
    border-right: 0;
}

.legacy-stats strong {
    color: var(--accent-dark);
    font-size: clamp(30px, 3.5vw, 42px);
    line-height: 1;
}

.legacy-stats span {
    color: var(--muted);
    font-size: 15px;
    font-weight: 800;
}

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

.news-card {
    display: flex;
    height: 100%;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 12px 32px rgba(16, 32, 51, 0.08);
}

.news-card a {
    display: flex;
    flex: 1;
    flex-direction: column;
    height: 100%;
    transition: background 0.35s ease, transform 0.35s ease;
}

.news-card:hover a {
    transform: translateY(-4px);
}

.news-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.news-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 13px;
    padding: 20px 24px 24px;
}

.news-card h3 {
    display: -webkit-box;
    min-height: calc(1.35em * 2);
    margin: 0;
    overflow: hidden;
    color: var(--ink);
    font-size: 21px;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.news-card p {
    display: -webkit-box;
    min-height: calc(1.7em * 5);
    margin: 0;
    overflow: hidden;
    color: var(--muted);
    line-height: 1.7;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
}

.news-card-action {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    margin-top: auto;
    padding: 9px 0 0;
    color: var(--accent-dark);
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
}

.case-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    min-height: 300px;
    margin-bottom: 20px;
    padding: clamp(28px, 5vw, 58px);
    background:
        linear-gradient(90deg, rgba(8, 22, 36, 0.9), rgba(8, 22, 36, 0.58)),
        var(--case-image) center / cover no-repeat;
    color: #fff;
}

.case-band p {
    color: var(--accent);
}

.case-band h2 {
    color: #fff;
}

.case-band span {
    display: block;
    max-width: 680px;
    margin-top: 14px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 17px;
}

.case-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
}

.ghost-dark-button-muted {
    background: rgba(255, 255, 255, 0.1);
}

/* ========== Responsive ========== */
@media (max-width: 980px) {
    .product-mosaic,
    .solution-feature,
    .news-grid,
    .solution-card-strip,
    .legacy-stats {
        grid-template-columns: 1fr;
    }

    .product-card-large {
        grid-row: auto;
        min-height: 320px;
    }

    .news-card {
        border-right: 0;
    }

    .legacy-stats div {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .legacy-stats div:last-child {
        border-bottom: 0;
    }
}

@media (max-width: 760px) {
    .home-page #siteHeader {
        position: sticky;
    }

    .home-hero {
        min-height: 720px;
        padding-top: 72px;
        padding-bottom: 160px;
    }

    .section-title-row,
    .case-band {
        align-items: flex-start;
        flex-direction: column;
    }

    .product-card {
        min-height: 240px;
        padding: 24px;
    }

    .solution-tabs {
        grid-template-columns: 1fr;
    }

    .solution-tab {
        border-right: 0;
        border-bottom: 1px solid #dce5dd;
    }

    .solution-tab:last-child {
        border-bottom: 0;
    }

    .solution-feature {
        border-radius: 0;
    }

    .solution-feature img {
        min-height: 280px;
        order: -1;
    }
}
