/* =========================================================
   NYC Mobility - Global Styles
   Date: 2026-01-09
   Author: Aron Maggisano
   ========================================================= */

/* ========================================
   FONT EMBEDDING
   ======================================== */

@font-face {
    font-family: "ConsolasBold";
    src: url("../fonts/Consolas-Font/CONSOLAB.TTF") format("truetype");
    font-weight: 700;
    font-style: normal;
}

/* ========================================
   CSS CUSTOM PROPERTIES
   ======================================== */

:root {
    --font-sans:
        system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        sans-serif;

    --nav-height: 120px;
    --nav-gap: 16px;

    --nav-radius: 28px;
    --rail-radius: 20px;

    --nav-pad-y: 12px;
    --nav-pad-x: clamp(12px, 2vw, 16px);

    --title-font-size: clamp(28px, 3.3vw, 44px);
    --menu-font-size: clamp(12px, 1.1vw, 15px);

    --menu-gap: clamp(10px, 2.2vw, 48px);

    --track-inset-default: clamp(40px, 4vw, 56px);
}

/* ========================================
   GLOBAL LAYOUT & TYPOGRAPHY
   ======================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    background: #2f3030;
    overscroll-behavior: none;
}

body {
    margin: 0;
    padding-left: 0;
    padding-top: calc(var(--nav-height) + var(--nav-gap));
    overscroll-behavior: none;

    background:
        linear-gradient(#2f3030e2, #2f3030fa),
        url("../images/backgrounds/SubwayMapNYC_Large.jpg") center / cover
            no-repeat fixed;
}

.grand-central-clock {
  position: fixed;
  left: 8px;
  top: 8px;
  width: 134px;
  height: 134px;
  z-index: 5;
  pointer-events: none;
}

.grand-central-clock__face {
  width: 100%;
  height: 100%;
  display: block;
}

.grand-central-clock__rim {
  fill: #d9d9d9;
  stroke: #8b8b8b;
  stroke-width: 4;
}

.grand-central-clock__dial {
  fill: #f4f4f4;
  stroke: #c0c0c0;
  stroke-width: 2;
}

.grand-central-clock__tick {
  stroke: #101010;
  stroke-linecap: square;
}

.grand-central-clock__tick--hour {
  stroke-width: 6;
}

.grand-central-clock__tick--minute {
  stroke-width: 3;
  opacity: 0.8;
}

.grand-central-clock__hand {
  stroke-linecap: square;
  transform-origin: 100px 100px;
}

.grand-central-clock__hand--hour {
  stroke: #1a1a1a;
  stroke-width: 8;
}

.grand-central-clock__hand--minute {
  stroke: #1a1a1a;
  stroke-width: 6;
}

.grand-central-clock__hand--second {
  stroke: #d8342a;
  stroke-width: 2.5;
}

.grand-central-clock__hub {
  fill: #d8342a;
}

.grand-central-clock__second-dot {
  fill: #d8342a;
  transform-origin: 100px 100px;
}

@media (max-width: 900px) {
  .grand-central-clock {
    left: 12px;
    width: 160px;
    height: 160px;
  }
}

main {
    max-width: 1600px;
    margin: 40px auto;
    padding: 0 40px;

    font-family: var(--font-sans);
    font-size: 18px;
    line-height: 1.6;
    color: #111;
}

main h1 {
    font-family: "ConsolasBold", monospace;
    font-size: 60px;
    color: #f2f3f4;
    margin-bottom: 16px;
    text-align: center;
}

main p {
    margin-bottom: 12px;
    color: #f2f3f4;
}

/* ========================================
   TOP NAVIGATION
   ======================================== */

.top-nav-outer {
    position: fixed;
    top: 8px;
    left: calc(8px + 134px + 12px);
    right: 8px;

    height: var(--nav-height);
    width: auto;

    background: #100c08;
    border-radius: var(--nav-radius);

    padding: var(--nav-pad-y) var(--nav-pad-x);

    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;

    box-shadow: 0 8px 24px rgba(7, 1, 70, 0.2);
    z-index: 9998;

    overflow: hidden;
}

.top-nav-title {
    color: #f2f3f4;
    font-family: "ConsolasBold", monospace;
    font-size: var(--title-font-size);
    font-weight: 700;
    line-height: 1;

    margin: 0;
    padding: 6px 10px;
    border-radius: 16px;

    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;

    white-space: nowrap;
    flex: 0 0 auto;
}

.top-nav-title:hover {
    background-color: #1c1c1c4d;
    color: #343434;
}

.top-nav {
    position: relative;
    flex: 1 1 auto;

    height: 100%;
    min-width: 0;

    margin: 0;
    background: #343434;
    border-radius: var(--rail-radius);

    display: flex;
    align-items: center;

    --rail-center: -40px;
    --label-shift: 10px;

    padding: 12px var(--nav-pad-x) 64px var(--nav-pad-x);

    --track-inset: var(--track-inset-default);

    --track-left: var(--track-inset);
    --track-right: var(--track-inset);

    overflow: hidden;
}

/* ========================================
   TOP NAV RAIL
   ======================================== */

.top-nav::before {
    content: "";
    position: absolute;

    left: var(--track-left);
    right: var(--track-right);

    bottom: calc(var(--rail-center) + 57px);
    height: 12px;

    background-color: #343434;
    border-radius: 999px;

    z-index: 1;
    pointer-events: none;
}

.top-nav::after {
    content: "";
    position: absolute;

    left: calc(var(--track-left) + 3px);
    right: calc(var(--track-right) + 3px);

    bottom: calc(var(--rail-center) + 60px);
    height: 6px;

    background-color: #f2f3f4;
    border-radius: 999px;

    z-index: 2;
    pointer-events: none;
}

/* ========================================
   TOP NAV MENU
   ======================================== */

.menu {
    list-style: none;
    margin: 0;
    padding: 0;

    position: relative;
    width: 100%;
    height: 100%;

    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;

    gap: var(--menu-gap);

    flex-wrap: nowrap;
    min-width: 0;

    z-index: 5;
}

.menu li {
    position: relative;
    height: 100%;
    flex: 1 1 0;
    min-width: 0;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

/* Station dots under labels */
.menu li::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: calc(var(--rail-center) - 10px);
    transform: translateX(-50%);

    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #f2f3f4;

    z-index: 6;
    pointer-events: none;
}

.menu li::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: calc(var(--rail-center) - 5px);
    transform: translateX(-50%);

    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #343434;

    z-index: 7;
    pointer-events: none;
}

.menu li:first-child::before,
.menu li:last-child::before {
    width: 30px;
    height: 30px;
    bottom: calc(var(--rail-center) - 15px);
}

.menu li:first-child::after,
.menu li:last-child::after {
    width: 15px;
    height: 15px;
    bottom: calc(var(--rail-center) - 8px);
}

.menu a {
    position: relative;
    text-decoration: none;
    color: #f2f3f4;

    font-family: "ConsolasBold", monospace;
    font-size: var(--menu-font-size);
    line-height: 1.1;

    width: 100%;
    max-width: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    text-align: center;

    margin: 0;
    padding: 7px clamp(6px, 0.9vw, 10px);
    border-radius: 12px;

    transform: translateY(var(--label-shift));
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.menu-time-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 2px;
    font-family: "ConsolasBold", monospace;
    font-size: 11px;
    letter-spacing: 0.02em;
    color: #c9c9c9;
    transform: translateY(var(--label-shift));
}

.menu-delay {
    color: #ff5b5b;
    font-size: 11px;
    font-weight: 700;
    margin-left: 4px;
}

.menu a:hover {
    background-color: #f2f3f44d;
    color: #343434;
}

.credits-grid {
    display: flex;
    justify-content: space-between;
    gap: 32px;
    flex-wrap: wrap;
}

.credits-col {
    flex: 1 1 240px;
}

.credits-spacer {
    height: 80px;
}

/* Red indicator dot */
.menu-indicator {
    position: absolute;
    left: 0;
    bottom: calc(var(--rail-center) + 55px);
    transform: translateX(-50%);

    width: 18px;
    height: 18px;
    border-radius: 50%;

    background: #ff3b3b;
    box-shadow: 0 0 8px rgba(255, 59, 59, 0.8);

    z-index: 8;

    transition: transform 0.12s linear;
    will-change: transform;

    pointer-events: none;
}

/* ========================================
   CHAPTER LAYOUT
   ======================================== */

.chapter {
    margin: 72px 0;
    position: relative;
    font-family: var(--font-sans);
}

.chapter-heading {
    margin: 0 0 8px 0;
    text-align: left;
}

.chapter-heading span {
    display: inline-block;
    padding: 0;
    border: none;
    background: transparent;

    font-family: "ConsolasBold", monospace;
    font-size: 42px;
    margin-top: 48px;
    color: #f2f3f4;
}

.chapter-layout {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    column-gap: 10px;
    margin-top: 4px;
}

.chapter-bracket {
    position: relative;
    left: 4px;
}

.chapter-bracket::before {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);

    top: 0;
    height: 100%;
    width: 20px;

    border-left: 4px solid #9a854d;
    border-bottom: 4px solid #9a854d;
    border-bottom-left-radius: 24px;
}

.chapter-box {
    border: none;
    border-radius: 0;
    padding: 0;
    background: transparent;
}

.chapter-box p {
    margin-bottom: 12px;
}

/* ========================================
   CHAPTER TEXT: LISTS + INLINE TEXT COLOR FIX
   ======================================== */

/* Lists in the storytelling chapters were inheriting main's default #111 */
.chapter-box ul,
.chapter-box ol {
    margin: 0 0 12px 22px;
    padding: 0;
    color: #f2f3f4;
}

.chapter-box li {
    margin: 6px 0;
    color: #f2f3f4;
}

/* Keep emphasis readable on dark background */
.chapter-box li strong,
.chapter-box li em,
.chapter-box li i {
    color: #f2f3f4;
}

/* Optional (future-proof): links inside the chapter text */
.chapter-box a {
    color: #f2f3f4;
}


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

.main-footer {
    width: 100%;
    margin: 20px auto 8px;
    padding: 20px 0;

    text-align: center;
    font-size: 14px;
    line-height: 1.4;

    background-color: #100c08;
    color: #f2f3f4;

    border-radius: 24px;
    box-shadow: 0 8px 24px rgba(7, 1, 70, 0.2);
}

/* ========================================
   EASTER EGG: TRAIN ANIMATION
   ======================================== */

.easter-train {
    position: fixed;
    left: 0;
    bottom: 40px;

    display: flex;
    align-items: flex-end;
    gap: 0;

    pointer-events: none;
    z-index: 9999;

    transform: translateX(-110vw);
    opacity: 0;
}

.easter-train img.train-car {
    height: 80px;
    width: auto;
    display: block;
}

.easter-train--active {
    opacity: 1;
    animation: train-run 5s linear forwards;
}

@keyframes train-run {
    from {
        transform: translateX(-110vw);
    }
    to {
        transform: translateX(110vw);
    }
}

/* ========================================
   LINK RESET
   ======================================== */

.menu a,
.menu a:link,
.menu a:visited,
.menu a:hover,
.menu a:active,
.menu a:focus,
.menu a:focus-visible {
    text-decoration: none !important;
    outline: none;
}

.top-nav-outer > a,
.top-nav-outer > a:link,
.top-nav-outer > a:visited,
.top-nav-outer > a:hover,
.top-nav-outer > a:active,
.top-nav-outer > a:focus,
.top-nav-outer > a:focus-visible {
    text-decoration: none !important;
    outline: none;
}
