/* timeline section — layered over acg.css (loads after it). */

/* Full-bleed backdrop; content stays on the 1200px grid via padding. */
.timeline-section {
    max-width: none;
    padding-inline: max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter)));
    isolation: isolate;
}

/* ---------- Decoration ---------- */

.tl-deco {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: clip;
    pointer-events: none;
    user-select: none;
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 90px, #000 calc(100% - 90px), transparent 100%);
    mask-image: linear-gradient(180deg, transparent 0, #000 90px, #000 calc(100% - 90px), transparent 100%);
}

.tl-deco > * {
    position: absolute;
}

/* Soft aurora band running down behind the rail. */
.tl-deco__aurora {
    inset: 0 0 0 0;
    background:
        radial-gradient(34vw 16% at 50% 12%, rgba(140, 202, 247, 0.22), transparent 70%),
        radial-gradient(30vw 14% at 38% 38%, rgba(241, 162, 240, 0.2), transparent 70%),
        radial-gradient(32vw 15% at 62% 62%, rgba(147, 230, 212, 0.16), transparent 70%),
        radial-gradient(36vw 16% at 46% 88%, rgba(163, 180, 245, 0.22), transparent 70%);
}

/* Faint perspective grid fading toward the top. */
.tl-deco__grid {
    inset: 0;
    background:
        linear-gradient(rgba(140, 202, 247, 0.12) 1px, transparent 1px) 0 0 / 64px 64px,
        linear-gradient(90deg, rgba(140, 202, 247, 0.12) 1px, transparent 1px) 0 0 / 64px 64px;
    -webkit-mask-image: radial-gradient(ellipse 60% 70% at 50% 50%, #000, transparent 80%);
    mask-image: radial-gradient(ellipse 60% 70% at 50% 50%, #000, transparent 80%);
    opacity: 0.55;
}

/* Twinkling sparkles: tiny radial dots on two offset layers. */
.tl-deco__stars,
.tl-deco__stars::after {
    inset: 0;
    content: "";
    position: absolute;
    background-repeat: repeat;
}

.tl-deco__stars {
    background-image:
        radial-gradient(circle, #fff 0 1px, transparent 2px),
        radial-gradient(circle, var(--sky) 0 1px, transparent 2px),
        radial-gradient(circle, var(--sun) 0 1.5px, transparent 2.5px);
    background-size: 211px 263px, 317px 197px, 457px 389px;
    background-position: 20px 40px, 130px 90px, 60px 200px;
}

.tl-deco__stars::after {
    background-image:
        radial-gradient(circle, var(--pink) 0 1px, transparent 2px),
        radial-gradient(circle, #fff 0 1.5px, transparent 2.5px);
    background-size: 283px 241px, 419px 331px;
    background-position: 90px 150px, 200px 20px;
}

/* Oversized year watermark. */
.tl-deco__year {
    right: -2%;
    top: 9%;
    font-family: var(--font-script);
    font-size: clamp(110px, 20vw, 300px);
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 1.5px rgba(140, 202, 247, 0.16);
    background: linear-gradient(180deg, rgba(140, 202, 247, 0.1), transparent 75%);
    -webkit-background-clip: text;
    background-clip: text;
    rotate: -6deg;
}

.tl-deco__img {
    max-width: none;
    height: auto;
}

.tl-deco__img--blob-a { width: min(34vw, 460px); left: -10%; top: 18%; opacity: 0.4; }
.tl-deco__img--blob-b { width: min(30vw, 400px); right: -9%; top: 58%; opacity: 0.35; }
.tl-deco__img--loop-a { width: min(26vw, 340px); left: -3%; top: 4%; opacity: 0.8; }
.tl-deco__img--loop-b { width: min(22vw, 300px); right: -2%; top: 36%; opacity: 0.75; }
.tl-deco__img--loop-c { width: min(24vw, 320px); left: -2%; top: 70%; opacity: 0.75; }
.tl-deco__img--ring { width: min(12vw, 150px); right: 10%; top: 80%; opacity: 0.7; }
.tl-deco__img--ring-sm { width: min(6vw, 70px); left: 12%; top: 50%; opacity: 0.8; }

.tl-deco__squares--a { left: 3%; top: 26%; opacity: 0.5; scale: 0.8; }
.tl-deco__squares--b { right: 2%; top: 8%; opacity: 0.6; }

/* ---------- Info card: poster thumbnail ---------- */

.tl__poster {
    display: flex;
    width: fit-content;
    align-items: center;
    gap: 10px;
    margin: 4px 0 12px;
    padding: 4px 12px 4px 4px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
    color: var(--text-2);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.35s var(--ease-spring), background 0.3s;
}

.tl__poster:hover,
.tl__poster:focus-visible {
    transform: translateY(-2px) rotate(-1.5deg);
    background: rgba(255, 255, 255, 0.14);
    color: var(--text);
}

.tl__poster img {
    width: 34px;
    height: 44px;
    object-fit: cover;
    border-radius: 8px;
}

/* ---------- Media: archive photos ---------- */

.tl__media {
    --w: min(100%, 340px);
}

.tl:nth-child(even) .tl__media {
    justify-items: end;
}

.photos,
.frame-empty {
    position: relative;
    width: var(--w);
    aspect-ratio: 4 / 5;
}

.tl:nth-child(even) .photos,
.tl:nth-child(even) .frame-empty,
.tl:nth-child(even) .tl__media .chip {
    margin-left: auto;
}

/* Polaroid look: white border, thicker at the bottom. */
.photos img {
    position: absolute;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    aspect-ratio: auto;
    padding: 10px 10px 34px;
    object-fit: cover;
    background: #f4f6ff;
    border-radius: 6px;
    box-shadow: 0 14px 34px rgba(3, 6, 30, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.4);
    filter: none;
    transform: rotate(var(--r, 0deg)) translate(var(--tx, 0), var(--ty, 0));
    transition: transform 0.6s var(--ease-spring);
    background-clip: padding-box;
}

.tl--selesai .tl__media .photos img {
    filter: saturate(0.85);
}

.photos--1 img { --r: -3deg; }
.photos--2 img:nth-child(1) { --r: -6deg; --tx: -4%; }
.photos--2 img:nth-child(2) { --r: 4deg; --tx: 4%; }
.photos--3 img:nth-child(1) { --r: -6deg; --tx: -5%; --ty: 2%; }
.photos--3 img:nth-child(2) { --r: 4deg; --tx: 5%; --ty: 1%; }
.photos--3 img:nth-child(3) { --r: -1deg; }

/* Hover or keyboard focus fans the stack out. */
.photos--1:hover img { --r: 1deg; --ty: -2%; }
.photos--2:hover img:nth-child(1) { --r: -12deg; --tx: -22%; --ty: 2%; }
.photos--2:hover img:nth-child(2) { --r: 10deg; --tx: 22%; --ty: -2%; }
.photos--3:hover img:nth-child(1) { --r: -14deg; --tx: -30%; --ty: 3%; }
.photos--3:hover img:nth-child(2) { --r: 12deg; --tx: 30%; --ty: 1%; }
.photos--3:hover img:nth-child(3) { --r: 0deg; --ty: -4%; }

.tl__media:hover img {
    transform: rotate(var(--r, 0deg)) translate(var(--tx, 0), var(--ty, 0));
}

/* Empty photo frame with the ACG logo. */
.frame-empty {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: center;
    justify-items: center;
    gap: 16px;
    padding: 10px 10px 34px;
    border-radius: 6px;
    rotate: -2.5deg;
    color: var(--text-2);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-align: center;
    background:
        radial-gradient(circle at 30% 20%, rgba(241, 162, 240, 0.28), transparent 55%),
        radial-gradient(circle at 80% 85%, rgba(140, 202, 247, 0.28), transparent 55%),
        linear-gradient(160deg, rgba(23, 35, 110, 0.85), rgba(6, 10, 42, 0.85));
    box-shadow: 0 14px 34px rgba(3, 6, 30, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.35);
    transition: rotate 0.6s var(--ease-spring), transform 0.6s var(--ease-spring);
}

.frame-empty::before {
    content: "";
    position: absolute;
    inset: 10px 10px 34px;
    border: 1.5px dashed rgba(140, 202, 247, 0.5);
    border-radius: 3px;
    pointer-events: none;
}

.frame-empty::after {
    content: "";
    position: absolute;
    top: -12px;
    left: 50%;
    width: 78px;
    height: 24px;
    margin-left: -39px;
    rotate: 3deg;
    background: rgba(251, 230, 140, 0.55);
    box-shadow: 0 2px 6px rgba(3, 6, 30, 0.3);
}

.frame-empty img {
    width: 120px;
    height: auto;
    max-width: none;
    aspect-ratio: auto;
    border-radius: 0;
    box-shadow: none;
    opacity: 0.85;
    filter: drop-shadow(0 0 18px rgba(140, 202, 247, 0.6));
}

.tl__media:hover .frame-empty {
    rotate: 1deg;
    transform: translateY(-4px);
}

.tl__media .chip {
    display: block;
    width: fit-content;
    max-width: var(--w);
    margin-top: 16px;
    padding: 5px 14px;
    border-radius: 999px;
    background: rgba(11, 20, 70, 0.7);
    box-shadow: inset 0 0 0 1px rgba(140, 202, 247, 0.35);
    color: var(--text-2);
    font-size: 12px;
    font-weight: 600;
}

@media (max-width: 860px) {
    .timeline-section {
        padding-inline: var(--gutter);
    }

    .tl__media {
        --w: min(100%, 300px);
    }

    .tl:nth-child(even) .photos,
    .tl:nth-child(even) .frame-empty,
    .tl:nth-child(even) .tl__media .chip {
        margin-left: 0;
    }

    .photos,
    .frame-empty {
        aspect-ratio: 4 / 4.2;
        margin-left: 16px;
    }

    .tl-deco__squares {
        display: none;
    }

    .tl-deco__img--blob-a,
    .tl-deco__img--blob-b {
        opacity: 0.28;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tl-deco *,
    .tl-deco *::after {
        animation: none !important;
    }
}
