:root {
    --degree-width: max(12px, 1.2vw);
    --total-width: calc(360 * var(--degree-width));
    --bg-chart: #f0ebe3;
    --prime-meridian: #c4392d;
    --date-line-band: #16213e;
    --date-line-stroke: #2c4a6f;
    --degree-ticks: #4a4a4a;
    --dial-white: #e8e4dc;
    --chart-aged: #a09888;
    --instrument-label: #6b7a8c;
    --tz-band: #e5dfd5;
}

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

html, body {
    height: 100vh;
    overflow-y: hidden;
    overflow-x: hidden;
    background-color: var(--bg-chart);
}

body {
    font-family: 'Alegreya', Georgia, serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1vw, 1.05rem);
    line-height: 1.7;
    color: var(--chart-aged);
}

/* Main horizontal strip */
.meridian-strip {
    position: relative;
    width: var(--total-width);
    height: 100vh;
    overflow-x: scroll;
    overflow-y: hidden;
    white-space: nowrap;
    background-color: var(--bg-chart);
}

/* Time zone alternating bands */
.meridian-strip::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        90deg,
        var(--bg-chart) 0,
        var(--bg-chart) calc(15 * var(--degree-width)),
        var(--tz-band) calc(15 * var(--degree-width)),
        var(--tz-band) calc(30 * var(--degree-width))
    );
}

/* Tick track at bottom */
.tick-track {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 80px;
    pointer-events: none;
    z-index: 10;
}

/* Longitude point containers */
.longitude-point {
    position: absolute;
    top: 0;
    width: 200px;
    height: 100vh;
    white-space: normal;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 60px;
    z-index: 2;
    transform: translateX(-50%);
}

/* Meridian lines */
.meridian-line {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 100vh;
    background-color: var(--degree-ticks);
    opacity: 0.3;
    z-index: 0;
}

.prime-line {
    width: 3px;
    background-color: var(--prime-meridian);
    opacity: 1;
}

.date-line {
    width: 3px;
    background-color: var(--date-line-stroke);
    opacity: 1;
}

/* Date line dark band */
.date-line-band {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 100vh;
    background-color: var(--date-line-band);
    z-index: -1;
}

/* Station marker dot */
.longitude-point::before {
    content: '';
    display: block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: var(--degree-ticks);
    margin-bottom: 4px;
    flex-shrink: 0;
    z-index: 3;
}

/* Station marker connecting line */
.longitude-point::after {
    content: '';
    display: block;
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 40px;
    background-color: var(--degree-ticks);
    z-index: 1;
}

/* Degree notation */
.degree-notation {
    font-family: 'Courier Prime', 'Courier New', monospace;
    font-weight: 400;
    font-size: clamp(1.2rem, 1.5vw, 1.6rem);
    color: var(--degree-ticks);
    letter-spacing: 0.05em;
    text-align: center;
    margin-top: 44px;
    z-index: 3;
}

.prime-meridian .degree-notation {
    color: var(--prime-meridian);
}

/* Place names */
.place-name {
    font-family: 'Titillium Web', 'Arial Narrow', sans-serif;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--instrument-label);
    margin-top: 8px;
    z-index: 3;
}

/* Domain title at Prime Meridian */
.domain-title {
    font-family: 'Courier Prime', 'Courier New', monospace;
    font-weight: 400;
    font-size: clamp(1.4rem, 2vw, 2rem);
    color: var(--prime-meridian);
    margin-top: 16px;
    text-align: center;
    z-index: 3;
}

/* Description text */
.description {
    font-family: 'Alegreya', Georgia, serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1vw, 1.05rem);
    line-height: 1.7;
    color: var(--chart-aged);
    margin-top: 16px;
    text-align: center;
    max-width: 180px;
    z-index: 3;
}

/* UTC offset */
.utc-offset {
    font-family: 'Courier Prime', 'Courier New', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--instrument-label);
    margin-top: 12px;
    letter-spacing: 0.08em;
    z-index: 3;
}

/* Date Line point styling */
.date-line-point .degree-notation,
.date-line-point .place-name,
.date-line-point .description,
.date-line-point .utc-offset {
    position: relative;
    z-index: 3;
}

.light-text {
    color: var(--dial-white);
}

.date-line-point .description.light-text {
    color: var(--dial-white);
    opacity: 0.85;
}

.date-line-point .description.light-text strong {
    color: var(--dial-white);
    opacity: 1;
}

/* Content station marker animation */
.longitude-point {
    transition: transform 0.2s ease;
}

.longitude-point.in-view {
    transform: translateX(-50%) scale(1.02);
}

/* Scroll hint */
.scroll-hint {
    position: fixed;
    bottom: 100px;
    right: 40px;
    z-index: 20;
    opacity: 1;
    transition: opacity 0.6s ease;
}

.scroll-hint.hidden {
    opacity: 0;
    pointer-events: none;
}

.hint-text {
    font-family: 'Titillium Web', 'Arial Narrow', sans-serif;
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--instrument-label);
    animation: hint-pulse 2s ease-in-out infinite;
}

@keyframes hint-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* Custom scrollbar */
.meridian-strip::-webkit-scrollbar {
    height: 20px;
    background: var(--tz-band);
}

.meridian-strip::-webkit-scrollbar-thumb {
    background: var(--chart-aged);
    border: 2px solid var(--tz-band);
}

.meridian-strip::-webkit-scrollbar-track {
    background: var(--tz-band);
}

/* Tick marks rendered in the scrollbar area */
.tick-mark {
    position: absolute;
    bottom: 0;
    width: 1px;
    background-color: var(--degree-ticks);
    opacity: 0.5;
}

.tick-mark.tick-10 {
    height: 40px;
}

.tick-mark.tick-30 {
    height: 60px;
}

.tick-mark.tick-90 {
    height: 80px;
    opacity: 0.7;
}

/* Degree label on ticks */
.tick-label {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Courier Prime', 'Courier New', monospace;
    font-size: 0.55rem;
    color: var(--degree-ticks);
    opacity: 0.5;
    white-space: nowrap;
}

/* Return point at end */
.return-point {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 3;
}

.return-text {
    font-family: 'Courier Prime', 'Courier New', monospace;
    font-weight: 400;
    font-size: clamp(1rem, 1.3vw, 1.4rem);
    color: var(--prime-meridian);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    :root {
        --degree-width: max(14px, 1.6vw);
    }

    .longitude-point {
        width: 160px;
    }

    .description {
        max-width: 140px;
        font-size: 0.85rem;
    }

    .scroll-hint {
        right: 20px;
        bottom: 90px;
    }

    .date-line-band {
        width: 200px;
    }
}
