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

body {
    font-family: 'Arial', 'Helvetica', sans-serif;
    background: linear-gradient(135deg, #2d3561 0%, #c05c7e 50%, #f3826f 100%);
    color: #f5f5f5;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Animated railway tracks background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        repeating-linear-gradient(90deg,
            transparent,
            transparent 48px,
            rgba(255, 255, 255, 0.03) 48px,
            rgba(255, 255, 255, 0.03) 50px);
    background-size: 100px 100%;
    animation: railwayMove 25s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes railwayMove {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(100px);
    }
}

/* Journey atmosphere effect */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 40%, rgba(192, 92, 126, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 70% 60%, rgba(243, 130, 111, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 50% 80%, rgba(45, 53, 97, 0.2) 0%, transparent 50%);
    animation: journeyFlow 18s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes journeyFlow {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.7;
    }

    50% {
        transform: translate(25px, -25px) scale(1.08);
        opacity: 0.9;
    }
}

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

/* Dynamic Header */
header {
    background: rgba(45, 53, 97, 0.95);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-bottom: 2px solid rgba(192, 92, 126, 0.4);
    padding: 1.5rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 30px rgba(192, 92, 126, 0.2),
        0 0 60px rgba(243, 130, 111, 0.1) inset;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.site-branding {
    flex: 1;
    min-width: 200px;
}

.site-title a {
    text-decoration: none;
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(135deg, #c05c7e 0%, #f3826f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 4px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    position: relative;
    filter: drop-shadow(0 0 20px rgba(192, 92, 126, 0.4));
}

.site-title a:hover {
    filter: drop-shadow(0 0 30px rgba(243, 130, 111, 0.7));
    letter-spacing: 6px;
}

.site-tagline {
    font-size: 0.85rem;
    color: #f3826f;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: 0.3rem;
    font-weight: 300;
}

/* Navigation Menu */
#menu {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

#menu ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    justify-content: flex-end;
}

#menu li {
    margin: 0 1rem;
    font-size: 1rem;
    line-height: 2.5rem;
    position: relative;
}

#menu li::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #c05c7e, #f3826f);
    transition: width 0.4s ease;
    box-shadow: 0 0 10px rgba(192, 92, 126, 0.6);
}

#menu li:hover::before {
    width: 100%;
}

#menu a {
    text-decoration: none;
    color: #f5f5f5;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
    transition: all 0.3s ease;
}

#menu li:hover a {
    color: #f3826f;
    text-shadow: 0 0 20px rgba(243, 130, 111, 0.5);
}

/* Hero Section with Train Theme */
.hero-section {
    text-align: center;
    padding: 5rem 2rem 4rem;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(45, 53, 97, 0.8) 0%, rgba(192, 92, 126, 0.4) 100%);
}

.hero-title {
    font-size: 5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #c05c7e 0%, #f3826f 50%, #ffb088 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 15px;
    position: relative;
    filter: drop-shadow(0 0 40px rgba(192, 92, 126, 0.4));
    animation: titleSpeed 3s ease-in-out infinite;
}

@keyframes titleSpeed {

    0%,
    100% {
        filter: drop-shadow(0 0 40px rgba(192, 92, 126, 0.4));
    }

    50% {
        filter: drop-shadow(0 0 60px rgba(243, 130, 111, 0.6));
    }
}

.hero-subtitle {
    font-size: 1.3rem;
    color: #f3826f;
    letter-spacing: 5px;
    text-transform: uppercase;
    font-weight: 300;
    margin-top: 2rem;
    text-shadow: 0 0 20px rgba(243, 130, 111, 0.3);
}

/* Animated Train SVG */
.train-svg {
    width: 100%;
    height: 200px;
    margin-top: 3rem;
}

.railway-track {
    stroke: #c05c7e;
    stroke-width: 4;
    fill: none;
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    animation: drawTrack 3s ease-in-out forwards;
    filter: drop-shadow(0 0 8px rgba(192, 92, 126, 0.6));
}

@keyframes drawTrack {
    to {
        stroke-dashoffset: 0;
    }
}

.train-locomotive {
    fill: #f3826f;
    opacity: 0;
    animation: trainEnter 2.5s ease-out 1s forwards;
    filter: drop-shadow(0 0 12px rgba(243, 130, 111, 0.7));
}

@keyframes trainEnter {
    from {
        transform: translateX(-300px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 0.95;
    }
}

.train-carriage {
    fill: #c05c7e;
    opacity: 0;
    animation: carriageFollow 2.5s ease-out 1.3s forwards;
    filter: drop-shadow(0 0 10px rgba(192, 92, 126, 0.6));
}

@keyframes carriageFollow {
    from {
        transform: translateX(-300px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 0.9;
    }
}

.train-window {
    fill: #ffb088;
    opacity: 0;
    animation: windowGlow 1.5s ease-in 2.5s forwards;
}

@keyframes windowGlow {
    to {
        opacity: 0.85;
    }
}

.smoke-puff {
    fill: rgba(255, 255, 255, 0.3);
    opacity: 0;
    animation: smokePuff 3s ease-out 2s infinite;
}

@keyframes smokePuff {
    0% {
        transform: translate(0, 0) scale(0.5);
        opacity: 0;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        transform: translate(-50px, -80px) scale(1.5);
        opacity: 0;
    }
}

/* Train Gallery Section */
.train-gallery {
    max-width: 1600px;
    margin: 3rem auto;
    padding: 0 2rem 4rem;
}

.country-section {
    margin-bottom: 4rem;
}

.country-title {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #c05c7e 0%, #f3826f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 2rem;
    position: relative;
    padding-left: 20px;
}

.country-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 80%;
    background: linear-gradient(180deg, #c05c7e, #f3826f);
    box-shadow: 0 0 15px rgba(192, 92, 126, 0.6);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    margin-top: 2rem;
    justify-items: center;
}

.gallery-grid .train-card {
    max-width: 450px;
    width: 100%;
}

/* Train Card - Journey Design */
.train-card {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    isolation: isolate;
    z-index: 1;
}

.train-card:hover {
    transform: translateY(-15px) scale(1.02);
    z-index: 10;
}

/* Journey border effect */
.card-container {
    display: flex;
    flex-direction: column;
    position: relative;
    background: linear-gradient(135deg, rgba(45, 53, 97, 0.95) 0%, rgba(192, 92, 126, 0.85) 100%);
    border-radius: 15px;
    border: 2px solid rgba(192, 92, 126, 0.5);
    box-shadow: 0 10px 40px rgba(45, 53, 97, 0.6),
        0 0 20px rgba(192, 92, 126, 0.2) inset;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.train-card:hover .card-container {
    border-color: rgba(243, 130, 111, 0.8);
    box-shadow: 0 20px 60px rgba(192, 92, 126, 0.5),
        0 0 40px rgba(243, 130, 111, 0.3) inset;
}

/* Speed lines effect */
.speed-lines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.train-card:hover .speed-lines {
    opacity: 1;
}

.speed-line {
    position: absolute;
    background: linear-gradient(90deg, transparent, rgba(243, 130, 111, 0.4), transparent);
    height: 2px;
    width: 100%;
    animation: speedRush 1.2s ease-out infinite;
    box-shadow: 0 0 8px rgba(243, 130, 111, 0.6);
}

.speed-line:nth-child(1) {
    top: 30%;
    animation-delay: 0s;
}

.speed-line:nth-child(2) {
    top: 50%;
    animation-delay: 0.2s;
}

.speed-line:nth-child(3) {
    top: 70%;
    animation-delay: 0.4s;
}

@keyframes speedRush {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }

    30% {
        opacity: 1;
    }

    100% {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Journey horizon effect */
.horizon-glow {
    position: absolute;
    bottom: -50%;
    left: -50%;
    right: -50%;
    height: 100%;
    background: radial-gradient(circle at center,
            rgba(243, 130, 111, 0.2),
            transparent 70%);
    z-index: 3;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.train-card:hover .horizon-glow {
    opacity: 1;
    animation: horizonPulse 2s ease-in-out infinite;
}

@keyframes horizonPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* Image Container */
.train-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    border-radius: 15px;
}

/* Portrait orientation - manually add this class to portrait images */
.train-image-wrapper.portrait {
    aspect-ratio: 3/4;
}

.train-image-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
            rgba(192, 92, 126, 0.2) 0%,
            transparent 50%,
            rgba(243, 130, 111, 0.2) 100%);
    z-index: 1;
    pointer-events: none;
    opacity: 0.4;
    transition: opacity 0.4s ease;
}

.train-card:hover .train-image-wrapper::before {
    opacity: 0.6;
}

.train-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    filter: saturate(0.9) contrast(1.1) brightness(0.95);
}

.train-card:hover .train-image {
    transform: scale(1.12);
    filter: saturate(1.2) contrast(1.2) brightness(1.05);
}

/* Train Info Overlay */
.train-info {
    position: relative;
    padding: 2rem;
    z-index: 5;
    background: linear-gradient(to top,
            rgba(45, 53, 97, 0.98) 0%,
            rgba(45, 53, 97, 0.85) 60%,
            transparent 100%);
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    border-radius: 0 0 15px 15px;
    border-top: 1px solid rgba(192, 92, 126, 0.5);
    transform: translateY(0);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.train-location {
    font-size: 1.8rem;
    font-weight: 800;
    color: #c05c7e;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0;
    transition: all 0.3s ease;
    text-shadow: 0 0 20px rgba(192, 92, 126, 0.5);
}

.train-card:hover .train-location {
    color: #f3826f;
    text-shadow: 0 0 30px rgba(243, 130, 111, 0.7);
}

/* Railway junction corners */
.junction-corner {
    position: absolute;
    z-index: 4;
    pointer-events: none;
    width: 40px;
    height: 40px;
}

.junction-tl {
    top: 10px;
    left: 10px;
    border-top: 3px solid rgba(192, 92, 126, 0.5);
    border-left: 3px solid rgba(192, 92, 126, 0.5);
    transition: all 0.4s ease;
}

.junction-tr {
    top: 10px;
    right: 10px;
    border-top: 3px solid rgba(192, 92, 126, 0.5);
    border-right: 3px solid rgba(192, 92, 126, 0.5);
    transition: all 0.4s ease;
}

.junction-bl {
    bottom: 10px;
    left: 10px;
    border-bottom: 3px solid rgba(192, 92, 126, 0.5);
    border-left: 3px solid rgba(192, 92, 126, 0.5);
    transition: all 0.4s ease;
}

.junction-br {
    bottom: 10px;
    right: 10px;
    border-bottom: 3px solid rgba(192, 92, 126, 0.5);
    border-right: 3px solid rgba(192, 92, 126, 0.5);
    transition: all 0.4s ease;
}

.train-card:hover .junction-corner {
    border-color: rgba(243, 130, 111, 1);
    box-shadow: 0 0 15px rgba(243, 130, 111, 0.7);
    width: 50px;
    height: 50px;
}

/* Footer with Journey Style */
footer {
    background: linear-gradient(135deg, rgba(45, 53, 97, 0.95) 0%, rgba(192, 92, 126, 0.9) 100%);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-top: 2px solid rgba(192, 92, 126, 0.5);
    padding: 3rem 2rem;
    margin-top: 4rem;
    text-align: center;
    box-shadow: 0 -4px 30px rgba(192, 92, 126, 0.2);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-title {
    font-size: 1.2rem;
    background: linear-gradient(135deg, #c05c7e 0%, #f3826f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

#langlist {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    background: rgba(45, 53, 97, 0.8);
    border-radius: 50px;
    padding: 0.5rem;
    border: 2px solid rgba(192, 92, 126, 0.5);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    margin-bottom: 2rem;
    box-shadow: 0 0 30px rgba(192, 92, 126, 0.2) inset;
}

#langlist li {
    display: inline-block;
    list-style: none;
    margin: 0.3rem;
    padding: 0.7rem 1.3rem;
    border-radius: 30px;
    transition: all 0.3s ease;
}

#langlist a {
    text-decoration: none;
    color: #f5f5f5;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    font-weight: 600;
}

#langlist .highlight {
    background: linear-gradient(135deg, #c05c7e, #f3826f);
    box-shadow: 0 0 20px rgba(192, 92, 126, 0.6);
}

#langlist .highlight a {
    color: #ffffff;
    font-weight: bold;
}

#langlist li:not(.highlight):hover {
    background: rgba(192, 92, 126, 0.3);
    box-shadow: 0 0 15px rgba(192, 92, 126, 0.4);
}

#langlist li:not(.highlight):hover a {
    color: #f3826f;
    text-shadow: 0 0 10px rgba(243, 130, 111, 0.6);
}

.footer-credits {
    color: #f3826f;
    font-size: 0.9rem;
    letter-spacing: 2px;
    margin-top: 2rem;
    font-weight: 400;
}

.footer-credits strong {
    background: linear-gradient(135deg, #c05c7e 0%, #f3826f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 900;
}

/* Responsive Design */
@media screen and (max-width: 968px) {
    header {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem 1rem;
    }

    .site-branding {
        margin-bottom: 1rem;
    }

    #menu {
        justify-content: center;
    }

    #menu ul {
        justify-content: center;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 2rem;
    }

    .hero-title {
        font-size: 3.5rem;
        letter-spacing: 8px;
    }

    .hero-subtitle {
        font-size: 1rem;
        letter-spacing: 3px;
    }

    .train-card {
        }

    .train-location {
        font-size: 1.5rem;
    }
}

@media screen and (max-width: 600px) {
    .site-title a {
        font-size: 1.5rem;
    }

    .site-tagline {
        font-size: 0.75rem;
    }

    #menu li {
        margin: 0 0.5rem;
        font-size: 0.85rem;
    }

    .hero-title {
        font-size: 2.5rem;
        letter-spacing: 5px;
    }

    .hero-subtitle {
        font-size: 0.85rem;
        letter-spacing: 2px;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .train-card {
        }

    .train-location {
        font-size: 1.3rem;
    }

    .train-info {
        padding: 1.5rem;
    }

    .country-title {
        font-size: 2rem;
    }
}
