:root {
    --marta-blue: #0092d0;
    --marta-yellow: #fdbe43;
    --marta-orange: #ff7500;
    --marta-black: #1a1a1a;
    scroll-behavior: smooth;

    /* light mode colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f2f2f2;
    --text-primary: #000000;
    --text-secondary: #555555;
    --text-muted: #999999;
    --shadow-color: rgba(0, 0, 0, 0.15);
}

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

body {
    font-family: Helvetica, Arial, sans-serif;
    color: var(--text-primary);
    font-size: 1rem;
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

section {
    transition: opacity 0.8s ease-in-out, background-color 0.3s ease, color 0.3s ease;
}

.js-animations section {
    opacity: 0;
}

section.visible {
    opacity: 1;
}

.top-bar-container {
    width: 100%;
    height: 100px;
    background-color: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
}

.top-bar-container::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(
        to bottom,
        #0092d0 0%,
        #0092d0 20%,
        #00b0ff 20%,
        #00b0ff 45%,
        var(--marta-yellow) 45%,
        var(--marta-yellow) 70%,
        #ff7500 70%,
        #ff7500 85%,
        #ea0213 85%,
        #ea0213 100%
    );
}

.siteheader-logo {
    height: 140px;
    width: auto;
    margin: 10px;
}

.siteheader-logo-dark {
    display: none;
}

.top-bar-links {
    list-style-type: none;
    font-size: large;
    background-color: var(--bg-secondary);
    display: flex;
}

.top-bar-links li a {
    color: var(--text-primary);
    font-weight: bold;
    text-decoration: none;
    padding: 15px 30px;
    display: flex;
    align-items: center;
    height: 100%;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.top-bar-links li a:hover {
    background-color: var(--marta-blue);
    color: white;
}

.toggle-switch {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 15px;
    cursor: pointer;
    gap: 8px;
}

.toggle-icon {
    display: flex;
    align-items: center;
    position: relative;
    width: 24px;
    height: 24px;
    justify-content: center;
    color: var(--text-primary);
}

.dark-icon::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    box-shadow: inset -4px 3px currentColor;
    transition: all 0.3s ease;
}


.toggle-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.slider {
    position: relative;
    width: 42px;
    height: 24px;
    background-color: #ccc;
    border-radius: 12px;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

.slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background-color: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform 0.3s ease;
}

input:checked + .slider {
    background-color: var(--marta-blue);
}

input:checked + .slider::before {
    transform: translateX(18px);
}


.train-hero {
    display: flex;
    flex-direction: row;
    position: relative;
    min-height: 500px;
    padding: 80px 0;
    overflow: hidden;
    background: linear-gradient(135deg, #efece6 0%, #f5f1eb 100%);
}

.hero-text {
    order: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 10%;
    padding-right: 5%;
}

.hero-text h1 {
    font-size: 3rem;
    color: var(--text-primary);
    font-weight: 800;
    margin-bottom: 8px;
    animation: slideInLeft 0.8s ease-out both;
}

.hero-text h2 {
    font-size: 1.5rem;
    color: var(--marta-black);
    font-weight: 600;
    margin-bottom: 20px;
    letter-spacing: 2px;
    animation: slideInLeft 0.8s ease-out 0.2s both;
}

.hero-text h3 {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
    line-height: 1.6;
    animation: slideInLeft 0.8s ease-out 0.4s both;
}

.hero-text a {
    display: inline-block;
    color: var(--marta-blue);
    text-decoration: underline;
    font-weight: bold;
    transition: color 0.3s ease;
    width: fit-content;
}

.hero-image {
    order: 1;
    flex: 0 0 40%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 10%;
    position: relative;
}

.hero-image::before {
    content: "";
    position: absolute;
    width: 420px;
    height: 500px;
    background: var(--marta-yellow);
    opacity: 0.3;
    border-radius: 8px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-0.5deg);
    z-index: 0;
}

.hero-image img {
    width: 100%;
    height: auto;
    max-width: 400px;
    box-shadow: 0 10px 30px var(--shadow-color), inset 0 0 0 2px var(--marta-blue);
    transition: transform 0.4s ease, filter 0.4s ease;
    border-radius: 8px;
    border: 8px solid #f5f1eb;
    z-index: 1;
}

.hero-image img:hover {
    transform: scale(1.02) rotate(1deg);
}

.info-section {
    padding: 3%;
    background-color: var(--bg-primary);
    max-width: 1200px;
    margin: 0 auto;
}

.info-section h2 {
    font-size: 2.5rem;
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 30px;
    position: relative;
}

#about h2::after,
#some-more h2::after,
#blog-peek h2::after,
#projects h2::after {
    content: "";
    display: block;
    width: 60px;
    height: 4px;
    margin-top: 15px;
}

#about h2::after {
    background: var(--marta-orange);
}

#some-more h2::after {
    background: var(--marta-blue);
}

#blog-peek h2::after {
    background: #ea0213;
}

.latest-posts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    border-left: 4px solid #ea0213;
    padding-left: 30px;
}

.card {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    box-shadow: 0 10px 30px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

.blog-post-card,
.project-card {
    overflow: hidden;
}

.blog-post-card img,
.project-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.blog-post-card:hover,
.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px var(--shadow-color);
}

.blog-post-card h3,
.project-card h3 {
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 600;
    margin: 20px;
    margin-bottom: 10px;
}

.blog-post-card p,
.project-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0 20px 20px;
}

.blog-post-card a {
    color: var(--marta-blue);
    text-decoration: none;
    font-weight: bold;
    margin: 0 20px 20px;
    display: inline-block;
}

.view-all-container {
    margin-top: 20px;
    padding-left: 34px;
}

.blog-coming-soon {
    display: flex;
    align-items: center;
    gap: 24px;
    color: var(--text-muted);
    font-size: 1rem;
    padding: 10px 0;
}


#projects h2::after {
    background: var(--marta-yellow);
}

.projects-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    border-left: 4px solid var(--marta-yellow);
    padding-left: 30px;
}


.train-map-container {
    display: flex;
    background: var(--bg-primary);
    height: auto;
    flex-direction: column;
    padding: 30px;
    padding-left: 30px;
    gap: 20px;
    align-items: flex-start;
    justify-content: flex-start;
    border-left: 4px solid var(--marta-blue);
}



.train-card {
    background-color: var(--bg-secondary);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 10px 30px var(--shadow-color);
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

.train-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px var(--shadow-color);
}

.station-content {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.station-logo {
    width: 60px;
    height: auto;
    flex-shrink: 0;
}


.station-text {
    flex: 1;
}

footer {
    background-color: #f5f1eb;
    padding: 40px 0 0;
    position: relative;
    transition: background-color 0.3s ease, color 0.3s ease;
}


.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 3%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-copy {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-links {
    list-style: none;
    display: flex;
    gap: 30px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: bold;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--marta-blue);
}

.footer-skyline {
    width: 100%;
    height: 140px;
    display: block;
    opacity: 0.28;
    margin-top: 30px;
}

.footer-skyline path {
    fill: var(--marta-orange);
}

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    padding: 15px;
    background: none;
    border: none;
    margin-right: 10px;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: var(--text-primary);
    transition: transform 0.3s ease, opacity 0.3s ease, background-color 0.3s ease;
}

.hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
    opacity: 0;
}

.hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.blog-hero {
    background-color: var(--bg-secondary);
    padding: 60px 3%;
    border-bottom: 4px solid #ea0213;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.blog-hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    max-width: 1200px;
    margin: 0 auto 10px;
}

.blog-hero p {
    color: var(--text-secondary);
    max-width: 1200px;
    margin: 0 auto;
    font-size: 1rem;
}

.coming-soon-badge {
    display: inline-block;
    background-color: var(--marta-orange);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 3px 10px;
    border-radius: 4px;
    margin: 0 20px 20px;
}

.project-links {
    display: flex;
    gap: 15px;
    margin: 0 20px 20px;
}

.project-links a {
    color: var(--marta-blue);
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

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

.error-section {
    min-height: calc(100vh - 100px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 3%;
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease;
}

.error-content {
    text-align: center;
    max-width: 600px;
}

.error-number {
    font-size: 8rem;
    font-weight: 900;
    line-height: 1;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.error-alt {
    font-size: 1rem;
    color: var(--text-muted);
    margin-top: -15px;
    margin-bottom: 20px;
}

.error-content h1 {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.error-content p {
    color: var(--text-secondary);
    margin-bottom: 30px;
    line-height: 1.6;
}

.error-content a {
    display: inline-block;
    background-color: var(--marta-blue);
    color: white;
    text-decoration: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.error-content a:hover {
    background-color: #007ab8;
    transform: translateY(-2px);
}

/* Focus styles */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--marta-blue);
    outline-offset: 3px;
    border-radius: 2px;
}

.toggle-switch:focus-within .slider {
    outline: 2px solid var(--marta-blue);
    outline-offset: 3px;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .top-bar-links {
        display: none;
        position: fixed;
        top: 100px;
        left: 0;
        width: 100%;
        flex-direction: column;
        background-color: var(--bg-secondary);
        z-index: 99;
        box-shadow: 0 10px 20px var(--shadow-color);
        transition: background-color 0.3s ease;
    }

    .top-bar-links.open {
        display: flex;
    }

    .top-bar-links li {
        border-top: 1px solid var(--shadow-color);
    }

    .top-bar-links li a {
        padding: 15px 20px;
        width: 100%;
        font-size: medium;
    }

    .top-bar-links .toggle-switch {
        padding: 10px 20px;
    }

    .train-hero {
        flex-direction: column;
        height: auto;
    }

    .hero-image {
        order: 2;
        padding: 20px;
    }

    .hero-text {
        order: 1;
        padding: 30px 20px;
    }

    .hero-text h1 {
        font-size: 2rem;
    }

    .hero-text h2 {
        font-size: 1.2rem;
    }

    .hero-image::before {
        width: 320px;
        height: 320px;
    }

    .footer-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}
