/* Home page «latest projects»: a release timeline beside a big showcase (views/site/_latest-works.php,
   assets/js/home-latest.js). Warm paper with ink, unlike the coloured sections above it. */
.lw { position: relative; z-index: 2; margin-top: 150px; overflow-x: clip; }
.lw__frame {
    position: relative;
    isolation: isolate;
    padding: 44px;
    border-radius: 36px;
    color: #110E2D;
    background: radial-gradient(60% 70% at 100% 0%, rgba(238, 93, 56, .12), transparent 70%), linear-gradient(180deg, #FFFBF4, #F6EFE3);
    box-shadow: 0 34px 70px -40px rgba(17, 14, 45, .45), inset 0 0 0 1px rgba(17, 14, 45, .05);
    overflow: clip;
}
/* faint ruled lines, like a ledger */
.lw__frame::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: repeating-linear-gradient(180deg, transparent 0 33px, rgba(17, 14, 45, .045) 33px 34px);
    -webkit-mask-image: linear-gradient(180deg, #000, transparent 85%);
    mask-image: linear-gradient(180deg, #000, transparent 85%);
}
.lw__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.lw__eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 30px; background: #110E2D; color: #fff; font-size: 12px; }
.lw__eyebrow i { width: 8px; height: 8px; border-radius: 50%; background: #EE5D38; box-shadow: 0 0 0 4px rgba(238, 93, 56, .3); animation: lwBlink 1.6s ease-in-out infinite; }
@keyframes lwBlink { 50% { box-shadow: 0 0 0 7px rgba(238, 93, 56, 0); } }
.lw__title { margin: 14px 0 6px; font-size: clamp(30px, 3.4vw, 46px); line-height: 1.3; }
.lw__lead { margin: 0; color: #55536B; font-size: 14px; line-height: 2; }
.lw__all { display: inline-flex; flex-shrink: 0; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 15px; background: #110E2D; color: #fff; font-size: 13px; font-weight: 700; transition: transform .2s ease, background-color .2s ease; }
.lw__all:hover { transform: translateY(-2px); background: #EE5D38; }

.lw__body { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 34px; margin-top: 34px; align-items: start; }

/* --- the showcase --- */
.lw__show { position: relative; min-height: 520px; }
.lw__year {
    position: absolute;
    z-index: -1;
    top: -64px;
    inset-inline-end: -6px;
    font-size: clamp(110px, 13vw, 190px);
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 1.5px rgba(17, 14, 45, .14);
    transition: opacity .4s ease;
}
.lw-slide { position: absolute; inset: 0 0 auto; opacity: 0; visibility: hidden; transition: opacity .6s ease, visibility 0s .6s; }
.lw-slide.is-active { position: relative; opacity: 1; visibility: visible; transition: opacity .6s ease; }
.lw-slide__win {
    display: block;
    overflow: hidden;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 40px 70px -36px rgba(17, 14, 45, .6), 0 0 0 1px rgba(17, 14, 45, .06);
    clip-path: inset(0 0 100% 0 round 20px);
    transition: clip-path .9s cubic-bezier(.7, 0, .2, 1);
}
.lw-slide.is-active .lw-slide__win { clip-path: inset(0 0 0 0 round 20px); }
.lw-slide__bar { display: flex; align-items: center; gap: 5px; padding: 10px 14px; background: #F1EEE8; direction: ltr; }
.lw-slide__bar i { width: 9px; height: 9px; border-radius: 50%; background: #D7D2C8; }
.lw-slide__bar i:nth-child(1) { background: #FF6B5E; }
.lw-slide__bar i:nth-child(2) { background: #FFC23D; }
.lw-slide__bar i:nth-child(3) { background: #3DCB6C; }
.lw-slide__bar em { margin-left: 10px; padding: 2px 14px; border-radius: 8px; background: #fff; color: #6E6B85; font-size: 11px; font-style: normal; }
.lw-slide__page { display: block; height: 400px; overflow: hidden; background: #F6F4EF; }
.lw-slide__page img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
/* a long page scrolls slowly inside the window (home-latest.js marks it and measures how far) */
.lw-slide__page img.is-tall { height: auto; }
.lw-slide.is-active .lw-slide__page img.is-tall { animation: lwPage 26s ease-in-out 1s infinite alternate; }
@keyframes lwPage { to { transform: translateY(var(--lw-shift, 0px)); } }
.lw-slide__info { display: flex; align-items: center; gap: 14px; margin-top: 18px; }
.lw-slide__logo { flex: none; width: 52px; height: 52px; padding: 5px; border-radius: 16px; background: #fff; object-fit: contain; box-shadow: 0 10px 20px -12px rgba(17, 14, 45, .5); }
.lw-slide__text { flex: 1; min-width: 0; }
.lw-slide__cat { display: inline-block; padding: 3px 10px; border-radius: 10px; background: #FFE6DD; color: #D9481F; font-size: 11px; }
.lw-slide__title { margin: 6px 0 0; font-size: clamp(17px, 1.7vw, 22px); line-height: 1.5; }
.lw-slide__title a { color: #110E2D; }
.lw-slide__title a:hover { color: #EE5D38; }
.lw-slide__go { display: grid; flex: none; place-items: center; width: 50px; height: 50px; border-radius: 50%; background: #EE5D38; color: #fff; transition: transform .25s ease; }
.lw-slide__go:hover { transform: rotate(-35deg) scale(1.06); }
html[dir="ltr"] .lw-slide__go:hover { transform: rotate(35deg) scale(1.06); }
.lw-slide.is-active .lw-slide__info { animation: lwInfo .6s cubic-bezier(.2, .7, .2, 1) .35s both; }
@keyframes lwInfo { from { opacity: 0; transform: translateY(12px); } }

/* --- the timeline --- */
.lw__line { position: relative; margin: 0; padding: 0; list-style: none; }
.lw__line::before { content: ""; position: absolute; top: 18px; bottom: 18px; inset-inline-start: 11px; width: 2px; background: repeating-linear-gradient(180deg, rgba(17, 14, 45, .2) 0 4px, transparent 4px 9px); }
.lw-tick {
    position: relative;
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    grid-template-areas: "dot date new" "dot name name";
    column-gap: 12px;
    row-gap: 2px;
    align-items: center;
    width: 100%;
    padding: 11px 14px 13px 10px;
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: #110E2D;
    text-align: start;
    cursor: pointer;
    transition: background-color .3s ease, box-shadow .3s ease;
}
html[dir="rtl"] .lw-tick { padding: 11px 10px 13px 14px; }
.lw-tick__dot { grid-area: dot; justify-self: center; width: 12px; height: 12px; border-radius: 50%; background: #F6EFE3; box-shadow: 0 0 0 2px rgba(17, 14, 45, .3); transition: background-color .3s ease, box-shadow .3s ease, transform .3s ease; }
.lw-tick__date { grid-area: date; color: #8A8899; font-size: 12px; }
.lw-tick__date b { font-weight: 400; }
.lw-tick__name { grid-area: name; overflow: hidden; color: #110E2D; font-size: 13.5px; font-weight: 700; line-height: 1.6; text-overflow: ellipsis; white-space: nowrap; opacity: .7; transition: opacity .3s ease; }
.lw-tick__new { grid-area: new; padding: 2px 9px; border-radius: 10px; background: #EE5D38; color: #fff; font-size: 10px; }
.lw-tick__bar { position: absolute; inset-inline: 46px 14px; bottom: 6px; height: 2px; border-radius: 2px; background: rgba(17, 14, 45, .08); overflow: hidden; opacity: 0; }
.lw-tick__bar i { display: block; width: 0; height: 100%; background: #EE5D38; }
.lw-tick:hover { background: rgba(255, 255, 255, .6); }
.lw-tick:hover .lw-tick__name { opacity: 1; }
.lw-tick:focus-visible { outline: 2px solid #EE5D38; outline-offset: 2px; }
.lw-tick.is-active { background: #fff; box-shadow: 0 16px 30px -18px rgba(17, 14, 45, .45); }
.lw-tick.is-active .lw-tick__dot { background: #EE5D38; box-shadow: 0 0 0 5px rgba(238, 93, 56, .2); transform: scale(1.15); }
.lw-tick.is-active .lw-tick__name { opacity: 1; }
.lw-tick.is-active .lw-tick__bar { opacity: 1; }
.lw.is-stopped .lw-tick__bar { opacity: 0 !important; }

@media (max-width: 991px) {
    .lw__frame { padding: 28px 18px; border-radius: 30px; }
    .lw__head { flex-direction: column; align-items: stretch; }
    .lw__all { align-self: flex-start; }
    .lw__body { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .lw__show { min-height: 0; }
    .lw-slide__page { height: 300px; }
    .lw__line { display: flex; gap: 10px; order: -1; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 6px; }
    .lw__line::-webkit-scrollbar { display: none; }
    .lw__line::before { display: none; }
    .lw__line li { flex: 0 0 220px; scroll-snap-align: start; }
    .lw-tick { background: rgba(255, 255, 255, .55); }
    .lw__year { top: -40px; }
}
@media (max-width: 575px) {
    .lw { margin-top: 110px; }
    .lw-slide__page { height: 230px; }
}
@media (prefers-reduced-motion: reduce) {
    .lw * { transition: none !important; animation: none !important; }
}
