/* ==========================================================================
   History page (history.php) — builds on home.css + about.css
   ========================================================================== */

/* ---------- Hero badge ---------- */
.hs-hero { min-height: 78vh; }
.hs-hero-years {
    position: relative;
    width: 340px;
    height: 340px;
    margin-left: auto;
    display: grid;
    place-items: center;
    animation: heroRise 1s var(--ease-out) 1s both;
}
.hs-hero-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px dashed rgba(255, 196, 107, .55);
    animation: spin 40s linear infinite;
}
.hs-hero-ring.hs-ring-2 {
    inset: 34px;
    border: 1px solid rgba(255, 255, 255, .25);
    border-top-color: var(--brand);
    border-width: 3px;
    animation-duration: 6s;
}
.hs-hero-badge {
    position: relative;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .25);
    backdrop-filter: blur(12px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, .3), inset 0 0 40px rgba(247, 151, 63, .25);
    animation: floatY 6s ease-in-out infinite;
}
.hs-hero-badge small { text-transform: uppercase; letter-spacing: .25em; font-size: .75rem; color: #ffc46b; }
.hs-hero-badge strong {
    font-size: 4rem;
    font-weight: 900;
    line-height: 1;
    background: linear-gradient(180deg, #fff, #ffc46b);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hs-hero-badge > span { font-size: .85rem; color: rgba(255, 255, 255, .8); margin-top: .4rem; }

/* ---------- Intro ---------- */
.hs-intro { padding-bottom: 3rem; }
.hs-quote {
    position: relative;
    font-size: 1.45rem;
    font-weight: 600;
    font-style: italic;
    line-height: 1.5;
    color: var(--ink);
    padding-left: 1.5rem;
    border-left: 4px solid var(--brand);
    margin-bottom: 1.2rem;
}

/* ---------- Sticky year navigator ---------- */
.hs-yearnav {
    position: sticky;
    top: var(--header-h, 96px);
    z-index: 900;
    padding: .8rem 0;
    pointer-events: none;
}
.hs-yearnav-inner {
    position: relative;
    display: flex;
    justify-content: center;
    gap: .25rem;
    width: max-content;
    max-width: 100%;
    margin: 0 auto;
    padding: .35rem;
    border-radius: 50px;
    background: rgba(255, 255, 255, .85);
    backdrop-filter: saturate(160%) blur(12px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .1);
    border: 1px solid rgba(247, 151, 63, .2);
    overflow-x: auto;
    scrollbar-width: none;
    pointer-events: auto;
}
.hs-yearnav-inner::-webkit-scrollbar { display: none; }
.hs-yearnav a {
    position: relative;
    z-index: 1;
    padding: .5rem 1.1rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: .92rem;
    color: #555;
    text-decoration: none;
    white-space: nowrap;
    transition: color .35s ease;
}
.hs-yearnav a:hover { color: var(--brand); }
.hs-yearnav a.active { color: #fff; }
.hs-yearnav-pill {
    position: absolute;
    top: .35rem;
    bottom: .35rem;
    left: 0;
    width: 0;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    box-shadow: 0 6px 16px rgba(247, 151, 63, .45);
    transition: transform .5s var(--ease-spring), width .5s var(--ease-spring);
}

/* ---------- Timeline ---------- */
.hs-timeline-section { padding-top: 3rem; }
.hs-item { scroll-margin-top: 180px; }
.hs-timeline { position: relative; padding: 1rem 0; }
.hs-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    margin-left: -2px;
    border-radius: 4px;
    background: #f2e6d8;
}
.hs-line i {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(180deg, #ffc46b, var(--brand), var(--brand-dark));
    transform: scaleY(var(--progress, 0));
    transform-origin: top;
    box-shadow: 0 0 14px rgba(247, 151, 63, .6);
}
.hs-item {
    position: relative;
    width: 50%;
    padding-right: 70px;
    margin-bottom: 4rem;
}
.hs-item:nth-of-type(even) {
    margin-left: 50%;
    padding-right: 0;
    padding-left: 70px;
}
.hs-item:last-child { margin-bottom: 0; }

.hs-node {
    position: absolute;
    top: 40px;
    right: -32px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    color: #c9b8a6;
    background: #fff;
    border: 3px solid #f2e6d8;
    box-shadow: 0 0 0 8px #fff;
    z-index: 2;
    transition: color .5s, background-color .5s, border-color .5s, transform .6s var(--ease-spring), box-shadow .5s;
}
.hs-item:nth-of-type(even) .hs-node { right: auto; left: -32px; }
.hs-item.is-passed .hs-node {
    color: var(--brand);
    border-color: var(--brand);
}
.hs-item.is-active .hs-node {
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    border-color: transparent;
    transform: scale(1.15);
    box-shadow: 0 0 0 8px #fff, 0 0 0 14px rgba(247, 151, 63, .2), 0 12px 30px rgba(247, 151, 63, .45);
}
.hs-item.is-active .hs-node::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid var(--brand);
    animation: ripple 1.8s ease-out infinite;
}

/* Connector from node to card */
.hs-item::before {
    content: '';
    position: absolute;
    top: 71px;
    right: 32px;
    width: 38px;
    height: 2px;
    background: linear-gradient(90deg, var(--brand), transparent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform .6s var(--ease-out) .4s;
}
.hs-item:nth-of-type(odd)::before { background: linear-gradient(270deg, var(--brand), transparent); }
.hs-item:nth-of-type(even)::before { right: auto; left: 32px; transform-origin: left; }
.hs-item.is-in::before { transform: scaleX(1); }

.hs-card {
    position: relative;
    border-radius: 24px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .07);
    border: 1px solid rgba(17, 24, 39, .06);
    opacity: 0;
    transform: translateX(-60px) rotate(-1.5deg);
    transition: opacity .9s var(--ease-out), transform .9s var(--ease-out), box-shadow .5s, border-color .5s;
}
.hs-item:nth-of-type(even) .hs-card { transform: translateX(60px) rotate(1.5deg); }
.hs-item.is-in .hs-card { opacity: 1; transform: none; }
.hs-item.is-active .hs-card {
    border-color: rgba(247, 151, 63, .35);
    box-shadow: 0 30px 60px rgba(247, 151, 63, .18);
}
.hs-card:hover { transform: translateY(-6px) !important; }

.hs-media {
    position: relative;
    height: 240px;
    overflow: hidden;
    clip-path: inset(0 100% 0 0);
    transition: clip-path 1.1s var(--ease-out) .25s;
}
.hs-item:nth-of-type(even) .hs-media { clip-path: inset(0 0 0 100%); }
.hs-item.is-in .hs-media { clip-path: inset(0 0 0 0); }
.hs-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.25);
    transition: transform 1.6s var(--ease-out) .25s;
}
.hs-item.is-in .hs-media img { transform: scale(1); }
.hs-card:hover .hs-media img { transform: scale(1.08); transition-delay: 0s; transition-duration: .8s; }
.hs-media::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, .45));
}
.hs-chapter {
    position: absolute;
    left: 1.2rem;
    bottom: 1rem;
    z-index: 1;
    color: #fff;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .2em;
    text-transform: uppercase;
}

.hs-body { position: relative; padding: 1.8rem 2rem 2rem; overflow: hidden; }
.hs-ghost {
    position: absolute;
    right: 1rem;
    top: -.4rem;
    font-size: 6rem;
    font-weight: 900;
    line-height: 1;
    color: rgba(247, 151, 63, .08);
    pointer-events: none;
    transform: translateY(30px);
    transition: transform 1.2s var(--ease-out) .4s, color .5s;
}
.hs-item.is-in .hs-ghost { transform: none; }
.hs-item.is-active .hs-ghost { color: rgba(247, 151, 63, .14); }
.hs-year {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .3rem .9rem;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff;
    font-weight: 800;
    font-size: .9rem;
    letter-spacing: .05em;
    box-shadow: 0 6px 16px rgba(247, 151, 63, .35);
}
.hs-live {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    animation: livePulse 1.4s ease-in-out infinite;
}
@keyframes livePulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(255, 255, 255, .7); }
    50% { opacity: .6; box-shadow: 0 0 0 6px rgba(255, 255, 255, 0); }
}
.hs-body h3 { font-size: 1.5rem; font-weight: 800; color: var(--ink); margin: .9rem 0 .6rem; }
.hs-body p { color: #666; margin-bottom: 1rem; }
.hs-points { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.hs-points li {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .35rem .8rem;
    border-radius: 10px;
    background: #fff8f0;
    border: 1px solid rgba(247, 151, 63, .18);
    font-size: .85rem;
    font-weight: 600;
    color: #555;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .5s ease, transform .5s var(--ease-out), background-color .3s, color .3s;
}
.hs-points li:nth-child(1) { transition-delay: .7s, .7s, 0s, 0s; }
.hs-points li:nth-child(2) { transition-delay: .85s, .85s, 0s, 0s; }
.hs-item.is-in .hs-points li { opacity: 1; transform: none; }
.hs-points li i { color: var(--brand); }
.hs-points li:hover { background: var(--brand); color: #fff; }
.hs-points li:hover i { color: #fff; }

.hs-item-now .hs-card { border: 2px solid rgba(247, 151, 63, .35); }

@media (max-width: 991.98px) {
    .hs-line { left: 32px; }
    .hs-item,
    .hs-item:nth-of-type(even) {
        width: 100%;
        margin-left: 0;
        padding: 0 0 0 90px;
        margin-bottom: 2.5rem;
    }
    .hs-node,
    .hs-item:nth-of-type(even) .hs-node { left: 0; right: auto; top: 24px; }
    .hs-item::before,
    .hs-item:nth-of-type(even)::before { left: 64px; right: auto; top: 55px; width: 26px; transform-origin: left; background: linear-gradient(90deg, var(--brand), transparent); }
    .hs-card,
    .hs-item:nth-of-type(even) .hs-card { transform: translateX(40px); }
    .hs-media,
    .hs-item:nth-of-type(even) .hs-media { clip-path: inset(0 100% 0 0); height: 200px; }
}
@media (max-width: 575.98px) {
    .hs-line { left: 22px; }
    .hs-item, .hs-item:nth-of-type(even) { padding-left: 62px; }
    .hs-node, .hs-item:nth-of-type(even) .hs-node { width: 46px; height: 46px; font-size: 1.1rem; }
    .hs-item::before, .hs-item:nth-of-type(even)::before { display: none; }
    .hs-body { padding: 1.4rem; }
    .hs-ghost { font-size: 4rem; }
    .hs-yearnav a { padding: .45rem .8rem; font-size: .85rem; }
}

/* ---------- Ambitions ---------- */
.hs-goal {
    position: relative;
    height: 100%;
    padding: 2.2rem 2rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .12);
    overflow: hidden;
    transition: transform .45s var(--ease-spring), background-color .4s, border-color .4s;
}
.hs-goal:hover { transform: translateY(-10px); background: rgba(247, 151, 63, .14); border-color: rgba(247, 151, 63, .5); }
.hs-goal span {
    position: absolute;
    top: .8rem;
    right: 1.4rem;
    font-size: 4rem;
    font-weight: 900;
    line-height: 1;
    color: rgba(255, 255, 255, .06);
}
.hs-goal i {
    display: inline-grid;
    place-items: center;
    width: 60px;
    height: 60px;
    border-radius: 18px;
    font-size: 1.6rem;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    box-shadow: 0 10px 25px rgba(247, 151, 63, .4);
    margin-bottom: 1.2rem;
    transition: transform .5s var(--ease-spring);
}
.hs-goal:hover i { transform: rotate(-12deg) scale(1.1); }
.hs-goal h4 { font-weight: 700; }
.hs-goal p { color: rgba(255, 255, 255, .7); margin: 0; }

@media (prefers-reduced-motion: reduce) {
    .hs-card, .hs-media, .hs-media img, .hs-points li, .hs-ghost {
        opacity: 1 !important;
        transform: none !important;
        clip-path: none !important;
    }
}
