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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    background-color: #fff;
    line-height: 1.6;
}

/* ==================== LANDING SECTION ==================== */

.landing {
    position: relative;
    height: 100vh;
    width: 100%;
    background-image: url('../images/landing.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 14vh;
    overflow: hidden;
}

.landing::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.landing-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    animation: fadeInUp 1s ease-out;
}

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

.landing-title {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
}

.landing-subtitle {
    font-size: 1.5rem;
    margin-bottom: 3rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    font-weight: 300;
}


@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(10px);
    }
}

/* ==================== TRANSITION SECTION ==================== */

.transition-section {
    height: 30vh;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
    transition: all 0.8s ease;
}

/* ==================== ERAS CONTAINER ==================== */

.eras-container {
    background-color: #ffffff;
    padding: 20px 0 80px;
}

.section-title {
    text-align: center;
}

.section-title h2 {
    display: inline-block;
    font-size: clamp(2.1rem, 4.2vw, 3.6rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: #2260ff;
}

.section-title-eras {
    margin: 0px 0 0px;
}

.era-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 80px 60px;
    min-height: 500px;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.6s ease;
    position: relative;
}

.eras-container .era-section:first-child {
    padding-top: 24px;
}

.era-section:last-child {
    border-bottom: none;
}

/* Alternating layout for visual interest */
.era-section:nth-child(even) {
    direction: rtl;
}

.era-section:nth-child(even) .era-box,
.era-section:nth-child(even) .era-right-section {
    direction: ltr;
}

.era-right-section {
    position: relative;
    min-height: 320px;
    background: white;
}

.era-box {
    position: relative;
    width: 600px;
    height: 300px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    flex-shrink: 0;
}

.era-box:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25);
}

.era-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
}

.era-box::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    z-index: 1;
}

.era-box-1::before {
    background-image: url('../images/borg.png');
}

.era-box-2::before {
    background-image: url('../images/edberg.png');
    background-position: center top;
}

.era-box-3::before {
    background-image: url('../images/sampras_agassi.png');
}

.era-box-4::before {
    background-image: url('../images/bigthree.png');
}

.era-box-5::before {
    background-image: url('../images/modern.png');
}

.era-title {
    position: relative;
    z-index: 2;
    color: white;
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.era-period {
    position: relative;
    z-index: 2;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
    display: block;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.era-description {
    position: relative;
    z-index: 1;
    padding: 20px;
    animation: fadeInLeft 0.8s ease-out;
    min-height: 320px;
    background: white;
    transition: opacity 0.25s ease;
}

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

.era-description h3 {
    font-size: 1.8rem;
    color: #222;
    margin-bottom: 15px;
    border-bottom: 3px solid #007bff;
    padding-bottom: 10px;
}

.era-description p {
    font-size: 1rem;
    color: #555;
    line-height: 1.8;
    text-align: justify;
}

/* ==================== CHART PLACEHOLDER ==================== */

.chart-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    text-align: center;
    cursor: default;
    border: 2px dashed #007bff;
    transition: opacity 0.25s ease;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 2;
}

.era-box:hover + .era-right-section .chart-placeholder {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.chart-placeholder p {
    color: #333;
    font-size: 1.1rem;
    font-weight: 500;
    z-index: 1;
    position: relative;
    transition: opacity 0.4s ease;
}

.era-box:hover + .era-right-section .chart-placeholder p {
    opacity: 0;
}

.era-box:hover + .era-right-section .era-description {
    opacity: 0;
}

.chart-content {
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 8px;
    transition: opacity 0.4s ease;
    position: relative;
    z-index: 2;
}

/* ==================== FOOTER ==================== */

footer {
    background-color: #222;
    color: #aaa;
    text-align: center;
    padding: 40px;
    font-size: 0.9rem;
    margin-top: 60px;
}

footer p {
    margin: 0;
}

/* ==================== RESPONSIVE DESIGN ==================== */

@media (max-width: 1024px) {
    .era-section {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 60px 40px;
    }

    .era-section:nth-child(even) {
        direction: ltr;
    }

    .era-right-section {
        direction: ltr;
    }

    .era-box {
        width: 500px;
        height: 250px;
        margin: 0 auto;
    }

    .era-right-section {
        min-height: 280px;
    }

    .era-description {
        text-align: center;
        min-height: 280px;
    }

    .landing-title {
        font-size: 2.5rem;
    }

    .landing-subtitle {
        font-size: 1.2rem;
    }
}

@media (max-width: 768px) {
    .landing-title {
        font-size: 2rem;
    }

    .landing-subtitle {
        font-size: 1rem;
    }

    .era-section {
        padding: 40px 20px;
        min-height: auto;
    }

    .era-box {
        width: 400px;
        height: 200px;
    }

    .era-right-section {
        min-height: 260px;
    }

    .era-description {
        min-height: 260px;
    }

    .era-title {
        font-size: 1.4rem;
    }

    .era-description h3 {
        font-size: 1.4rem;
    }

    .era-description p {
        font-size: 0.9rem;
    }
}

/* ==================== SMOOTH SCROLL ANIMATIONS ==================== */

.era-section {
    opacity: 0;
    animation: fadeIn 0.8s ease forwards;
}

.era-section:nth-child(1) {
    animation-delay: 0s;
}

.era-section:nth-child(2) {
    animation-delay: 0.2s;
}

.era-section:nth-child(3) {
    animation-delay: 0.4s;
}

.era-section:nth-child(4) {
    animation-delay: 0.6s;
}

.era-section:nth-child(5) {
    animation-delay: 0.8s;
}

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

/* ==================== ERA MAIN SKELETONS ==================== */

.era-main-container {
    --glass: #f8f8fa;
    --stroke: #d8d8de;
    --ink: #111;
    --muted: #6f6f77;
    --accent: #2f7cff;
    max-width: 1500px;
    margin: 0 auto;
    padding: 30px 34px 90px;
    position: relative;
}

.era-main-header {
    margin-bottom: 100px;
}

.era-main-section {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    align-items: stretch;
    padding: 22px 0;
    margin-bottom: 26px;
    border-bottom: 1px solid #e7e8ef;
    position: relative;
}

.era-main-section::before {
    content: "";
    position: absolute;
    left: 0;
    top: -26px;
    bottom: -26px;
    width: 3px;
    background: linear-gradient(to bottom, #d3d4db 0%, #a8aab5 100%);
}

.era-main-section:first-of-type::before {
    top: 50%;
}

.era-main-section:last-of-type {
    border-bottom: none;
}

.era-main-section:last-of-type::before {
    bottom: 50%;
}

.era-main-timeline {
    position: relative;
    padding-left: 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.timeline-line {
    display: none;
}

.timeline-dot {
    position: absolute;
    left: -9px;
    top: 50%;
    width: 18px;
    height: 18px;
    margin-top: -9px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 7px rgba(47, 124, 255, 0.18);
}

.era-main-timeline h3 {
    font-size: 1.4rem;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.era-main-timeline span {
    color: var(--muted);
    font-size: 1rem;
    font-weight: 600;
}

.era-main-trend {
    margin-top: 4px;
    color: #5d6373;
    font-size: 0.92rem;
    line-height: 1.45;
}

.era-main-card {
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 0;
    min-height: 330px;
}

.era-main-card h4 {
    color: #1a1a1d;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 14px;
    letter-spacing: 0.01em;
}

.plot-area {
    position: relative;
    height: calc(100% - 30px);
    border: 1px solid #d4d7e1;
    border-radius: 14px;
    background: linear-gradient(140deg, #ffffff 0%, #f7f9ff 100%), repeating-linear-gradient(
        to right,
        #ffffff,
        #ffffff 39px,
        #f3f4f8 40px
    );
    overflow: hidden;
}

.plot-area::before {
    content: "";
    position: absolute;
    left: 38px;
    right: 18px;
    bottom: 30px;
    height: 1px;
    background: #b5b8c2;
}

.plot-area::after {
    content: "";
    position: absolute;
    left: 38px;
    top: 14px;
    bottom: 30px;
    width: 1px;
    background: #b5b8c2;
}

.axis {
    position: absolute;
    color: #7a7d89;
    font-size: 0.74rem;
    text-transform: lowercase;
}

.axis-x {
    right: 14px;
    bottom: 8px;
}

.axis-y {
    left: 6px;
    top: 46%;
    transform: rotate(-90deg);
    transform-origin: left top;
}

.pt {
    position: absolute;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.75);
}

.p1 { left: 26%; top: 68%; background: #2f7cff; }
.p2 { left: 37%; top: 50%; background: #17a2b8; }
.p3 { left: 47%; top: 56%; background: #00b27a; }
.p4 { left: 58%; top: 41%; background: #f59f00; }
.p5 { left: 69%; top: 34%; background: #ff6b6b; }
.p6 { left: 77%; top: 28%; background: #845ef7; }

.sankey-area {
    height: calc(100% - 30px);
    display: grid;
    grid-template-columns: 92px 1fr 92px;
    gap: 12px;
    border: 1px solid #d4d7e1;
    border-radius: 14px;
    background: linear-gradient(160deg, #ffffff 0%, #f8f9ff 100%);
    padding: 14px 10px;
}

.sankey-left,
.sankey-right {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    color: #394157;
    font-size: 0.72rem;
}

.sankey-left span,
.sankey-right span {
    display: block;
    line-height: 1.2;
}

.sankey-right {
    align-items: flex-end;
}

.sankey-flows {
    position: relative;
    background: #fbfcff;
    border: 1px solid #e0e4ef;
    border-radius: 10px;
    overflow: hidden;
}

.sankey-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.sankey-node {
    fill: #7b95d9;
    stroke: #9fb0e2;
    stroke-width: 1;
    rx: 2;
}

.sankey-node.left {
    fill: #9baedf;
}

.sankey-node.right {
    fill: #7f98d7;
}

.sankey-link {
    fill: none;
    stroke-linecap: round;
    mix-blend-mode: multiply;
}

.sankey-link.s1 { stroke: rgba(116, 146, 219, 0.56); stroke-width: 22; }
.sankey-link.s2 { stroke: rgba(95, 127, 210, 0.54); stroke-width: 26; }
.sankey-link.s3 { stroke: rgba(129, 160, 230, 0.52); stroke-width: 18; }
.sankey-link.s4 { stroke: rgba(66, 96, 183, 0.58); stroke-width: 28; }
.sankey-link.s5 { stroke: rgba(55, 84, 170, 0.62); stroke-width: 24; }
.sankey-link.s6 { stroke: rgba(170, 190, 241, 0.55); stroke-width: 14; }
.sankey-link.s7 { stroke: rgba(100, 129, 211, 0.5); stroke-width: 16; }
.sankey-link.s8 { stroke: rgba(82, 111, 194, 0.46); stroke-width: 12; }

@media (max-width: 1180px) {
    .era-main-section {
        grid-template-columns: 200px minmax(0, 1fr) minmax(0, 1fr);
    }

    .era-main-card {
        min-height: 300px;
    }
}

@media (max-width: 980px) {
    .era-main-container {
        padding: 40px 18px 70px;
    }

    .era-main-section {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 18px 0;
    }

    .era-main-section::before {
        left: 0;
    }

    .era-main-timeline {
        padding-left: 34px;
        min-height: 86px;
    }

    .era-main-timeline h3 {
        font-size: 1.2rem;
    }

    .era-main-trend {
        font-size: 0.88rem;
    }

    .era-main-card {
        min-height: 260px;
    }
}
