
:root {
    --ink: #102235;
    --ink-soft: #536679;
    --blue: #1d6f9f;
    --blue-deep: #123c5a;
    --sea: #eef7fb;
    --yellow: #f6d72d;
    --line: #dbe5ec;
    --paper: #ffffff;
    --background: #f6f8fa;
    --danger: #b42318;
    --shadow: 0 24px 70px rgba(16,34,53,.10);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 50% -10%, rgba(29,111,159,.08), transparent 38rem),
        var(--background);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { cursor: pointer; }

.site {
    width: min(1240px, calc(100% - 56px));
    margin: 0 auto;
    padding: 28px 0 54px;
}

/* Header */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 2px 34px;
}

.brand {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    color: var(--ink);
    text-decoration: none;
    letter-spacing: -.06em;
    font-size: 22px;
    font-weight: 850;
}

.brand-gpx { color: var(--ink); }
.brand-arrow { color: var(--blue); font-weight: 500; }
.brand-mp4 { color: var(--blue); }

.topbar-caption {
    color: #8494a3;
    font-size: 12px;
    letter-spacing: .04em;
}

/* Typography */

.kicker {
    margin: 0 0 13px;
    color: var(--blue);
    font-size: 10px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: .19em;
}

h1, h2, p { margin-top: 0; }

.alert {
    display: flex;
    gap: 14px;
    align-items: center;
    margin: 0 0 25px;
    padding: 15px 18px;
    border: 1px solid #f1c6c2;
    border-radius: 12px;
    background: #fff5f4;
    color: var(--danger);
    font-size: 13px;
}

.alert span { color: #74352f; }

/* Landing */

.landing {
    max-width: 930px;
    margin: 58px auto 0;
    text-align: center;
}

.landing-copy h1 {
    margin-bottom: 22px;
    color: var(--ink);
    font-size: clamp(48px, 7vw, 78px);
    line-height: .96;
    letter-spacing: -.065em;
    font-weight: 760;
}

.landing-copy h1 em {
    color: var(--blue);
    font-style: normal;
    font-weight: 430;
}

.lead {
    max-width: 620px;
    margin: 0 auto;
    color: var(--ink-soft);
    font-size: 17px;
    line-height: 1.65;
}

.upload-panel {
    width: min(700px, 100%);
    margin: 52px auto 0;
}

.drop-zone {
    min-height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 35px;
    border: 1px dashed #a9bfce;
    border-radius: 24px;
    background: rgba(255,255,255,.72);
    transition: border-color .2s, background .2s, transform .2s;
}

.drop-zone:hover {
    border-color: var(--blue);
    background: #fff;
    transform: translateY(-2px);
}

.drop-zone input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.upload-symbol {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    margin-bottom: 18px;
    border-radius: 50%;
    background: var(--sea);
    color: var(--blue);
    font-size: 23px;
    font-weight: 400;
}

.drop-title {
    color: var(--ink);
    font-size: 18px;
    font-weight: 750;
}

.drop-subtitle {
    margin-top: 8px;
    color: var(--ink-soft);
    font-size: 13px;
}

.drop-limit {
    margin-top: 18px;
    color: #94a2ad;
    font-size: 10px;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.button {
    min-height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    border: 0;
    border-radius: 13px;
    padding: 0 24px;
    font-size: 14px;
    font-weight: 750;
    transition: transform .18s, box-shadow .18s, background .18s;
}

.button-dark {
    width: 100%;
    margin-top: 18px;
    background: var(--ink);
    color: white;
    box-shadow: 0 13px 28px rgba(16,34,53,.16);
}

.button-dark:hover {
    background: var(--blue-deep);
    transform: translateY(-2px);
    box-shadow: 0 17px 34px rgba(16,34,53,.19);
}

.button-icon {
    color: var(--yellow);
    font-size: 19px;
    font-weight: 400;
}

.landing-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 42px;
    margin: 56px auto 0;
    padding-top: 28px;
    border-top: 1px solid var(--line);
    text-align: left;
}

.landing-features strong,
.landing-features span {
    display: block;
}

.landing-features strong {
    color: var(--ink);
    font-size: 12px;
}

.landing-features span {
    margin-top: 6px;
    color: #7d8e9d;
    font-size: 11px;
    line-height: 1.45;
}

/* Route */

.route-intro {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    margin: 34px 0 22px;
}

.route-intro h1 {
    margin-bottom: 7px;
    color: var(--ink);
    font-size: clamp(32px, 4vw, 48px);
    line-height: 1;
    letter-spacing: -.055em;
    font-weight: 720;
}

.file-name {
    margin: 0;
    color: #8a99a6;
    font-size: 12px;
}

.distance {
    min-width: 150px;
    padding-left: 26px;
    border-left: 1px solid var(--line);
    text-align: right;
}

.distance strong {
    display: block;
    color: var(--ink);
    font-size: 32px;
    line-height: 1;
    letter-spacing: -.045em;
    font-weight: 650;
}

.distance span {
    display: block;
    margin-top: 7px;
    color: #8998a5;
    font-size: 11px;
}

/* Map */

.map-section {
    overflow: hidden;
    padding: 8px;
    border-radius: 24px;
    background: white;
    box-shadow: var(--shadow);
}

.gpx-map,
#gpx-map {
    height: 610px;
    min-height: 440px;
    border-radius: 18px;
    overflow: hidden;
}

/* Builder */

.builder {
    max-width: 1050px;
    margin: 72px auto 0;
}

.builder-title {
    margin-bottom: 34px;
}

.builder-title h2 {
    margin-bottom: 10px;
    color: var(--ink);
    font-size: 36px;
    line-height: 1;
    letter-spacing: -.05em;
    font-weight: 700;
}

.builder-title p:last-child {
    margin-bottom: 0;
    color: var(--ink-soft);
    font-size: 14px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.setting {
    min-height: 132px;
    padding: 25px 26px;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: rgba(255,255,255,.82);
}

.setting-large {
    grid-column: 1 / -1;
}

.setting label {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 13px;
    color: var(--ink);
    font-size: 12px;
    font-weight: 760;
}

.setting output {
    color: var(--blue);
    font-weight: 800;
}

.setting input[type="text"],
.setting input[type="email"] {
    width: 100%;
    height: 49px;
    padding: 0 15px;
    border: 1px solid #d3dfe7;
    border-radius: 10px;
    outline: 0;
    background: white;
    color: var(--ink);
    font-size: 14px;
    transition: border-color .18s, box-shadow .18s;
}

.setting input[type="text"]:focus,
.setting input[type="email"]:focus,
#route-color-text:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(29,111,159,.10);
}

.duration-options {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

.duration-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.duration-option span {
    display: block;
    min-width: 52px;
    padding: 10px 11px;
    border: 1px solid #d3dfe7;
    border-radius: 9px;
    background: white;
    color: #627486;
    text-align: center;
    font-size: 12px;
    cursor: pointer;
    transition: .18s;
}

.duration-option input:checked + span {
    border-color: var(--ink);
    background: var(--ink);
    color: white;
}

.route-range {
    width: 100%;
    margin: 10px 0 0;
    accent-color: var(--blue);
}

.range-scale {
    display: flex;
    justify-content: space-between;
    margin-top: 3px;
    color: #98a5b0;
    font-size: 10px;
}

.color-picker {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-picker input[type="color"] {
    width: 50px;
    height: 44px;
    padding: 3px;
    border: 1px solid #d3dfe7;
    border-radius: 10px;
    background: white;
    cursor: pointer;
}

#route-color-text {
    width: 120px;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #d3dfe7;
    border-radius: 10px;
    outline: 0;
    color: var(--ink);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
}

.delivery {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 22px;
    padding: 18px 20px;
    border-radius: 14px;
    background: #f0f8fc;
}

.delivery-mark {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--blue);
    color: white;
}

.delivery strong {
    display: block;
    color: var(--ink);
    font-size: 12px;
}

.delivery p {
    margin: 4px 0 0;
    color: #718394;
    font-size: 11px;
    line-height: 1.5;
}

.create-button {
    margin-top: 20px;
}

.progress {
    margin-top: 18px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: white;
    text-align: center;
}

.progress strong {
    color: var(--ink);
    font-size: 13px;
}

.progress p {
    margin: 6px 0 0;
    color: var(--ink-soft);
    font-size: 12px;
    line-height: 1.5;
}

.progress-error { color: var(--danger) !important; }

/* Footer */

.footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 78px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    color: #9aa7b2;
    font-size: 10px;
    letter-spacing: .04em;
}

/* Leaflet */

.leaflet-control-attribution {
    font-size: 9px !important;
}

/* Responsive */

@media (max-width: 820px) {
    .site {
        width: min(100% - 30px, 1240px);
        padding-top: 20px;
    }

    .topbar {
        padding-bottom: 22px;
    }

    .topbar-caption { display: none; }

    .landing {
        margin-top: 35px;
    }

    .landing-copy h1 {
        font-size: clamp(43px, 12vw, 64px);
    }

    .landing-features {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .route-intro {
        align-items: flex-start;
        flex-direction: column;
    }

    .distance {
        min-width: 0;
        padding: 0;
        border-left: 0;
        text-align: left;
    }

    .map-section { padding: 5px; }
    .gpx-map, #gpx-map { height: 500px; }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .setting-large {
        grid-column: auto;
    }
}

@media (max-width: 560px) {
    .site {
        width: min(100% - 20px, 1240px);
    }

    .landing-copy h1 {
        font-size: 43px;
    }

    .lead {
        font-size: 15px;
    }

    .drop-zone {
        min-height: 220px;
        padding: 25px 15px;
    }

    .route-intro h1 {
        font-size: 34px;
    }

    .gpx-map, #gpx-map {
        height: 420px;
        min-height: 360px;
    }

    .builder {
        margin-top: 52px;
    }

    .builder-title h2 {
        font-size: 31px;
    }

    .setting {
        padding: 21px 19px;
    }

    .duration-options {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
    }

    .duration-option span {
        min-width: 0;
        padding: 10px 4px;
    }

    .footer {
        flex-direction: column;
        gap: 7px;
    }
}


/* Selected GPX file */

.drop-filename {
    max-width: 90%;
    margin-top: 14px;
    padding: 9px 15px;
    border-radius: 999px;
    background: #eef7fb;
    color: #123c5a;
    font-size: 12px;
    font-weight: 750;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* New request / progress navigation */

.new-request-link {
    display: block;
    margin: 15px auto 0;
    color: #738596;
    font-size: 11px;
    text-align: center;
    text-decoration: none;
    transition: color .18s;
}

.new-request-link:hover {
    color: #1d6f9f;
}

.progress-home-link {
    display: inline-block;
    margin-top: 14px;
    color: #1d6f9f;
    font-size: 12px;
    font-weight: 750;
    text-decoration: none;
}

.progress-home-link:hover {
    text-decoration: underline;
}
