@font-face {
    font-family: "d-din";
    src: url("../fonts/D-DIN.otf");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "d-din";
    src: url("../fonts/D-DIN-Bold.otf");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: #171f43;
}

body {
    margin: 0;
    background: #171f43;
    color: #fff;
    font-family: "d-din", Arial, sans-serif;
}

.history {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    padding: 60px 24px 24px;
    border-top: 2px solid rgba(255, 255, 255, .08);
    background: #171f43;
}

.history::before {
    position: absolute;
    top: -2px;
    left: 50%;
    width: 84px;
    height: 2px;
    background: #e23b3b;
    content: "";
    transform: translateX(-50%);
}

.history__timeline {
    position: relative;
    max-width: 950px;
    margin: 0 auto;
}

.history__timeline::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: rgba(226, 59, 59, .72);
    content: "";
    transform: translateX(-50%);
}

.history-entry {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr);
    align-items: center;
    min-height: 250px;
    padding: 16px 0;
}

.history-entry__marker {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 12px;
    transform: translateY(-50%);
}

.history-entry__marker::before {
    position: absolute;
    top: 50%;
    right: 0;
    left: 0;
    height: 2px;
    background: #e23b3b;
    content: "";
    transform: translateY(-50%);
}

.history-entry__marker::after {
    position: absolute;
    top: 50%;
    left: 0;
    width: 8px;
    height: 8px;
    border: 2px solid #171f43;
    border-radius: 50%;
    background: #e23b3b;
    box-shadow: 0 0 0 1px #e23b3b;
    content: "";
    transform: translate(-50%, -50%);
}

.history-entry:nth-child(even) .history-entry__marker {
    left: calc(50% - 40px);
}

.history-entry:nth-child(even) .history-entry__marker::after {
    right: 0;
    left: auto;
    transform: translate(50%, -50%);
}

.history-entry__image,
.history-entry__copy {
    grid-row: 1;
    min-width: 0;
}

.history-entry__image {
    grid-column: 1;
    padding: 18px 42px 18px 0;
}

.history-entry__image-inner {
    display: block;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 25px;
}

.history-entry__image-inner img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 25px;
    object-fit: cover;
    object-position: center;
}

.history-entry__image-inner span {
    display: none;
}

.history-entry__copy {
    position: relative;
    z-index: 0;
    grid-column: 3;
    padding: 22px 0 22px 24px;
}

.history-entry__year {
    position: relative;
    z-index: 1;
    margin: 0 0 10px;
    color: #e23b3b;
    font-size: 38px;
    font-weight: 700;
    line-height: 1;
}

.history-entry__year::before {
    position: absolute;
    z-index: -1;
    top: 0;
    left: -58px;
    color: rgba(245, 245, 245, 0.09);
    content: attr(data-year);
    font-size: 110px;
    font-weight: 700;
    line-height: .8;
    transform: translateY(-55%);
}

.history-entry__copy h2 {
    max-width: 180px;
    margin: 0;
    color: #f2f4fb;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.65;
}

.history-entry:nth-child(even) .history-entry__copy h2 {
    margin-left: auto;
}

.history-entry__copy > p:last-child {
    display: none;
}

.history-entry:nth-child(even) .history-entry__image {
    grid-column: 3;
    padding: 18px 0 18px 42px;
}

.history-entry:nth-child(even) .history-entry__copy {
    grid-column: 1;
    padding: 22px 24px 22px 0;
    text-align: right;
}

.history-entry:nth-child(even) .history-entry__year::before {
    color: rgba(245, 245, 245, 0.09);
    right: -58px;
    left: auto;
}

@media (max-width: 700px) {
    .history {
        padding: 34px 18px 20px;
    }

    .history-entry,
    .history-entry--reverse {
        grid-template-columns: 16px minmax(0, 1fr);
        min-height: 0;
        padding: 18px 0 24px;
    }

    .history-entry__marker {
        left: 7px;
        width: 16px;
    }

    .history__timeline::before {
        left: 7px;
    }

    .history-entry:nth-child(even) .history-entry__marker {
        left: 7px;
    }

    .history-entry:nth-child(even) .history-entry__marker::after {
        right: auto;
        left: 0;
    }

    .history-entry:nth-child(n) .history-entry__image {
        grid-column: 2;
        grid-row: 1;
        padding: 0 0 16px 14px;
    }

    .history-entry:nth-child(n) .history-entry__copy {
        grid-column: 2;
        grid-row: 2;
        padding: 0 0 0 14px;
        text-align: left;
    }

    .history-entry__image-inner {
        width: 100%;
        aspect-ratio: 4 / 3;
        border-radius: 20px;
    }

    .history-entry__image-inner img {
        width: 100%;
        height: 100%;
        aspect-ratio: auto;
        border-radius: 20px;
        object-fit: cover;
        object-position: center;
    }

    .history-entry__year {
        font-size: 34px;
    }

    .history-entry__year::before {
        left: -8px;
        font-size: 100px;
    }

    .history-entry:nth-child(even) .history-entry__copy h2 {
        margin-left: 0;
    }

    .history-entry:nth-child(even) .history-entry__year::before {
        color: rgba(245, 245, 245, 0.09);
        right: auto;
        left: -8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* =========================================
   HISTORY TIMELINE - REFERENCE DESIGN
========================================= */

:root {
    --history-bg: #171f43;
    --history-accent: #5b9af3;
    --history-text: #f2f4fb;
    --history-line: rgba(91, 154, 243, 0.75);
}

/* Main section */

.history {
    background: var(--history-bg);
    padding: 60px 24px 40px;
}

/* Timeline width */

.history__timeline {
    max-width: 1100px;
    margin: 0 auto;
}

/* Remove the continuous center line */

.history__timeline::before {
    display: none;
}

/* Individual timeline entry */

.history-entry {
    position: relative;
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        64px
        minmax(0, 1fr);

    align-items: center;

    min-height: 280px;
    padding: 20px 0;
}

/* Individual vertical separator */

.history-entry__marker {
    position: absolute;

    top: 20px;
    bottom: 20px;
    left: 50%;

    width: 2px;
    height: auto;

    transform: translateX(-50%);
}

/* Vertical blue line */

.history-entry__marker::before {
    position: absolute;

    top: 0;
    left: 0;

    width: 2px;
    height: 100%;

    background: var(--history-line);

    content: "";
    transform: none;
}

/* Remove horizontal connectors and dots */

.history-entry__marker::after {
    display: none;
}

/* Image container */

.history-entry__image {
    grid-column: 1;
    grid-row: 1;

    min-width: 0;

    padding: 18px 42px 18px 0;
}

/* Image appearance */

.history-entry__image-inner {
    display: block;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 4 / 3;

    border-radius: 25px;
}

.history-entry__image-inner img {
    display: block;

    width: 100%;
    height: 100%;

    border-radius: 25px;
    clip-path: inset(0 round 25px);
    object-fit: cover;
    object-position: center;
}

/* Text content */

.history-entry__copy {
    position: relative;
    z-index: 0;

    grid-column: 3;
    grid-row: 1;

    min-width: 0;

    padding: 22px 0 22px 24px;
}

/* Milestone year */

.history-entry__year {
    position: relative;
    z-index: 1;

    margin: 0 0 14px;

    color: var(--history-accent);

    font-size: 42px;
    font-weight: 700;
    line-height: 1;
}

/* Large faded background year */

.history-entry__year::before {
    position: absolute;
    z-index: -1;

    top: 0;
    left: -72px;

    color: rgba(8, 15, 43, 0.38);

    content: attr(data-year);

    font-size: 125px;
    font-weight: 700;
    line-height: 0.8;

    white-space: nowrap;

    transform: translateY(-35%);
}

/* Milestone heading */

.history-entry__copy h2 {
    max-width: 340px;

    margin: 0;

    color: var(--history-text);

    font-size: 14px;
    font-weight: 400;
    line-height: 1.8;
}

/* Alternate image and content */

.history-entry:nth-child(even) .history-entry__image {
    grid-column: 3;

    padding: 18px 0 18px 42px;
}

.history-entry:nth-child(even) .history-entry__copy {
    grid-column: 1;

    padding: 22px 24px 22px 0;

    text-align: right;
}

.history-entry:nth-child(even) .history-entry__copy h2 {
    margin-left: auto;
    text-align: left;
}

/* Background year on the alternate side */

.history-entry:nth-child(even) .history-entry__year::before {
    color: rgba(245, 245, 245, 0.09);
    right: -72px;
    left: auto;
}

/* =========================================
   RESPONSIVE DESIGN
========================================= */

@media (max-width: 700px) {

    .history {
        padding: 34px 18px 20px;
    }

    .history-entry {
        grid-template-columns: 16px minmax(0, 1fr);

        min-height: 0;
        padding: 18px 0 24px;
    }

    /* Mobile timeline line */

    .history-entry__marker {
        top: 0;
        bottom: 0;

        left: 7px;

        width: 2px;
        height: auto;

        transform: none;
    }

    .history-entry__marker::before {
        width: 2px;
        height: 100%;
    }

    /* Image above the text */

    .history-entry:nth-child(n) .history-entry__image {
        grid-column: 2;
        grid-row: 1;

        padding: 0 0 16px 14px;
    }

    .history-entry:nth-child(n) .history-entry__copy {
        grid-column: 2;
        grid-row: 2;

        padding: 0 0 0 14px;

        text-align: left;
    }

    .history-entry__image-inner {
        width: 100%;
        aspect-ratio: 4 / 3;
        border-radius: 20px;
    }

    .history-entry__image-inner img {
        width: 100%;
        height: 100%;
        aspect-ratio: auto;
        border-radius: 20px;
        clip-path: inset(0 round 20px);
        object-fit: cover;
        object-position: center;
    }

    .history-entry__year {
        font-size: 34px;
    }

    .history-entry__year::before {
        left: -8px;

        font-size: 100px;

        transform: translateY(-35%);
    }

    .history-entry:nth-child(even) .history-entry__copy h2 {
        margin-left: 0;
    }

    .history-entry:nth-child(even) .history-entry__year::before {
        color: rgba(245, 245, 245, 0.09);
        right: auto;
        left: -8px;
    }
}


/* ------>>>>> Red theme for page */

/* =========================================
   HISTORY PAGE - RED & BLACK THEME
   ========================================= */

:root {
    --history-bg: #080808;
    --history-accent: #e23b3b;
    --history-text: #f2f2f2;
    --history-line: rgba(226, 59, 59, 0.75);
}

/* Main background */

html,
body,
.history {
    background: var(--history-bg);
}

/* Top decorative line */

.history::before {
    background: var(--history-accent);
}

/* Timeline vertical line */

.history__timeline::before {
    background: var(--history-line);
}

/* Individual timeline markers */

.history-entry__marker::before {
    background: var(--history-accent);
}

/* Marker dots */

.history-entry__marker::after {
    border-color: var(--history-bg);
    background: var(--history-accent);
    box-shadow: 0 0 0 1px var(--history-accent);
}

/* Year headings */

.history-entry__year {
    color: var(--history-accent);
}

/* Faded background years */

.history-entry__year::before {
    color: rgba(245, 245, 245, 0.09);
}

/* Milestone descriptions */

.history-entry__copy h2 {
    color: var(--history-text);
}

/* Individual vertical lines from the reference layout */

.history-entry__marker {
    background: transparent;
}

.history-entry__marker::before {
    background: var(--history-line);
}

/* History section heading */

.history__title {
    position: relative;
    z-index: 2;

    margin: 0 0 55px;

    color: #f5f5f5;

    font-family: "d-din", Arial, sans-serif;
    font-size: 48px;
    font-weight: 700;

    line-height: 1.1;
    letter-spacing: 5px;

    text-align: center;
}

/* Use a consistent frame while keeping portrait images fully visible */
.history-entry .history-entry__image-inner {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: 25px;
}

.history-entry .history-entry__image-inner img {
    position: absolute;
    top: 50%;
    left: 50%;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    border-radius: 25px;
    object-fit: contain;
    transform: translate(-50%, -50%);
}

/* Responsive heading */

@media (max-width: 700px) {
    .history__title {
        font-size: 34px;
        letter-spacing: 3px;
        margin-bottom: 35px;
    }

    .history-entry:nth-child(n) .history-entry__image-inner {
        position: relative;
        aspect-ratio: 4 / 3;
        border-radius: 20px;
    }

    .history-entry:nth-child(n) .history-entry__image-inner img {
        top: 50%;
        left: 50%;
        width: auto;
        height: auto;
        max-width: 100%;
        max-height: 100%;
        border-radius: 20px;
        object-fit: contain;
        transform: translate(-50%, -50%);
    }

    .history-entry:nth-child(n) .history-entry__copy {
        text-align: left;
    }

    .history-entry:nth-child(n) .history-entry__copy h2 {
        margin-left: 0;
        text-align: left;
    }

    .history-entry:nth-child(n) .history-entry__year::before {
        transform: translateY(-15%);
    }
}
