@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg: #050608;
    --surface: rgba(255, 255, 255, 0.06);
    --surface-strong: rgba(17, 19, 26, 0.72);
    --border: rgba(255, 255, 255, 0.12);
    --accent: #e8f13a;
    --accent-soft: rgba(232, 241, 58, 0.14);
    --text: #f2f3f5;
    --text-muted: #a7adba;
    --radius-lg: 24px;
    --radius-md: 16px;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
}

body {
    font-family: Poppins, sans-serif;
    background-color: var(--bg);
    background-image:
        radial-gradient(1100px 700px at 88% -10%, rgba(96, 98, 168, 0.16), transparent 60%),
        radial-gradient(900px 650px at -8% 112%, rgba(232, 241, 58, 0.06), transparent 55%);
    background-attachment: fixed;
    color: var(--text);
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
}

::selection {
    background-color: var(--accent);
    color: #101204;
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #0a0c10;
}

::-webkit-scrollbar-thumb {
    background: #2a2e38;
    border-radius: 999px;
    border: 2px solid #0a0c10;
}

a {
    text-decoration: none;
    color: var(--text);
}

header {
    position: relative;
    z-index: 100;
    width: 1140px;
    max-width: 80%;
    margin: auto;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: right;
}

header a {
    margin-right: 40px;
}

/* Carousel */
.carousel {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

.carousel .list .item {
    position: absolute;
    inset: 0 0 0 0;
}

.carousel .list .item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel .list .item .content {
    position: absolute;
    top: 16%;
    width: min(1140px, 88vw);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    background-color: var(--surface-strong);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: clamp(22px, 4vh, 36px) clamp(22px, 3.5vw, 42px);
    color: var(--text);
}

.carousel .list .item .content .author {
    order: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.carousel .list .item .content .author::before {
    content: '';
    width: 28px;
    height: 2px;
    border-radius: 999px;
    background-color: var(--accent);
}

.carousel .list .item .content .topic {
    order: 2;
    font-size: clamp(42px, 6.5vw, 72px);
    font-weight: 800;
    line-height: 1.02;
    letter-spacing: -1px;
    color: var(--accent);
    margin-bottom: 4px;
}

.carousel .list .item .content .title {
    order: 3;
    font-size: clamp(13px, 1.4vw, 16px);
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.carousel .list .item .content .description {
    order: 4;
    max-width: 600px;
    font-size: clamp(13px, 1.3vw, 15px);
    line-height: 1.8;
    color: #ccd1da;
    margin-bottom: 24px;
}

.carousel .list .item .content .buttons {
    order: 5;
    display: flex;
    gap: 12px;
}

.carousel .list .item .content button {
    border: none;
    border-radius: 999px;
    background-color: var(--accent);
    color: #101204;
    font-family: Poppins;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 14px 36px;
    cursor: pointer;
    transition: transform var(--ease), box-shadow var(--ease), background-color var(--ease);
}

.carousel .list .item .content button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(232, 241, 58, 0.35);
}

.carousel .list .item .content button:active {
    transform: translateY(0) scale(0.97);
}

.carousel .list .item .content button:focus-visible,
.arrows button:focus-visible,
.intro-start:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.carousel .list .item .content button:nth-child(2) {
    background-color: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

/* Thumbnail */
.thumbnail {
    position: absolute;
    bottom: 44px;
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    z-index: 100;
    display: flex;
    gap: 14px;
}

.thumbnail .item {
    width: 83px;
    height: 122px;
    flex-shrink: 0;
    position: relative;
    cursor: pointer;
}

.thumbnail .item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid var(--border);
    transition: transform var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.thumbnail .item::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 14px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.72), transparent 55%);
    pointer-events: none;
    transition: opacity var(--ease);
}

.thumbnail .item:hover img {
    transform: translateY(-6px);
    border-color: var(--accent);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
}

.thumbnail .item:hover::after {
    opacity: 0.4;
}

.thumbnail .item .content {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    z-index: 1;
}

.thumbnail .item .content .title {
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.thumbnail .item .content .description {
    font-size: 10px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Arrows */
.arrows {
    position: absolute;
    left: 4%;
    bottom: 64px;
    z-index: 100;
    display: flex;
    gap: 12px;
    align-items: center;
}

.arrows button {
    width: 46px;
    height: 46px;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    font-family: monospace;
    color: var(--text);
    font-weight: bold;
    font-size: large;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background-color var(--ease), color var(--ease), border-color var(--ease), transform var(--ease), box-shadow var(--ease);
}

.arrows button:hover {
    background-color: var(--accent);
    color: #101204;
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 10px 26px rgba(232, 241, 58, 0.3);
}

.arrows button:active {
    transform: translateY(0) scale(0.92);
}

/* Slide reveal machinery (required by script.js) */
.carousel .list .item:nth-child(1) {
    z-index: 1;
}

body,
.carousel .list .item:nth-child(1) .author,
.carousel .list .item:nth-child(1) .title,
.carousel .list .item:nth-child(1) .topic,
.carousel .list .item:nth-child(1) .description,
.carousel .list .item:nth-child(1) .buttons {
    transform: translateY(50px);
    filter: blur(20px);
    opacity: 0;
    animation: showContent 0.5s 1s linear 1 forwards;
}

@keyframes showContent {
    to {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0);
    }
}

.carousel .list .item:nth-child(1) .title {
    animation-delay: 1.3s;
}

.carousel .list .item:nth-child(1) .topic {
    animation-delay: 1.5s;
}

.carousel .list .item:nth-child(1) .description {
    animation-delay: 1.7s;
}

.carousel .list .item:nth-child(1) .buttons {
    animation-delay: 1.9s;
}

.carousel.next .list .item:nth-child(1) img {
    width: 150px;
    height: 220px;
    position: absolute;
    left: 50%;
    bottom: 50px;
    border-radius: 20px;
    animation: showImage 0.5s linear 1 forwards;
}

@keyframes showImage {
    to {
        width: 100%;
        height: 100%;
        left: 0;
        bottom: 0;
        border-radius: 0;
    }
}

.carousel.next .thumbnail .item:nth-last-child(1) {
    width: 0;
    overflow: hidden;
    animation: showThumbnail 0.5s linear 1 forwards;
}

@keyframes showThumbnail {
    to {
        width: 150px;
    }
}

.carousel.next .thumbnail {
    transform: translateX(calc(-50% + 150px));
    animation: transformThumbnail 0.5s linear 1 forwards;
}

@keyframes transformThumbnail {
    to {
        transform: translateX(-50%);
    }
}

.carousel.prev .list .item:nth-child(2) {
    z-index: 2;
}

.carousel.prev .list .item:nth-child(2) img {
    position: absolute;
    bottom: 0;
    left: 0;
    animation: outImage 0.5s linear 1 forwards;
}

@keyframes outImage {
    to {
        width: 150px;
        height: 220px;
        border-radius: 20px;
        left: 50%;
        bottom: 50px;
    }
}

.carousel.prev .thumbnail .item:nth-child(1) {
    width: 0;
    overflow: hidden;
    opacity: 0;
    animation: showThumbnail 0.5s linear 1 forwards;
}

.carousel.prev .list .item:nth-child(2) .author,
.carousel.prev .list .item:nth-child(2) .title,
.carousel.prev .list .item:nth-child(2) .topic,
.carousel.prev .list .item:nth-child(2) .description,
.carousel.prev .list .item:nth-child(2) .buttons {
    animation: contentOut 1.5s linear 1 forwards;
}

@keyframes contentOut {
    to {
        transform: translateY(150px);
        filter: blur(20px);
        opacity: 0;
    }
}

.carousel.next .arrows button,
.carousel.prev .arrows button {
    pointer-events: none;
    opacity: 0.4;
}

/* Intro window */
.intro {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-color: #000;
    background-image:
        radial-gradient(1px 1px at 12% 22%, rgba(255, 255, 255, 0.9), transparent),
        radial-gradient(1.5px 1.5px at 28% 68%, rgba(255, 255, 255, 0.7), transparent),
        radial-gradient(1px 1px at 45% 15%, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(2px 2px at 62% 42%, rgba(232, 241, 58, 0.5), transparent),
        radial-gradient(1px 1px at 74% 78%, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(1.5px 1.5px at 86% 30%, rgba(255, 255, 255, 0.7), transparent),
        radial-gradient(1px 1px at 91% 60%, rgba(255, 255, 255, 0.9), transparent),
        radial-gradient(1.5px 1.5px at 8% 84%, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(ellipse at center, #12121c 0%, #000 75%);
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.intro.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.intro-window {
    max-width: 640px;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    text-align: center;
    background-color: var(--surface-strong);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: clamp(28px, 6vh, 48px) clamp(22px, 5vw, 44px);
    box-shadow: var(--shadow);
    animation: introIn 0.7s var(--ease) forwards;
}

.intro-kicker {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--accent);
    background-color: var(--accent-soft);
    border: 1px solid var(--accent);
    border-radius: 999px;
    padding: 6px 16px;
    margin-bottom: 18px;
}

#intro-title {
    margin: 0;
    font-size: clamp(34px, 6vw, 52px);
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.08;
}

#intro-title em {
    font-style: normal;
    color: var(--accent);
}

.intro-text {
    margin: 18px auto 26px;
    max-width: 480px;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.8;
}

.intro-tips {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.tip {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 14px;
    transition: transform var(--ease), border-color var(--ease);
}

.tip:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
}

.tip-symbol {
    display: block;
    font-size: 20px;
    color: var(--accent);
    margin-bottom: 8px;
    letter-spacing: 4px;
}

.tip h3 {
    margin: 0 0 6px;
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.tip p {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
}

.intro-start {
    margin-top: 30px;
    padding: 14px 46px;
    border: none;
    border-radius: 999px;
    background-color: var(--accent);
    color: #101204;
    font-family: Poppins;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform var(--ease), box-shadow var(--ease);
}

.intro-start:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(232, 241, 58, 0.35);
}

.intro-hint {
    margin: 16px 0 0;
    font-size: 11px;
    color: #777;
}

.intro-hint kbd {
    font-family: Poppins;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-bottom-width: 2px;
    border-radius: 5px;
    padding: 2px 7px;
    font-size: 10px;
    color: var(--text-muted);
}

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

/* Cinematic layer */
.carousel::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 50;
    box-shadow: inset 0 0 190px rgba(0, 0, 0, 0.78);
}

.carousel .list .item:nth-child(1) img {
    animation: kenBurns 26s ease-in-out infinite alternate;
}

@keyframes kenBurns {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.13) translate(-1.5%, -1%);
    }
}

.carousel .list .item .topic span {
    display: inline-block;
}

.carousel .list .item:nth-child(1) .topic span {
    opacity: 0;
    transform: translateY(0.6em) rotate(6deg);
    filter: blur(8px);
    animation: letterIn 0.55s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
    animation-delay: calc(1.85s + var(--i) * 0.05s);
}

@keyframes letterIn {
    to {
        opacity: 1;
        transform: translateY(0) rotate(0deg);
        filter: blur(0);
    }
}

.autoplay-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 900;
    background-color: rgba(255, 255, 255, 0.07);
}

.autoplay-progress span {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #a9e04a);
    box-shadow: 0 0 14px rgba(232, 241, 58, 0.7);
}

.hud {
    position: fixed;
    top: 18px;
    right: 22px;
    z-index: 900;
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--text-muted);
    background-color: var(--surface-strong);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 18px;
}

.hud #hud-index,
.hud #hud-total {
    color: var(--text);
}

.hud-name {
    color: var(--accent);
    text-transform: uppercase;
    margin-left: 10px;
    padding-left: 14px;
    border-left: 1px solid var(--border);
}

/* Intro: orbit scene + shooting stars + stagger */
.orbit-scene {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
}

.sun-core {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 26px;
    height: 26px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #fff7cf, var(--accent) 60%, #d8b500);
    box-shadow: 0 0 24px rgba(232, 241, 58, 0.8), 0 0 60px rgba(232, 241, 58, 0.35);
    animation: sunPulse 3.2s ease-in-out infinite;
}

@keyframes sunPulse {

    0%,
    100% {
        box-shadow: 0 0 22px rgba(232, 241, 58, 0.75), 0 0 55px rgba(232, 241, 58, 0.32);
    }

    50% {
        box-shadow: 0 0 34px rgba(232, 241, 58, 0.95), 0 0 80px rgba(232, 241, 58, 0.45);
    }
}

.orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    border: 1px dashed rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.orbit.o1 {
    width: 68px;
    height: 68px;
    animation: orbitSpin 5s linear infinite;
}

.orbit.o2 {
    width: 112px;
    height: 112px;
    animation: orbitSpin 11s linear infinite reverse;
}

.moon {
    position: absolute;
    top: -5px;
    left: 50%;
    width: 10px;
    height: 10px;
    margin-left: -5px;
    border-radius: 50%;
}

.m1 {
    background: radial-gradient(circle at 30% 30%, #bcd4ff, #4f74c4);
}

.m2 {
    background: radial-gradient(circle at 30% 30%, #ffd9c4, #c46a4f);
    width: 8px;
    height: 8px;
    top: -4px;
    margin-left: -4px;
}

@keyframes orbitSpin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.intro::before,
.intro::after {
    content: '';
    position: absolute;
    width: 160px;
    height: 1.5px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95), transparent);
    opacity: 0;
}

.intro::before {
    top: 18%;
    left: 15%;
    transform: rotate(35deg);
    animation: shoot 9s ease-in 2s infinite;
}

.intro::after {
    top: 62%;
    left: 55%;
    transform: rotate(35deg);
    animation: shoot 11s ease-in 6s infinite;
}

@keyframes shoot {

    0%,
    72% {
        opacity: 0;
    }

    76% {
        opacity: 1;
    }

    86% {
        opacity: 0;
        translate: 46vw 30vh;
    }

    100% {
        opacity: 0;
        translate: 46vw 30vh;
    }
}

.intro-window > * {
    animation: fadeUpIntro 0.7s var(--ease) both;
}

.intro-window > *:nth-child(1) { animation-delay: 0.05s; }
.intro-window > *:nth-child(2) { animation-delay: 0.15s; }
.intro-window > *:nth-child(3) { animation-delay: 0.25s; }
.intro-window > *:nth-child(4) { animation-delay: 0.4s; }
.intro-window > *:nth-child(5) { animation-delay: 0.55s; }
.intro-window > *:nth-child(6) { animation-delay: 0.7s; }
.intro-window > *:nth-child(7) { animation-delay: 0.85s; }

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

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media screen and (max-width: 900px) {
    .arrows {
        left: 50%;
        transform: translateX(-50%);
        bottom: 200px;
    }

    .carousel .list .item .content {
        top: 12%;
        max-height: 62vh;
        overflow-y: auto;
    }
}

@media screen and (max-width: 678px) {
    .carousel .list .item .content {
        width: 92vw;
        top: 10%;
    }

    .carousel .list .item .content .topic {
        font-size: 34px;
    }

    .thumbnail {
        gap: 10px;
    }

    .thumbnail .item {
        width: 68px;
        height: 100px;
    }

    .thumbnail .item .content .description {
        display: none;
    }
}
