.referenssi-page {
    display: block;
    width: 100%;
    min-height: 0;
    padding: 0;
    text-align: initial;
}

.referenssi-hero {
    width: 100%;
    margin: 0 auto;
    padding: calc(var(--nav-height) + 40px) 24px 24px;
    text-align: center;
}

.referenssi-hero h1 {
    max-width: 1000px;
    margin: 0 auto;
    font-size: var(--otsikko2-koko);
    line-height: 1.08;
    text-transform: uppercase;
}

.referenssi-hero > p {
    max-width: 60ch;
    margin: 16px auto 0;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
}

.hero-cta {
    display: flex;
    justify-content: center;
}

.hero-cta .button {
    width: 250px;
    margin-top: 15px;
}

.referenssi-stats {
    width: min(800px, calc(100% - 32px));
    margin: 20px auto 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(28, 28, 28, 0.08);
    border-radius: 22px;
    padding: clamp(20px, 3vw, 28px);
    box-shadow: 0 12px 18px rgba(0, 0, 0, 0.04);
}

.stat-card strong {
    display: block;
    font-size: clamp(2rem, 4vw, 3rem);
    font-family: "Archivo Black", sans-serif;
    color: var(--väri-main);
}

.stat-card span {
    display: block;
    margin-top: 6px;
    font-size: 0.96rem;
    color: var(--väri-teksti-secondary);
}

.referenssi-kortit {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding: clamp(44px, 8vw, 96px) 0 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 28px;
}

.reference-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid rgba(28, 28, 28, 0.08);
    border-radius: 26px;
    box-shadow: 0 15px 28px rgba(28, 28, 28, 0.06);
}

.reference-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    border-radius: 0;
    filter: none;
}

.reference-card-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 22px 20px 24px;
}

.reference-card h2 {
    font-size: clamp(1.25rem, 2vw, 1.7rem);
    line-height: 1.2;
}

.reference-card p {
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.7;
    color: var(--väri-teksti-secondary);
}

.reference-card ul {
    list-style: none;
    display: grid;
    gap: 8px;
    margin: 8px 0 0;
}

.reference-card li {
    display: flex;
    gap: 8px;
    color: var(--väri-teksti-secondary);
    font-size: 0.92rem;
    line-height: 1.5;
}

.reference-card li::before {
    content: "•";
    color: var(--väri-main);
    font-weight: 700;
}

.referenssi-tekstit {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding: clamp(32px, 8vw, 96px) 0 clamp(48px, 8vw, 96px);
}

.referenssi-tekstit .section-heading {
    margin-bottom: 20px;
    text-align: left;
}

.referenssi-tekstit .section-heading h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.1;
}

.referenssi-tekstit .section-heading p {
    margin-top: 12px;
    color: var(--väri-teksti-secondary);
    text-align: left;
}

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

.feature-item {
    padding: 26px 22px;
    border-radius: 22px;
    background: rgba(252, 198, 4, 0.1);
    border: 1px solid rgba(252, 198, 4, 0.24);
    text-align: left;
        box-shadow: 0 12px 18px rgba(0, 0, 0, 0.04);

}

.feature-item h3 {
    font-size: 1.15rem;
    margin-bottom: 10px;
}

.feature-item p {
    margin: 0;
    color: var(--väri-teksti-secondary);
    font-size: 0.96rem;
    line-height: 1.7;
}

.footer{
    width: 100vw;
    margin-left: calc(50% - 50vw);
    padding: clamp(40px, 6vw, 64px) max(20px, 6vw);
    background: var(--väri-teksti);
    color: var(--väri-body);
}

.footerSisalto{
    display: flex;
    justify-content: space-between;
    gap: clamp(32px, 5vw, 72px);
    width: min(100%, 1200px);
    margin: 0 auto;
}

.footerEsittely,
.footerYhteystiedot{
    min-width: 0;
}

.footer h2{
    margin-bottom: 16px;
    color: var(--väri-main);
    font-size: 24px;
    text-align: left;
}

.footerEsittely p{
    max-width: 32ch;
    line-height: 1.7;
    text-align: left;
}

.footerHenkilot{
    display: flex;
    flex-wrap: wrap;
    gap: clamp(24px, 4vw, 48px);
}

.footer address{
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    font-style: normal;
    text-align: left;
}

.footerKuva{
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
}

.footer address h3{
    margin-bottom: 4px;
    font-size: 18px;
}

.footer a{
    color: var(--väri-body);
    text-decoration-color: var(--väri-main);
    text-underline-offset: 4px;
    overflow-wrap: anywhere;
}

.footer a:hover{
    color: var(--väri-main);
}

@media (max-width: 650px){
    .referenssi-stats{
        grid-template-columns: 1fr;
    }

    .footerSisalto{
        flex-direction: column;
        gap: 28px;
    }
}

@media (max-width: 860px) {
    .feature-grid,
    .footerSisalto,
    .footerHenkilot {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .referenssi-hero {
        padding-top: calc(var(--nav-height) + 32px);
    }

    .reference-card-body {
        padding: 20px 18px 22px;
    }
}
