/* Departure Board - A Free Design by Bryant Smith (bryantsmith.com)
   A projects page that looks like a station departure board.
   Every project is a "departure" with a time, destination and status.
   Look for the section headings below to find what you want to change. */


/* ---- BODY: the dark station at night ---- */

body {
    background: #05070a;
    color: #c9d1d9;
    font-family: Consolas, "Courier New", Courier, monospace;
    font-size: 16px;
    line-height: 1.7;
    padding: 40px 16px 64px 16px;
    text-align: center;
}

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


/* ---- PAGE: the board itself ---- */

#page {
    background: #0b0f14;
    border: 1px solid #1a232e;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
    margin: 0 auto;
    max-width: 940px;
    text-align: left;
}


/* ---- MASTHEAD: station sign, split-flap title and menu ---- */

#masthead {
    background: #0d1319;
    border-bottom: 1px solid #1a232e;
    padding: 26px 32px 22px 32px;
}

.station-line {
    color: #5c6975;
    display: flex;
    font-size: 11px;
    justify-content: space-between;
    letter-spacing: 3px;
    text-transform: uppercase;
}

/* The big split-flap word at the top of the board */
.board-title {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 20px 0 12px 0;
    perspective: 600px;
}

.board-title span {
    align-items: center;
    animation: flap-in 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) both;
    background: linear-gradient(180deg, #1c2733 0%, #121a24 48%, #0a1017 52%, #141d28 100%);
    border: 1px solid #263341;
    border-radius: 4px;
    color: #ffb000;
    display: inline-flex;
    font-size: 34px;
    font-weight: bold;
    height: 56px;
    justify-content: center;
    min-width: 42px;
    padding: 0 8px;
    text-shadow: 0 0 12px rgba(255, 176, 0, 0.45);
}

/* Each letter flips a moment after the one before it */
.board-title span:nth-child(1)  { animation-delay: 0.05s; }
.board-title span:nth-child(2)  { animation-delay: 0.10s; }
.board-title span:nth-child(3)  { animation-delay: 0.15s; }
.board-title span:nth-child(4)  { animation-delay: 0.20s; }
.board-title span:nth-child(5)  { animation-delay: 0.25s; }
.board-title span:nth-child(6)  { animation-delay: 0.30s; }
.board-title span:nth-child(7)  { animation-delay: 0.35s; }
.board-title span:nth-child(8)  { animation-delay: 0.40s; }
.board-title span:nth-child(9)  { animation-delay: 0.45s; }
.board-title span:nth-child(10) { animation-delay: 0.50s; }

.tagline {
    color: #8b98a6;
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

#menu {
    margin-top: 24px;
}

#menu a {
    border-bottom: 2px solid transparent;
    color: #8b98a6;
    font-size: 12px;
    letter-spacing: 2px;
    margin-right: 20px;
    padding-bottom: 4px;
    text-decoration: none;
    text-transform: uppercase;
    transition: color 0.2s ease, border-color 0.2s ease;
}

#menu a:hover,
#menu a:focus {
    border-bottom-color: #ffb000;
    color: #ffb000;
}


/* ---- SERVICE BAND: the scrolling-strip style notice ---- */

#service-band {
    align-items: center;
    background: #101820;
    border-bottom: 1px solid #1a232e;
    color: #9fb0bf;
    display: flex;
    font-size: 12px;
    gap: 10px;
    letter-spacing: 1.5px;
    padding: 11px 32px;
    text-transform: uppercase;
}

.dot {
    animation: pulse 1.8s ease-in-out infinite;
    background: #46d17a;
    border-radius: 50%;
    box-shadow: 0 0 8px #46d17a;
    flex: none;
    height: 8px;
    width: 8px;
}


/* ---- BOARD: the rows of departures ---- */

#board {
    background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.015) 0 1px, transparent 1px 3px);
}

.board-head {
    border-bottom: 1px solid #1a232e;
    color: #5c6975;
    display: grid;
    font-size: 11px;
    gap: 16px;
    grid-template-columns: 92px minmax(0, 1fr) 110px 150px;
    letter-spacing: 3px;
    padding: 15px 32px 11px 32px;
    text-transform: uppercase;
}

.departures {
    list-style: none;
    perspective: 900px;
}

.departure {
    display: grid;
    gap: 16px;
    grid-template-columns: 92px minmax(0, 1fr) 110px 150px;
    padding: 16px 32px;
    position: relative;
    animation: flap-in 0.6s ease-out both;
    align-items: center;
    background: #0c1218;
    border-bottom: 1px solid #131c26;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.departure:nth-child(odd) {
    background: #0e151c;
}

/* A faint line across the middle of each row, like a split-flap tile */
.departure::after {
    border-top: 1px solid rgba(255, 255, 255, 0.035);
    content: "";
    left: 32px;
    pointer-events: none;
    position: absolute;
    right: 32px;
    top: 50%;
}

.departure:hover {
    background: #15202b;
    box-shadow: inset 3px 0 0 #ffb000;
}

/* Rows arrive one after another after the title has settled */
.departure:nth-child(1) { animation-delay: 0.60s; }
.departure:nth-child(2) { animation-delay: 0.66s; }
.departure:nth-child(3) { animation-delay: 0.72s; }
.departure:nth-child(4) { animation-delay: 0.78s; }
.departure:nth-child(5) { animation-delay: 0.84s; }
.departure:nth-child(6) { animation-delay: 0.90s; }
.departure:nth-child(7) { animation-delay: 0.96s; }
.departure:nth-child(8) { animation-delay: 1.02s; }

/* The time, set in its own little tile */
.time {
    background: #06090c;
    border: 1px solid #202b37;
    border-radius: 3px;
    color: #e6edf3;
    font-weight: bold;
    letter-spacing: 1px;
    padding: 5px 8px;
    text-align: center;
}

.destination {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.route {
    color: #e6edf3;
    font-size: 18px;
    letter-spacing: 1px;
}

.code {
    color: #5c6975;
    font-size: 11px;
    letter-spacing: 2px;
}

.platform {
    color: #c9d1d9;
    font-size: 16px;
    letter-spacing: 1px;
}

.status {
    border: 1px solid currentColor;
    border-radius: 3px;
    display: inline-block;
    font-size: 11px;
    letter-spacing: 2px;
    padding: 4px 8px;
    text-align: center;
    text-transform: uppercase;
}

.status--ontime    { color: #46d17a; }
.status--delayed   { color: #ff9f43; }
.status--cancelled { color: #ff5c5c; }

.status--boarding {
    animation: pulse 1.6s ease-in-out infinite;
    color: #ffb000;
}

.board-note {
    color: #6b7683;
    font-size: 12px;
    letter-spacing: 0.5px;
    padding: 16px 32px 24px 32px;
}


/* ---- HELP: the plain-English note on editing the page ---- */

#help {
    background: #0d1319;
    border-top: 1px solid #1a232e;
    padding: 28px 32px 12px 32px;
}

#help h2 {
    color: #ffb000;
    font-size: 12px;
    letter-spacing: 3px;
    margin-bottom: 12px;
    text-transform: uppercase;
}

#help h2::before {
    color: #5c6975;
    content: "// ";
}

#help p {
    color: #9fb0bf;
    margin-bottom: 14px;
}

#help strong {
    color: #e6edf3;
    font-weight: bold;
}


/* ---- FOOTER: the required credit link ---- */

#footer {
    background: #080c11;
    border-top: 1px solid #1a232e;
    color: #5c6975;
    font-size: 10px;
    letter-spacing: 2px;
    padding: 20px 32px;
    text-align: center;
    text-transform: uppercase;
}

#footer a {
    color: #8b98a6;
    text-decoration: none;
}

#footer a:hover,
#footer a:focus {
    color: #ffb000;
}


/* ---- ANIMATION: the split-flap flip and the pulsing light ---- */

@keyframes flap-in {
    0% {
        opacity: 0;
        transform: rotateX(-90deg);
    }
    55% {
        opacity: 1;
        transform: rotateX(14deg);
    }
    100% {
        opacity: 1;
        transform: rotateX(0deg);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.35; }
}


/* ---- SMALL SCREENS: stack each row on phones ---- */

@media (max-width: 640px) {
    body {
        padding: 20px 10px 40px 10px;
    }

    #masthead,
    #service-band,
    .board-note,
    #help,
    #footer {
        padding-left: 18px;
        padding-right: 18px;
    }

    .board-title span {
        font-size: 22px;
        height: 40px;
        min-width: 30px;
    }

    .board-head {
        display: none;
    }

    .departure {
        gap: 8px 12px;
        grid-template-columns: 1fr auto;
        padding: 16px 18px;
    }

    .departure::after {
        left: 18px;
        right: 18px;
    }

    .time {
        grid-column: 1;
        grid-row: 1;
        justify-self: start;
    }

    .status {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
    }

    .destination {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .platform {
        display: none;
    }
}


/* ---- REDUCED MOTION: hold the board still if asked ---- */

@media (prefers-reduced-motion: reduce) {
    .board-title span,
    .departure,
    .status--boarding,
    .dot {
        animation: none;
    }
}


/* ---- PRINT: a clean light version for paper ---- */

@media print {
    body {
        background: #ffffff;
        color: #000000;
        padding: 0;
    }

    #page {
        border: 1px solid #cccccc;
        box-shadow: none;
        max-width: 100%;
    }

    #masthead,
    #service-band,
    #help,
    #footer {
        background: #ffffff;
    }

    .board-title span {
        background: #ffffff;
        color: #000000;
        text-shadow: none;
    }

    .route,
    .time,
    .platform {
        color: #000000;
    }

    .dot {
        display: none;
    }
}
