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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('/beachfishing_filter.jpg');
    background-size: 150%;
    background-position: left center;
    background-repeat: no-repeat;
    z-index: -1;
    height: 100vh;
}

.container {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 100%;
    padding: 50px;
    animation: fadeIn 0.8s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header {
    text-align: center;
    margin-bottom: 40px;
}

.avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 5px solid #4c6553;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 0 auto 20px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    font-size: 60px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: bold;
    background-image: url('/avatar.jpg');
    background-size: cover;
    background-position: center;
}

/* ── Carousel ───────────────────────────────────────────── */
.carousel {
    position: relative;
    width: 100%;
    max-width: 560px;
    margin: 0 auto 24px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
    background: #1a1a1a;
    aspect-ratio: 16 / 7;
}

.carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-slide,
.carousel-track > div {
    min-width: 100%;
    height: 100%;
    overflow: hidden;
}

.carousel-slide img,
.carousel-track > div img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.carousel-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2a3a2e 0%, #3d5c45 100%);
    color: rgba(255, 255, 255, 0.25);
    font-size: 3rem;
    cursor: default;
    user-select: none;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10;
}

.carousel-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

.carousel-btn-prev { left: 10px; }
.carousel-btn-next { right: 10px; }

.carousel-dots {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    border: none;
    padding: 0;
}

.carousel-dot.active {
    background: #fff;
    transform: scale(1.25);
}

h1 {
    color: #333;
    font-size: 2.5em;
    margin-bottom: 10px;
    text-wrap: balance;
    text-wrap: pretty;
}

.tagline {
    color: #222;
    font-size: 1.2em;
    margin-bottom: 20px;
    font-weight: 900;
}

.quote {
    font-style: italic;
    color: #555;
    font-size: 1em;
    margin-top: 20px;
    padding-left: 15px;
}

.section {
    margin: 30px 0;
}

.section h2 {
    color: #111;
    font-size: 1.5em;
    margin-bottom: 15px;
    border-left: 1px solid black;
    border-top: 1px solid black;
    padding-left: 15px;
    box-shadow: #111 2px 2px 0px, #111 4px 4px 0px, #111 6px 6px 0px;
    text-wrap: balance;
    text-wrap: pretty;
}

.section p {
    font-weight: 600;
    color: #222;
    line-height: 1.8;
    margin-bottom: 15px;
    text-wrap: balance;
    text-wrap: pretty;
}

.section ul {
    margin: 0 0 15px;
    padding-left: 24px;
}

.section ul ul {
    margin-top: 8px;
    padding-left: 24px;
    list-style-type: circle;
}

.section li {
    margin-bottom: 6px;
}

.section .code-block {
    background: #0a0a0a;
    padding: 5px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.2em;
    color: #23dd12;
    overflow-x: auto;
}

.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 15px;
}

.skill-tag {
    background: linear-gradient(135deg, #111 0%, #4c6553 100%);
    color: white;
    padding: 8px 16px;
    border-left: 1px solid black;
    border-top: 1px solid black;
    box-shadow: #111 2px 2px 0px, #111 4px 4px 0px, #111 6px 6px 0px;
    font-size: 0.9em;
    transition: transform 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    cursor: default;
}

.skill-tag:hover {
    transform: translateY(-2px);
}

.skill-icon {
    background: linear-gradient(135deg, #111 0%, #4c6553 100%);
    color: white;
    border-left: 1px solid black;
    border-top: 1px solid black;
    box-shadow: #111 2px 2px 0px, #111 4px 4px 0px, #111 6px 6px 0px;
    font-size: 0.9em;
    transition: transform 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 40px;
    overflow: hidden;
    cursor: default;
}

.skill-icon:hover {
    transform: translateY(-2px);
}

.skill-icon img {
    max-width: 100%;
    max-height: auto;
    object-fit: contain;
}

.links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.link-button {
    background: linear-gradient(135deg, #111 0%, #4c6553 100%);
    color: white;
    border-left: 1px solid black;
    border-top: 1px solid black;
    border-radius: 100vw 0 100vw;
    box-shadow: #111 2px 2px 0px, #111 4px 4px 0px, #111 6px 6px 0px;
    padding: 12px 24px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.link-button:hover {
    background: linear-gradient(135deg, #111 0%, #4ba261 100%);
    color: white;
    transform: scale(1.05);
}

.links-secondary {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}
.link-secondary a {
    color: #4c6553;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}
.link-secondary a:hover {
    color: #4ba261;
}
.link-secondary li {
    list-style:square;
    margin-left: 20px;
}

.footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    color: #5eff00;
    font-size: 0.9em;
}
.footer-image {
    display: block;
    margin: 20px auto 0;
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}
.image-caption {
    display: block;
    font-size: 0.8em;
    color: #555;
    margin-top: 5px;
    text-align: center;
}

/* Contact Form Styles */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1em;
    background: white;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #4c6553;
    box-shadow: 0 0 0 3px rgba(76, 101, 83, 0.1);
}

.form-textarea {
    min-height: 150px;
    resize: vertical;
}

.submit-button {
    background: linear-gradient(135deg, #111 0%, #4c6553 100%);
    color: white;
    padding: 14px 32px;
    border: none;
    border-left: 1px solid black;
    border-top: 1px solid black;
    box-shadow: #111 2px 2px 0px, #111 4px 4px 0px, #111 6px 6px 0px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.submit-button:hover {
    background: linear-gradient(135deg, #111 0%, #4ba261 100%);
    transform: translateY(-2px);
    box-shadow: #111 3px 3px 0px, #111 5px 5px 0px, #111 7px 7px 0px;
}

.submit-button:active {
    transform: translateY(0);
    box-shadow: #111 1px 1px 0px, #111 2px 2px 0px, #111 3px 3px 0px;
}

.responsive-image {
    display: block;
    margin: 20px auto 0;
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

@media (max-width: 600px) {
    .container {
        padding: 30px 20px;
    }

    h1 {
        font-size: 2em;
    }

    .links {
        flex-direction: column;
    }
    .section .code-block {
        font-size: 0.8rem;
        padding: 10px;
    }
}

/* Ride map & stats */
#ride-map {
    height: 420px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    margin-bottom: 10px;
}

.ride-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin: 14px 0;
}

.ride-stat-card {
    background: rgba(76, 101, 83, 0.1);
    border: 1px solid rgba(76, 101, 83, 0.25);
    border-radius: 10px;
    padding: 12px 10px;
    text-align: center;
}

.ride-stat-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: #2d5a27;
    line-height: 1.1;
}

.ride-stat-unit {
    font-size: 0.72rem;
    color: #555;
    font-weight: 400;
}

.ride-stat-label {
    font-size: 0.65rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 3px;
}

.ride-speed-legend {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    font-size: 0.72rem;
    color: #555;
    margin: 8px 0;
}

.ride-legend-swatch {
    width: 22px;
    height: 4px;
    border-radius: 2px;
    display: inline-block;
    margin-right: 3px;
    vertical-align: middle;
}

#ride-elevation-canvas {
    display: block;
    width: 100%;
    height: 110px;
    border-radius: 8px;
    background: rgba(76, 101, 83, 0.04);
    margin-top: 12px;
}

.ride-placeholder {
    text-align: center;
    padding: 30px 20px;
    color: #666;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 12px;
    border: 1px dashed #ccc;
}

/* Ride archive page (rides.html) */
.ride-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ride-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
}
.ride-list-btn {
    flex: 1;
    background: rgba(76, 101, 83, 0.08);
    border: 1px solid rgba(76, 101, 83, 0.25);
    border-radius: 8px;
    padding: 12px 16px;
    text-align: left;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: #222;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.ride-list-btn:hover {
    background: rgba(76, 101, 83, 0.18);
    border-color: rgba(76, 101, 83, 0.5);
}
.ride-list-btn.active {
    background: rgba(76, 101, 83, 0.22);
    border-color: #4c6553;
    color: #2d5a27;
}
.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #4c6553;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.95rem;
}
.back-link:hover { text-decoration: underline; }
#viewer-title {
    color: #555;
    margin-bottom: 6px;
    font-size: 1rem;
}
#viewer-description {
    color: #666;
    margin-bottom: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
}
#viewer-section { display: none; }
