* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* =========================================================
   Theme
========================================================= */

:root {
    color-scheme: light dark;

    --page-background: #ffffff;
    --footer-background: #f4f4f4;

    --ink: #171717;
    --text: #252525;
    --muted: #626262;
    --line: #dedede;

    --link: #424245;
    --footer-muted: #6e6e73;
    --footer-divider: #86868b;

    --header-background: #111111;
    --header-text: #ffffff;
    --header-muted: rgba(255, 255, 255, 0.72);

    --card-title: #ffffff;
    --card-subtitle: rgba(255, 255, 255, 0.92);
    --card-body: rgba(255, 255, 255, 0.84);

    --body-font: "Fira Sans", sans-serif;
    --title-font: "League Spartan", sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --page-background: #111111;
        --footer-background: #1a1a1a;

        --ink: #f5f5f5;
        --text: #e5e5e5;
        --muted: #b5b5b5;
        --line: #333333;

        --link: #d8d8d8;
        --footer-muted: #b5b5b5;
        --footer-divider: #666666;
    }
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;

    background-color: var(--page-background);
    color: var(--ink);
    font-family: var(--body-font);
    line-height: 1.42;
}

img {
    user-select: none;
    -webkit-user-drag: none;
}

a {
    color: inherit;
}

.title-font {
    font-family: var(--title-font);
    font-weight: 700;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;

    height: 74px;
    padding: 0 24px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    background: var(--header-background);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.brand {
    height: 100%;

    display: inline-flex;
    align-items: center;
    gap: 18px;

    color: var(--header-text);
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}

.brand img {
    display: block;

    width: auto;
    height: 62px;
    max-width: none;

    object-fit: contain;
    filter: none;

    transform: translateY(1px);
}

.brand span {
    display: block;

    color: var(--header-text);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;

    transform: translateY(2px);
}

/* =========================================================
   Scroll down behavior for header
========================================================= */

.site-header {
    --header-height: 74px;

    height: var(--header-height);

    transition:
        height 0.22s ease,
        padding 0.22s ease,
        box-shadow 0.22s ease,
        border-color 0.22s ease;
}

.brand img {
    transition:
        height 0.22s ease,
        transform 0.22s ease;
}

.brand span {
    transition:
        font-size 0.22s ease,
        transform 0.22s ease;
}

.site-header.is-scrolled {
    --header-height: 58px;

    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
    border-bottom-color: rgba(255, 255, 255, 0.12);
}

.site-header.is-scrolled .brand img {
    height: 46px;
}

.site-header.is-scrolled .brand span {
    font-size: 1.62rem;
    transform: translateY(1px);
}

/* =========================================================
   Navigation
========================================================= */

.site-nav {
    display: flex;
    align-items: center;
    gap: 23px;
}

.site-nav a {
    color: var(--header-muted);
    font-size: 0.90rem;
    font-weight: 500;
    text-decoration: none;
    line-height: 1;
}

.site-nav a:hover,
.site-nav a.active,
.site-nav a[aria-current="page"] {
    color: var(--header-text);
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* =========================================================
   Mobile Menu Button
========================================================= */

.menu-toggle {
    display: none;

    width: 38px;
    height: 38px;

    border: 0;
    background: transparent;

    cursor: pointer;
}

.menu-toggle span {
    display: block;

    width: 22px;
    height: 2px;
    margin: 5px auto;

    background: var(--header-text);
    border-radius: 999px;

    transition:
        transform 0.2s ease,
        opacity 0.2s ease;
}

.menu-toggle:focus-visible {
    outline: 2px solid var(--header-text);
    outline-offset: 2px;
}

/* =========================================================
   Main
========================================================= */

.home-main {
    flex: 1;
    background-color: var(--page-background);
}

/* =========================================================
   Feature Grid
========================================================= */

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

    padding: 14px;
}

.home-feature-card {
    position: relative;
    isolation: isolate;
    overflow: hidden;

    min-height: 620px;
    padding: 70px 42px;

    display: flex;
    align-items: flex-start;
    justify-content: center;

    color: #ffffff;
    text-align: center;
    text-decoration: none;

    background-size: cover;
    background-position: center;
}

.home-feature-card::before {
    content: "";

    position: absolute;
    inset: 0;
    z-index: -2;

    background-size: cover;
    background-position: center;

    transition: transform 0.6s ease;
}

.home-feature-card::after {
    content: "";

    position: absolute;
    inset: 0;
    z-index: -1;

    background:
        linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0.62),
            rgba(0, 0, 0, 0.24) 45%,
            rgba(0, 0, 0, 0.50)
        );
}

.home-feature-card:hover::before {
    transform: scale(1.035);
}

.home-feature-content {
    width: 100%;
    max-width: 620px;
}

/* Main card title: Aerial Imagery, Railway Mapping, etc. */
.home-feature-content .home-feature-eyebrow {
    margin: 0 auto 14px;

    color: var(--card-title);
    font-family: var(--title-font);
    font-size: clamp(54px, 6vw, 92px);
    font-weight: 700;
    line-height: 0.9;
    letter-spacing: -0.055em;
}

/* Subtitle: Continuous monitoring..., Detailed railway..., etc. */
.home-feature-content h2 {
    max-width: 560px;
    margin: 0 auto 16px;

    color: var(--card-subtitle);
    font-size: clamp(20px, 2.1vw, 30px);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -0.025em;
}

/* Body copy only. This avoids overriding .home-feature-eyebrow. */
.home-feature-content > p:not(.home-feature-eyebrow) {
    max-width: 460px;
    margin: 0 auto;

    color: var(--card-body);
    font-size: 18px;
    font-weight: 400;
    line-height: 1.35;
}

/* =========================================================
   Feature Images
========================================================= */

.home-feature-card-aerial::before {
    background-image: url("../images/railway-aerial.jpeg");
}

.home-feature-card-mapping::before {
    background-image: url("../images/railway-mapping.jpeg");
}

.home-feature-card-records::before {
    background-image: url("../images/railway-documents.jpeg");
}

.home-feature-card-scheduling::before {
    background-image: url("../images/railway-scheduling.jpeg");
}

.home-feature-card-assets::before {
    background-image: url("../images/railway-assets.jpeg");
}

.home-feature-card-support::before {
    background-image: url("../images/railway-support.jpeg");
}

.home-feature-card-tools::before {
    background-image: url("../images/railway-and-more.jpeg");
}

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

.site-footer {
    background-color: var(--footer-background);
    color: var(--ink);
    border-top: 1px solid var(--line);
}

.footer-main {
    max-height: 66px;
    padding: 10px 32px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    background-color: var(--footer-background);
    color: var(--ink);
}

.footer-contact {
    display: flex;
    flex-direction: column;
    gap: 2px;

    font-size: 0.82rem;
    line-height: 1.25;
}

.footer-contact p {
    color: var(--ink);
    font-weight: 600;
}

.footer-contact a {
    color: var(--link);
    text-decoration: none;
}

.footer-contact a:hover {
    text-decoration: underline;
}

.footer-logo {
    flex: 0 0 auto;
    margin-left: auto;
}

.footer-logo img {
    width: auto;
    height: 62px;
    filter: brightness(0) saturate(100%);
}

@media (prefers-color-scheme: dark) {
    .footer-logo img {
        filter: brightness(0) invert(1);
    }
}

.footer-bottom {
    display: block;

    padding: 9px 32px 10px;

    background-color: var(--footer-background);
    color: var(--footer-muted);

    font-size: 0.76rem;
    font-weight: 400;
    line-height: 1.25;
    text-align: left;
}

.footer-bottom span {
    display: block;
    margin-bottom: 3px;

    color: var(--footer-muted);
}

.footer-bottom a {
    display: inline;

    color: var(--link);
    text-decoration: none;
}

.footer-bottom a:hover {
    text-decoration: underline;
}

.footer-bottom a:not(:last-child)::after {
    content: "|";

    margin: 0 6px;

    color: var(--footer-divider);
    text-decoration: none;
}

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

@media (max-width: 900px) {
    .site-header,
    .footer-main,
    .footer-bottom {
        padding-left: 18px;
        padding-right: 18px;
    }

    .site-nav {
        gap: 12px;
    }

    .site-nav a {
        font-size: 0.8rem;
    }

    .home-feature-grid {
        grid-template-columns: 1fr;
    }

    .home-feature-card {
        min-height: 540px;
        padding: 56px 26px;
    }

    .home-feature-content .home-feature-eyebrow {
        font-size: clamp(50px, 10vw, 76px);
    }

    .home-feature-content h2 {
        font-size: clamp(22px, 4vw, 30px);
    }

    .footer-main {
        min-height: auto;
        max-height: none;

        flex-direction: row;
        align-items: center;
        justify-content: space-between;

        padding-top: 9px;
        padding-bottom: 9px;
    }

    .footer-logo img {
        height: 56px;
    }
}

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

@media (max-width: 640px) {
    .site-header {
        --header-height: 54px;

        height: var(--header-height);
        padding-left: 16px;
        padding-right: 12px;
    }

    .brand {
        gap: 10px;
    }

    .brand img {
        height: 40px;
        max-width: none;
    }

    .brand span {
        font-size: 1.3rem;
        transform: translateY(1px);
    }

    .menu-toggle {
        display: block;
        margin-left: auto;
    }

    .site-nav {
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;

        display: none;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;

        padding: 8px 16px 14px;

        background: var(--header-background);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .site-header.nav-open .site-nav {
        display: flex;
    }

    .site-nav a {
        width: 100%;
        padding: 12px 0;

        color: var(--header-muted);
        font-size: 0.92rem;
        font-weight: 600;
        text-decoration: none;
    }

    .site-nav a:hover,
    .site-nav a.active,
    .site-nav a[aria-current="page"] {
        color: var(--header-text);
        text-decoration: none;
    }

    .site-header.nav-open .menu-toggle span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .site-header.nav-open .menu-toggle span:nth-child(2) {
        opacity: 0;
    }

    .site-header.nav-open .menu-toggle span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .home-feature-grid {
        gap: 10px;
        padding: 10px;
    }

    .home-feature-card {
        min-height: 480px;
        padding: 50px 22px;
    }

    .home-feature-content .home-feature-eyebrow {
        font-size: clamp(44px, 13vw, 60px);
        line-height: 0.92;
    }

    .home-feature-content h2 {
        font-size: 24px;
        line-height: 1.08;
    }

    .home-feature-content > p:not(.home-feature-eyebrow) {
        font-size: 17px;
        line-height: 1.34;
    }

    .footer-main {
        gap: 8px;
        padding: 8px 14px;
    }

    .footer-contact {
        font-size: 0.78rem;
    }

    .footer-logo img {
        height: 48px;
    }

    .footer-bottom {
        padding: 8px 14px 9px;

        font-size: 0.72rem;
        line-height: 1.22;
    }

    .footer-bottom a:not(:last-child)::after {
        margin: 0 5px;
    }

    .site-header.is-scrolled {
       --header-height: 48px;
    }

    .site-header.is-scrolled .brand img {
        height: 34px;
    }

    .site-header.is-scrolled .brand span {
        font-size: 1.12rem;
    }
}

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

@media (max-width: 420px) {
    .home-feature-card {
        min-height: 440px;
        padding: 44px 18px;
    }

    .home-feature-content .home-feature-eyebrow {
        font-size: clamp(40px, 14vw, 52px);
    }

    .home-feature-content h2 {
        font-size: 22px;
    }

    .home-feature-content > p:not(.home-feature-eyebrow) {
        font-size: 16px;
    }
}

/* =========================================================
   Print
========================================================= */

@media print {
    :root {
        --page-background: #ffffff;
        --footer-background: #ffffff;

        --ink: #000000;
        --text: #000000;
        --muted: #000000;
        --line: #cccccc;
    }

    body {
        background: #ffffff;
        color: #000000;
    }

    .site-header,
    .site-footer {
        display: none;
    }

    .home-feature-grid {
        display: block;
        padding: 0;
    }

    .home-feature-card {
        min-height: auto;
        display: block;
        padding: 20px 0;

        color: #000000;
        background: #ffffff;
        text-align: left;
    }

    .home-feature-card::before,
    .home-feature-card::after {
        display: none;
    }

    .home-feature-content {
        max-width: none;
    }

    .home-feature-content .home-feature-eyebrow,
    .home-feature-content h2,
    .home-feature-content > p:not(.home-feature-eyebrow) {
        max-width: none;
        color: #000000;
    }
}