:root {
    --bg: #0f1117;
    --bg2: #181b24;
    --bg3: #1e2230;
    --fg: #e8e6e1;
    --fg2: #a09d96;
    --accent: #4ecdc4;
    --accent2: #45b7aa;
    --ride: #ff6b6b;
    --drive: #ffd93d;
    --rest: #c084fc;
    --camp: #86efac;
    --radius: 12px;
    --radius-lg: 20px;
}

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

body {
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--fg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Hero */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background:
        radial-gradient(ellipse at 30% 50%, rgba(78, 205, 196, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 50%, rgba(255, 107, 107, 0.06) 0%, transparent 60%),
        var(--bg);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="50" font-size="50" opacity="0.02">🚴</text></svg>') repeat;
    background-size: 120px;
    pointer-events: none;
}

.hero-content { position: relative; z-index: 1; }

.hero-date {
    font-size: 0.95rem;
    color: var(--accent);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-family: 'DM Serif Display', serif;
    font-size: clamp(3rem, 10vw, 7rem);
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--fg) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--fg2);
    max-width: 500px;
    margin: 0 auto 3rem;
}

.hero-cta {
    display: inline-block;
    padding: 0.85rem 2rem;
    border: 1.5px solid var(--accent);
    border-radius: 100px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.hero-cta:hover {
    background: var(--accent);
    color: var(--bg);
}

/* Section headings */
.section-title {
    font-family: 'DM Serif Display', serif;
    font-size: clamp(2rem, 5vw, 3rem);
    text-align: center;
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.section-desc {
    text-align: center;
    color: var(--fg2);
    margin-bottom: 2.5rem;
    font-size: 1.05rem;
}

/* Map Section */
.map-section {
    padding: 5rem 2rem 4rem;
    max-width: 1100px;
    margin: 0 auto;
}

.map-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.map-btn {
    padding: 0.55rem 1.2rem;
    border: 1.5px solid var(--bg3);
    border-radius: 100px;
    background: var(--bg2);
    color: var(--fg2);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s;
}

.map-btn:hover, .map-btn.active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(78, 205, 196, 0.08);
}

.map-btn--play {
    border-color: var(--accent);
    color: var(--accent);
}

.map-btn--play:hover {
    background: var(--accent);
    color: var(--bg);
}

#mapid {
    width: 100%;
    height: 500px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--bg3);
}

.stage-info {
    margin-top: 1.5rem;
    padding: 1.25rem 1.5rem;
    background: var(--bg2);
    border-radius: var(--radius);
    border-left: 3px solid var(--accent);
    min-height: 60px;
    transition: all 0.3s;
    color: var(--fg2);
    font-size: 0.95rem;
    line-height: 1.7;
}

.stage-info:empty { display: none; }

.stage-info strong { color: var(--fg); }

/* Itinerary */
.itinerary {
    padding: 5rem 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.day-card {
    background: var(--bg2);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--bg3);
    transition: border-color 0.3s;
}

.day-card:hover {
    border-color: rgba(78, 205, 196, 0.2);
}

.day-card__label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.day-card__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.day-card__header h3 {
    font-family: 'DM Serif Display', serif;
    font-size: 1.5rem;
    font-weight: 400;
}

.day-card__badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.day-card__badge--ride { background: rgba(255,107,107,0.15); color: var(--ride); }
.day-card__badge--drive { background: rgba(255,217,61,0.15); color: var(--drive); }
.day-card__badge--rest { background: rgba(192,132,252,0.15); color: var(--rest); }

/* Timeline */
.day-card__timeline {
    position: relative;
    padding-left: 1rem;
    margin-bottom: 1.5rem;
}

.day-card__timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--bg3);
}

.tl-item {
    display: flex;
    gap: 1rem;
    padding: 0.75rem 0;
    position: relative;
}

.tl-item::before {
    content: '';
    position: absolute;
    left: -1rem;
    top: 1.15rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    transform: translateX(-3px);
}

.tl-item--optional::before { background: var(--fg2); }

.tl-time {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--fg2);
    min-width: 70px;
    padding-top: 2px;
}

.tl-body strong { font-size: 0.95rem; }

.tl-body p {
    color: var(--fg2);
    font-size: 0.88rem;
    margin-top: 0.2rem;
}

.tl-item--optional .tl-body strong { color: var(--fg2); }
.tl-item--optional .tl-body { font-style: italic; }

/* Stay cards */
.day-card__stay {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stay-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: var(--radius);
    background: var(--bg3);
}

.stay-icon { font-size: 1.5rem; }

.stay-detail {
    font-size: 0.85rem;
    color: var(--fg2);
}

/* Rest day */
.day-card--rest {
    background: linear-gradient(135deg, var(--bg2), rgba(192,132,252,0.05));
}

.rest-text {
    color: var(--fg2);
    font-size: 1.1rem;
}

/* Trail Info */
.trail-info {
    padding: 5rem 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.trail-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat {
    text-align: center;
    padding: 2rem 1rem;
    background: var(--bg2);
    border-radius: var(--radius);
    border: 1px solid var(--bg3);
}

.stat-value {
    display: block;
    font-family: 'DM Serif Display', serif;
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--fg2);
}

.trail-elevation h3 {
    text-align: center;
    font-family: 'DM Serif Display', serif;
    font-size: 1.25rem;
    font-weight: 400;
    margin-bottom: 1rem;
    color: var(--fg2);
}

.elevation-chart {
    background: var(--bg2);
    border-radius: var(--radius);
    padding: 2rem;
    border: 1px solid var(--bg3);
}

.elevation-svg {
    width: 100%;
    height: auto;
}

.elev-label {
    fill: var(--fg2);
    font-size: 11px;
    font-family: 'DM Sans', sans-serif;
}

/* Car Shuffle */
.car-shuffle {
    padding: 5rem 2rem;
    max-width: 700px;
    margin: 0 auto;
}

.shuffle-steps {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.shuffle-step {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    background: var(--bg2);
    border-radius: var(--radius);
    padding: 1.5rem;
    width: 100%;
    border: 1px solid var(--bg3);
}

.shuffle-step__day {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    min-width: 80px;
    padding-top: 0.2rem;
}

.shuffle-step__icon {
    font-size: 1.5rem;
    min-width: 50px;
    text-align: center;
}

.shuffle-step__text strong { font-size: 0.95rem; }

.shuffle-step__text p {
    color: var(--fg2);
    font-size: 0.88rem;
    margin-top: 0.3rem;
}

.shuffle-arrow {
    color: var(--fg2);
    font-size: 1.5rem;
    padding: 0.5rem 0;
}

/* Packing */
.packing {
    padding: 5rem 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.pack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.pack-card {
    background: var(--bg2);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--bg3);
}

.pack-card h3 {
    font-family: 'DM Serif Display', serif;
    font-size: 1.15rem;
    font-weight: 400;
    margin-bottom: 1rem;
    color: var(--accent);
}

.pack-card ul {
    list-style: none;
}

.pack-card li {
    padding: 0.4rem 0;
    font-size: 0.9rem;
    color: var(--fg);
    position: relative;
    padding-left: 1.2rem;
}

.pack-card li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--bg3);
    transform: translateY(-50%);
}

.pack-note {
    color: var(--fg2);
    font-size: 0.8rem;
}

/* Weather */
.weather {
    padding: 5rem 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.weather-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.5rem;
}

.weather-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2rem 1rem;
    background: var(--bg2);
    border-radius: var(--radius);
    border: 1px solid var(--bg3);
}

.weather-icon { font-size: 2rem; }

.weather-val {
    font-family: 'DM Serif Display', serif;
    font-size: 1.5rem;
}

.weather-label {
    font-size: 0.85rem;
    color: var(--fg2);
}

/* Footer */
footer {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--fg2);
    font-size: 0.9rem;
    border-top: 1px solid var(--bg3);
}

.footer-links {
    margin-top: 0.75rem;
}

.footer-links a {
    color: var(--accent);
    text-decoration: none;
}

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

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.day-card, .stat, .pack-card, .weather-card, .shuffle-step {
    animation: fadeInUp 0.5s ease-out both;
}

/* Leaflet dark theme overrides */
.leaflet-tile-pane { filter: brightness(0.85) contrast(1.1) saturate(0.8); }
.leaflet-control-zoom a {
    background: var(--bg2) !important;
    color: var(--fg) !important;
    border-color: var(--bg3) !important;
}
.leaflet-control-attribution {
    background: rgba(15,17,23,0.8) !important;
    color: var(--fg2) !important;
    font-size: 10px !important;
}
.leaflet-control-attribution a { color: var(--accent) !important; }

.leaflet-popup-content-wrapper {
    background: var(--bg2) !important;
    color: var(--fg) !important;
    border-radius: var(--radius) !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5) !important;
}
.leaflet-popup-tip { background: var(--bg2) !important; }
.leaflet-popup-content { font-family: 'DM Sans', sans-serif !important; font-size: 0.9rem !important; }
.leaflet-popup-content strong { color: var(--accent); }

/* Custom markers */
.custom-marker {
    background: var(--accent);
    border: 2px solid var(--bg);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.marker-rider {
    background: none;
    border: none;
    font-size: 24px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

/* Responsive */
@media (max-width: 600px) {
    .map-controls { gap: 0.4rem; }
    .map-btn { font-size: 0.75rem; padding: 0.45rem 0.8rem; }
    #mapid { height: 400px; }
    .day-card { padding: 1.5rem; }
    .tl-item { flex-direction: column; gap: 0.3rem; }
    .tl-time { min-width: auto; }
    .shuffle-step { flex-direction: column; gap: 0.75rem; }
    .shuffle-step__day { min-width: auto; }
}
