/* tfnd.fi — Oy Trans Ferdinand Ab
   Kehyksetön tyylitiedosto. Ulkoasu asiakkaan luonnoksen mukaan (2026-10). */

/* ---------- Fontit (itse hostattu, latin-osajoukko, SIL OFL 1.1) ---------- */

@font-face {
    font-family: "Montserrat";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(../fonts/montserrat-latin-400-normal.woff2) format("woff2");
}

@font-face {
    font-family: "Montserrat";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url(../fonts/montserrat-latin-700-normal.woff2) format("woff2");
}

/* ---------- Muuttujat ---------- */

:root {
    --navy: #0e2a4a;
    --navy-deep: #0a1e36;
    --text: #2b3d52;
    --muted: #5d6f82;
    --tint: #eef3f8;
    --line: #dbe3ec;
    --yellow: #f6c42c;
    --yellow-dark: #e5b10f;
    --green: #1b5e4b;
    --white: #fff;
    --sans: "Montserrat", "Helvetica Neue", Arial, sans-serif;
    --nav-h: 72px;
    --max: 72rem;
    --radius: 6px;
}

/* ---------- Perusta ---------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-h);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--sans);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text);
    background: var(--white);
}

h1,
h2 {
    margin: 0 0 .6em;
    font-weight: 700;
    line-height: 1.15;
    color: var(--navy);
}

h2 {
    font-size: clamp(1.6rem, 3vw, 2.1rem);
}

p {
    margin: 0 0 1.2em;
}

p:last-child {
    margin-bottom: 0;
}

a {
    color: var(--navy);
    text-decoration: underline;
    text-decoration-color: var(--yellow);
    text-decoration-thickness: 2px;
    text-underline-offset: .2em;
}

a:hover {
    text-decoration-color: var(--navy);
}

:focus-visible {
    outline: 3px solid var(--yellow);
    outline-offset: 3px;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ico {
    width: 1em;
    height: 1em;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.skip-link {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 100;
    padding: .75rem 1rem;
    color: var(--navy);
    background: var(--yellow);
    transform: translateY(-100%);
}

.skip-link:focus {
    transform: none;
}

.wrap {
    width: min(100% - 2rem, var(--max));
    margin-inline: auto;
}

/* ---------- Painike ---------- */

.btn {
    display: inline-flex;
    gap: .6em;
    align-items: center;
    padding: .8em 1.5em;
    font-size: .9375rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--navy);
    text-decoration: none;
    background: var(--yellow);
    border-radius: 999px;
    transition: background .2s ease-in-out;
}

.btn:hover {
    background: var(--yellow-dark);
}

.btn .ico {
    font-size: 1.15em;
    stroke-width: 2.2;
    transition: transform .2s ease-in-out;
}

.btn:hover .ico {
    transform: translateX(3px);
}

/* ---------- Navigaatio ---------- */

.nav {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--white);
    transition: box-shadow .3s ease-in-out;
}

.nav.is-scrolled,
.nav.is-open {
    box-shadow: 0 2px 16px rgba(14, 42, 74, .12);
}

.nav-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1.5rem;
    align-items: center;
    justify-content: space-between;
    width: min(100% - 2rem, var(--max));
    min-height: var(--nav-h);
    margin-inline: auto;
}

.brand img {
    width: 112px;
}

.nav-toggle {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    font-size: 1.5rem;
    color: var(--navy);
    background: none;
    border: 0;
    border-radius: var(--radius);
    cursor: pointer;
}

.nav-toggle:hover {
    background: var(--tint);
}

.nav-menu {
    display: none;
    flex-basis: 100%;
    padding-bottom: .75rem;
}

.nav.is-open .nav-menu {
    display: block;
}

.nav-menu a {
    display: block;
    padding: .7rem .25rem;
    font-size: .9375rem;
    font-weight: 700;
    color: var(--navy);
    text-decoration: none;
    border-bottom: 1px solid var(--line);
}

.nav-menu a[aria-current="true"] {
    color: var(--navy);
    box-shadow: inset 3px 0 0 var(--yellow);
    padding-left: .75rem;
}

.nav-cta {
    display: none;
}

@media (min-width: 900px) {
    .brand img {
        width: 128px;
    }

    .nav-toggle {
        display: none;
    }

    .nav-menu,
    .nav.is-open .nav-menu {
        display: flex;
        flex-basis: auto;
        gap: 2rem;
        padding: 0;
        margin-left: auto;
    }

    .nav-menu a {
        position: relative;
        padding: .5rem 0;
        font-size: .875rem;
        border: 0;
    }

    .nav-menu a::after {
        position: absolute;
        right: 0;
        bottom: 0;
        left: 0;
        height: 3px;
        content: "";
        background: var(--yellow);
        border-radius: 2px;
        transform: scaleX(0);
        transition: transform .2s ease-in-out;
    }

    .nav-menu a:hover::after,
    .nav-menu a[aria-current="true"]::after {
        transform: none;
    }

    .nav-menu a[aria-current="true"] {
        padding-left: 0;
        box-shadow: none;
    }

    .nav-cta {
        display: inline-flex;
        margin-left: 1rem;
        font-size: .875rem;
    }
}

/* ---------- Hero ---------- */

.hero {
    position: relative;
    display: grid;
    align-items: center;
    min-height: clamp(30rem, 78vh, 44rem);
    padding-block: 4rem;
    overflow: hidden;
    color: var(--white);
    background: var(--navy-deep);
}

.hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 65% 70%;
}

.hero::before {
    position: absolute;
    inset: 0;
    z-index: 1;
    content: "";
    background: linear-gradient(rgba(10, 30, 54, .55), rgba(10, 30, 54, .8));
}

@media (min-width: 768px) {
    .hero-img {
        object-position: 100% 75%;
    }

    .hero::before {
        background: linear-gradient(90deg, rgba(10, 30, 54, .92) 0%, rgba(10, 30, 54, .82) 40%, rgba(10, 30, 54, .5) 50%, rgba(10, 30, 54, 0) 68%);
    }
}

.hero-text {
    position: relative;
    z-index: 2;
}

.hero-text > * {
    max-width: 34rem;
}

.hero h1 {
    font-size: clamp(1.7rem, 8vw, 3.4rem);
    color: var(--white);
}

.hero-text > p {
    font-size: clamp(1.05rem, 1.8vw, 1.2rem);
}

.hero-btn {
    margin-top: 2rem;
}

/* ---------- Palvelut ---------- */

.services {
    padding-block: 3rem;
    border-bottom: 1px solid var(--line);
}

.service-list {
    display: grid;
    gap: 1.75rem;
}

.service-list li {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 1rem;
    align-items: start;
}

.service-list .ico {
    grid-row: span 2;
    font-size: 2.25rem;
    color: var(--navy);
    stroke-width: 1.5;
}

.service-list h3 {
    margin: 0 0 .2rem;
    font-size: .9375rem;
    line-height: 1.3;
    color: var(--navy);
}

.service-list p {
    grid-column: 2;
    font-size: .8125rem;
    line-height: 1.55;
    color: var(--muted);
}

.service-list p + p {
    margin-top: .5rem;
}

@media (min-width: 768px) {
    .services {
        padding-block: 3.5rem;
    }

    .service-list {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 2.5rem 0;
    }

    .service-list li {
        display: flex;
        flex: 0 0 33.333%;
        flex-direction: column;
        align-items: center;
        padding-inline: 1rem;
        text-align: center;
    }

    .service-list .ico {
        margin-bottom: .9rem;
        font-size: 2.5rem;
    }

    .service-list h3 {
        margin-bottom: .4rem;
    }

    .service-list p {
        max-width: 15rem;
    }
}

@media (min-width: 1200px) {
    .service-list li {
        flex-basis: 20%;
    }

    .service-list li + li {
        border-left: 1px solid var(--line);
    }
}

/* ---------- Kuva + teksti -osiot ---------- */

.split {
    display: grid;
    background: var(--tint);
}

.split + .split {
    border-top: 2rem solid var(--white);
}

.split-text {
    padding: 2.5rem 1rem 3rem;
    width: min(100%, 40rem);
    margin-inline: auto;
}

.split-img {
    order: -1;
}

.split-img img {
    width: 100%;
    height: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.split-fit .split-img img {
    aspect-ratio: auto;
}

@media (min-width: 900px) {
    .split {
        grid-template-columns: 1fr 1fr;
        align-items: center;
        min-height: 26rem;
    }

    .split + .split {
        border-top-width: 3rem;
    }

    .split-text {
        width: min(100%, 34rem);
        padding: 4rem 1.5rem;
        margin-inline: auto;
    }

    .split-img {
        order: 0;
        align-self: stretch;
    }

    .split-img img {
        aspect-ratio: auto;
    }

    .split-rev .split-img {
        order: -1;
    }

    .split-fit .split-img {
        align-self: center;
    }

    .split-fit .split-img img {
        height: auto;
    }
}

.values {
    display: flex;
    margin-top: 2rem;
}

.values li {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: .6rem;
    align-items: center;
    padding-inline: .5rem;
    font-size: .875rem;
    font-weight: 700;
    color: var(--navy);
    text-align: center;
}

.values li + li {
    border-left: 1px solid var(--line);
}

.values .ico {
    font-size: 2.5rem;
    stroke-width: 1.5;
}

@media (max-width: 379px) {
    .values li {
        padding-inline: .25rem;
        font-size: .75rem;
    }
}

.note {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 2rem;
    font-size: .9375rem;
    line-height: 1.5;
    color: var(--green);
}

.note .ico {
    font-size: 2.75rem;
    stroke-width: 2;
}

/* ---------- Sertifikaatit ---------- */

.certs {
    padding-block: 3rem;
    background: var(--tint);
    border-top: 3rem solid var(--white);
}

.cert-list {
    display: grid;
    gap: 2.5rem;
}

.cert-list li {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.cert-logo {
    width: auto;
    height: 6rem;
    margin-bottom: 1rem;
}

/* Mobiilissa pystymallinen merkki, leveämmällä näytöllä vaakamallinen (<picture>) */
.cert-list picture {
    display: contents;
}

.cert-logo--asiakastieto {
    height: 10rem;
    margin-bottom: 0;
}

.cert-list h3 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.3;
    color: var(--navy);
}

@media (min-width: 768px) {
    .certs {
        padding-block: 3.5rem;
    }

    .cert-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 0;
    }

    .cert-list li {
        padding-inline: 1.5rem;
    }

    .cert-list li + li {
        border-left: 1px solid var(--line);
    }

    .cert-logo--asiakastieto {
        width: 100%;
        max-width: 18rem;
        height: auto;
        aspect-ratio: 13 / 5;
        margin-block: auto;
        object-fit: cover;
        object-position: right; /* SVG:n vasemmassa reunassa on tyhjää */
    }
}

/* ---------- Kalusto ---------- */

.fleet {
    padding-block: 4rem;
    background: var(--tint);
    border-top: 3rem solid var(--white);
}

.fleet-inner {
    display: grid;
    gap: 2rem;
    align-items: center;
}

.fleet-lead {
    margin-bottom: .6em;
    font-weight: 700;
    color: var(--navy);
}

.fleet-text p:not(.fleet-lead) {
    font-size: .9375rem;
}

.fleet-photos {
    display: grid;
    gap: .75rem;
}

.fleet-photos img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--radius);
}

@media (min-width: 900px) {
    .fleet-inner {
        grid-template-columns: minmax(16rem, 1fr) 2.6fr;
        gap: 3rem;
    }

    .fleet-photos {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ---------- Yhteystiedot ---------- */

.cta {
    padding-block: 4rem;
    margin-top: 3rem;
    color: var(--white);
    --shade: linear-gradient(90deg, rgba(10, 30, 54, .95) 0%, rgba(10, 30, 54, .8) 50%, rgba(10, 30, 54, .55));
    background: var(--navy-deep) no-repeat center 70% / cover;
    background-image: var(--shade), url(../img/banneri.jpg);
    background-image: var(--shade), image-set(url(../img/banneri.webp) type("image/webp"), url(../img/banneri.jpg) type("image/jpeg"));
}

.cta h2 {
    color: var(--white);
}

.cta p {
    margin-bottom: 1.75rem;
    font-size: 1.1rem;
}

@media (min-width: 900px) {
    .cta {
        padding-block: 5rem;
    }
}

/* ---------- Footer ---------- */

.footer {
    padding-top: 3rem;
    font-size: .875rem;
    color: rgba(255, 255, 255, .85);
    background: var(--navy-deep);
}

.footer a {
    color: inherit;
    text-decoration: none;
}

.footer a:hover {
    color: var(--white);
    text-decoration: underline;
    text-decoration-color: var(--yellow);
}

.footer-inner {
    display: grid;
    gap: 2rem;
}

.footer-logo img {
    width: 140px;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.5rem;
}

.footer-contact li {
    display: flex;
    gap: .75rem;
    align-items: center;
    padding-block: .3rem;
}

.footer-contact .ico {
    font-size: 1.15rem;
    color: var(--yellow);
}

.footer-bottom {
    padding-block: 1.5rem;
    margin-top: 2.5rem;
    color: rgba(255, 255, 255, .6);
    border-top: 1px solid rgba(255, 255, 255, .12);
}

.footer-bottom a {
    text-decoration: underline;
}

@media (min-width: 900px) {
    .footer-inner {
        grid-template-columns: auto 1fr auto;
        gap: 3rem;
        align-items: center;
    }

    .footer-nav {
        justify-content: center;
    }
}

/* ---------- Liikkeenvähennys ---------- */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
