:root {
    --ink: #1f2a44;
    --muted: #5b6475;
    --bg: #f6f7fb;
    --surface: #ffffff;
    --border: #e3e6ee;
    /* light blue: fills with navy text on top, a deeper blue for marks, darker still for links */
    --accent: #4aa8e0;
    --accent-dark: #3a9ad6;
    --accent-strong: #1f86c7;
    --link: #0a5f94;
    --on-accent: #1f2a44;
    --danger: #c43d3d;
    --success: #1a8a4a;
    --grid: #eceef4;
    --accent-soft: rgba(31, 134, 199, 0.14);
    --radius: 14px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --ink: #e8ebf3;
        --muted: #a3abbd;
        --bg: #11151f;
        --surface: #1a2030;
        --border: #2a3245;
        --grid: #242b3c;
        --accent-dark: #6bbbe9;
        --accent-strong: #3ea2e0;
        --link: #7cc6f0;
        --on-accent: #11151f;
        --accent-soft: rgba(74, 168, 224, 0.18);
    }
    /* the logo is navy on white */
    .logo,
    .brand img {
        filter: invert(1) hue-rotate(180deg);
        mix-blend-mode: screen;
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
}

a {
    color: var(--link);
}

.topbar {
    padding: 28px 20px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(12px, 3vw, 32px);
    max-width: 940px;
    margin: 0 auto;
    color: var(--ink);
    font-size: clamp(2.5rem, 10vw, 7.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1;
    text-decoration: none;
}

/* show only the network drawing; the logo file has a small wordmark underneath */
.brand img {
    width: clamp(64px, 16vw, 150px);
    height: auto;
    aspect-ratio: 968 / 680;
    object-fit: cover;
    object-position: top;
}

.notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    max-width: 940px;
    margin: 20px auto 0;
    padding: 14px 18px;
    border: 1px solid var(--accent-strong);
    border-radius: var(--radius);
    background: var(--surface);
}

.notice[hidden] {
    display: none;
}

.notice p {
    flex: 1;
    margin: 0;
    color: var(--ink);
}

.notice button {
    padding: 0 4px;
    border: 0;
    background: none;
    color: var(--muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

@media (max-width: 980px) {
    .notice {
        margin: 20px 20px 0;
    }
}

main {
    max-width: 980px;
    margin: 0 auto;
    padding: 32px 20px 48px;
}

section {
    margin-bottom: 48px;
}

h1 {
    font-size: clamp(1.8rem, 5vw, 2.6rem);
    line-height: 1.2;
    margin: 16px 0 12px;
}

h2 {
    font-size: 1.4rem;
    margin-bottom: 16px;
}

h3 {
    margin: 0 0 4px;
    font-size: 1.05rem;
}

p {
    margin: 0 0 12px;
    color: var(--muted);
}

.lead {
    font-size: 1.15rem;
}

.hero {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 48px;
    align-items: center;
    padding: 24px 0;
}

.hero .lead {
    margin-bottom: 24px;
}

@media (max-width: 760px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

.strava-button {
    display: inline-block;
    transition: transform 0.15s ease;
}

.strava-button:hover {
    transform: translateY(-2px);
}

.strava-button img {
    display: block;
    max-width: 100%;
    height: auto;
}

.hint {
    margin-top: 12px;
    font-size: 0.9rem;
}

.activity {
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 12px 32px rgba(31, 42, 68, 0.12);
}

.activity-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.activity-head strong {
    display: block;
    line-height: 1.2;
}

.avatar {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg);
}

.meta {
    font-size: 0.85rem;
    color: var(--muted);
}

.old-name {
    margin: 0;
    font-size: 1.1rem;
    text-decoration: line-through;
}

.arrow {
    margin: 2px 0;
    color: var(--link);
    font-weight: 700;
}

.new-name {
    margin: 0 0 16px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ink);
}

.stats {
    display: flex;
    gap: 24px;
    margin: 0 0 14px;
}

.stats dt {
    font-size: 0.75rem;
    color: var(--muted);
}

.stats dd {
    margin: 0;
    font-weight: 600;
}

.signature {
    margin: 0;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
}

/* hero feed: example activities being renamed, newest on top */
.feed {
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: 440px;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, #000 65%, transparent);
    mask-image: linear-gradient(to bottom, #000 65%, transparent);
}

.feed .activity {
    flex: none;
    padding: 16px 18px;
    box-shadow: 0 6px 18px rgba(31, 42, 68, 0.1);
}

.feed .activity.enter {
    animation: drop-in 0.5s ease both;
}

@keyframes drop-in {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.feed .activity-head {
    margin-bottom: 8px;
}

.feed .avatar {
    width: 34px;
    height: 34px;
}

.feed .old-name {
    display: inline-block;
    font-size: 1rem;
    text-decoration: none;
    background: linear-gradient(currentColor, currentColor) 0 55% / 0 2px no-repeat;
    transition: background-size 0.4s ease, opacity 0.4s ease;
}

.feed .old-name.struck {
    background-size: 100% 2px;
    opacity: 0.6;
}

.feed .new-name {
    min-height: 1.4em;
    margin: 4px 0 0;
    font-size: 1.25rem;
    line-height: 1.3;
}

.caret {
    display: inline-block;
    width: 2px;
    height: 1.1em;
    margin-left: 2px;
    vertical-align: -0.15em;
    background: var(--accent-strong);
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

.feed .signature {
    margin-top: 10px;
    padding-top: 8px;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.feed .done .caret {
    display: none;
}

.feed .done .signature,
.feed .activity:not(.enter) .signature {
    opacity: 1;
}

.feed .enter:not(.done) .signature {
    opacity: 0;
}

@media (max-width: 760px) {
    .feed {
        height: 360px;
    }
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    padding: 0;
    margin: 0;
    list-style: none;
    counter-reset: step;
}

.steps li {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    counter-increment: step;
}

.steps li::before {
    content: counter(step);
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    margin-bottom: 10px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 700;
}

/* static before -> after examples on the home page (also read by search engines) */
.example-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 8px 24px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.example-list li {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.example-list .struck {
    color: var(--muted);
    text-decoration: line-through;
}

.faq details {
    padding: 14px 18px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.faq summary {
    cursor: pointer;
    font-weight: 600;
}

.faq details p {
    margin: 10px 0 0;
}

.card {
    max-width: 520px;
    margin: 40px auto;
    padding: 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    text-align: center;
}

.icon {
    display: inline-grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    color: #fff;
    font-size: 1.6rem;
    font-weight: 700;
}

.icon.success {
    background: var(--success);
}

.icon.error {
    background: var(--danger);
}

.button {
    display: inline-block;
    margin: 12px 0 16px;
    padding: 12px 22px;
    border-radius: 10px;
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 600;
    text-decoration: none;
}

.button:hover {
    background: var(--accent-dark);
}

.feedback {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.feedback label {
    margin-top: 10px;
    font-weight: 600;
}

.feedback .optional {
    font-weight: 400;
    color: var(--muted);
}

.feedback textarea,
.feedback input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    color: var(--ink);
    font: inherit;
}

.feedback textarea:focus,
.feedback input:focus {
    outline: 2px solid var(--accent-strong);
    outline-offset: 1px;
}

.feedback .button {
    align-self: flex-start;
    border: 0;
    cursor: pointer;
}

/* honeypot: off screen for people, still in the form for bots */
.hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.form-error {
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(196, 61, 61, 0.12);
    color: var(--ink);
}

footer {
    padding: 24px 20px;
    border-top: 1px solid var(--border);
    text-align: center;
}

footer p {
    margin: 0;
    font-size: 0.85rem;
}

/* stats page */
.stats-page {
    display: grid;
    gap: 40px;
}

.stats-page section {
    margin: 0;
    min-width: 0;
}

.stats-page h1 {
    margin-top: 0;
    text-wrap: balance;
}

.stats-page h2 {
    margin: 0 0 4px;
    font-size: 1.3rem;
    text-wrap: balance;
}

.stats-page .asof {
    font-size: 0.85rem;
}

.stats-page .tiles {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stats-page .tile {
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.stats-page .tile .num {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.stats-page .tile .label {
    display: block;
    margin-top: 6px;
    font-size: 0.9rem;
    line-height: 1.35;
    color: var(--muted);
}

.stats-page .tile.highlight {
    border-color: var(--accent-strong);
}

.stats-page .tile.highlight .num {
    color: var(--link);
}

.stats-page .panel {
    min-width: 0;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.stats-page .panel > p {
    font-size: 0.95rem;
}

.stats-page .pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 760px) {
    .stats-page .tiles {
        grid-template-columns: repeat(2, 1fr);
    }
    .stats-page .pair {
        grid-template-columns: 1fr;
    }
}

.chart {
    position: relative;
    margin-top: 12px;
}

.chart svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.chart text {
    fill: var(--muted);
    font-size: 11px;
    font-family: inherit;
    font-variant-numeric: tabular-nums;
}

.chart .gridline {
    stroke: var(--grid);
    stroke-width: 1;
}

.chart .bar {
    fill: var(--accent-strong);
}

.chart .bar.dim {
    fill: var(--accent-soft);
}

.chart .bar.on {
    fill: var(--ink);
}

.chart .hit {
    fill: transparent;
}

.chart .line {
    fill: none;
    stroke: var(--accent-strong);
    stroke-width: 2;
    stroke-linejoin: round;
}

.chart .area {
    fill: var(--accent-soft);
}

.chart .dot {
    fill: var(--accent-strong);
    stroke: var(--surface);
    stroke-width: 2;
}

.chart .endlabel {
    fill: var(--ink);
    font-size: 12px;
    font-weight: 700;
}

.chart .xhair {
    stroke: var(--muted);
    stroke-width: 1;
    stroke-dasharray: 3 3;
}

.chart .tip {
    position: absolute;
    z-index: 2;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    font-size: 0.82rem;
    line-height: 1.35;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 6px 18px rgba(31, 42, 68, 0.14);
    transform: translate(-50%, calc(-100% - 10px));
}

.stats-page .note {
    margin: 10px 0 0;
    font-size: 0.82rem;
}

.sport-head,
.sport {
    display: grid;
    grid-template-columns: 11em 1fr 3.5em;
    gap: 10px;
}

.sport-head {
    margin-top: 14px;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.sport-head span:last-child,
.sport .kept {
    text-align: right;
}

.sports {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.sport {
    align-items: center;
    font-size: 0.92rem;
}

.sport .name {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    min-width: 0;
}

.sport .name span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sport .n {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.sport .track {
    height: 14px;
}

.sport .fill {
    height: 100%;
    min-width: 2px;
    border-radius: 0 4px 4px 0;
    background: var(--accent-strong);
}

.sport .kept {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 480px) {
    .sport-head,
    .sport {
        grid-template-columns: 8.5em 1fr 3em;
    }
}

.style-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 14px;
}

@media (max-width: 760px) {
    .style-grid {
        grid-template-columns: 1fr;
    }
}

.style-grid h3 {
    margin: 0 0 10px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.emojis {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.emoji {
    padding: 10px 4px;
    border-radius: 10px;
    background: var(--bg);
    text-align: center;
}

.emoji span {
    display: block;
    font-size: 1.6rem;
    line-height: 1.2;
}

.emoji small {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.words {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
}

.word {
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--bg);
    font-weight: 600;
    line-height: 1.6;
}

.facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 28px;
    margin: 18px 0 0;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.facts div {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.facts dt {
    font-size: 0.9rem;
    color: var(--muted);
}

.facts dd {
    order: -1;
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.stats-page .cta {
    text-align: center;
}
