/* Homepage opening: the hero keeps its normal layout and scrolls freely.
   The star arrives once, on a timer, when the page loads. Nothing is pinned
   to the scroll. */

.hm-green { fill: var(--star-green); }
.hm-red { fill: var(--star-red); }
.hm-yellow { fill: var(--star-yellow); }
.hm-blue { fill: var(--star-blue); }
.hm-white { fill: #F7F4EE; }

.hm-pin {
 position: relative;
 width: 100%;
 min-height: min(92vh, 900px);
 display: flex;
 align-items: center;
 justify-content: center;
}

.hm-emblem {
 display: block;
 width: clamp(92px, 13vw, 148px);
 height: auto;
 margin: 0 auto 1.3rem;
 overflow: visible;
 filter: drop-shadow(0 8px 26px rgba(0, 0, 0, 0.5));
}
.hm-emblem polygon {
 transform-box: view-box;
 transform-origin: 0 0;
}

@media (prefers-reduced-motion: no-preference) {
 .hm-emblem polygon {
  animation: hm-arrive 1100ms cubic-bezier(0.16, 0.84, 0.24, 1) both;
  will-change: transform, opacity;
 }
 .hm-emblem polygon:nth-child(1) { --hm-x: 0px; --hm-y: -130px; animation-delay: 150ms; }
 .hm-emblem polygon:nth-child(2) { --hm-x: 130px; --hm-y: -45px; animation-delay: 260ms; }
 .hm-emblem polygon:nth-child(3) { --hm-x: 85px; --hm-y: 115px; animation-delay: 370ms; }
 .hm-emblem polygon:nth-child(4) { --hm-x: -85px; --hm-y: 115px; animation-delay: 480ms; }
 .hm-emblem polygon:nth-child(5) { --hm-x: -130px; --hm-y: -45px; animation-delay: 590ms; }
 .hm-emblem { animation: hm-breathe 6s ease-in-out 2s infinite; }
}
html.a11y-no-anim .hm-emblem,
html.a11y-no-anim .hm-emblem polygon { animation: none !important; }

@keyframes hm-arrive {
 from { opacity: 0; transform: translate(var(--hm-x), var(--hm-y)) rotate(40deg) scale(0.6); }
 to { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(1); }
}
@keyframes hm-breathe {
 0%, 100% { filter: drop-shadow(0 8px 26px rgba(0, 0, 0, 0.5)); }
 50% { filter: drop-shadow(0 0 30px rgba(247, 244, 238, 0.42)); }
}

/* ---- Siege day count: an ordinary section; the number counts up once ---- */
.hm-siege {
 padding: clamp(90px, 16vh, 170px) 1.5rem;
 background: #05070C;
 color: #F7F4EE;
 text-align: center;
}
.hm-siege__pin {
 display: flex;
 flex-direction: column;
 align-items: center;
}
.hm-siege__label {
 margin: 0;
 font-family: var(--font-head);
 font-size: clamp(1rem, 2.6vw, 1.5rem);
 font-weight: 700;
 letter-spacing: 0.12em;
 color: #E5484D;
}
.hm-siege__num {
 margin: 0;
 font-family: var(--font-head);
 font-size: clamp(7rem, 34vw, 23rem);
 font-weight: 900;
 line-height: 0.95;
 letter-spacing: -0.04em;
 font-variant-numeric: tabular-nums;
 direction: ltr;
 color: #fff;
}
.hm-siege__rule {
 display: block;
 width: min(420px, 70vw);
 height: 3px;
 margin: 0.6rem 0 1.4rem;
 background: #C92828;
 transform: scaleX(0);
 transition: transform 900ms cubic-bezier(0.16, 0.84, 0.24, 1) 700ms;
}
.hm-siege__text {
 margin: 0;
 font-family: var(--font-head);
 font-size: clamp(1.35rem, 4.4vw, 2.7rem);
 font-weight: 800;
 line-height: 1.3;
 opacity: 0;
 transform: translateY(18px);
 transition: opacity 800ms ease 900ms, transform 800ms cubic-bezier(0.16, 0.84, 0.24, 1) 900ms;
}
.hm-siege.is-in .hm-siege__rule { transform: scaleX(1); }
.hm-siege.is-in .hm-siege__text { opacity: 1; transform: none; }
html:not(.hm-js) .hm-siege__rule { transform: scaleX(1); }
html:not(.hm-js) .hm-siege__text { opacity: 1; transform: none; }
.hm-siege__tag {
 display: block;
 margin-top: 0.9rem;
 font-size: clamp(0.85rem, 2vw, 1.05rem);
 font-weight: 600;
 letter-spacing: 0.04em;
 color: rgba(247, 244, 238, 0.6);
 direction: ltr;
}

/* ---- Thread running down the page ---- */
.hm-thread,
.hm-thread-end { display: none; }

html.hm-js .hm-thread {
 display: block;
 position: absolute;
 left: 0;
 width: 100%;
 z-index: 1;
 pointer-events: none;
 overflow: visible;
}
.hm-thread__line {
 fill: none;
 stroke-width: 1.6;
 stroke-linecap: round;
}
.hm-s-green { stroke: var(--star-green); }
.hm-s-red { stroke: var(--star-red); }
.hm-s-yellow { stroke: var(--star-yellow); }
.hm-s-blue { stroke: var(--star-blue); }
.hm-s-white { stroke: #B9B3A6; }
html.theme-dark .hm-s-white { stroke: #F7F4EE; }

.hm-thread circle {
 stroke: var(--bg);
 stroke-width: 2;
 transform-box: fill-box;
 transform-origin: center;
 transform: scale(0);
 transition: transform 450ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.hm-thread circle.is-on { transform: scale(1); }
.hm-thread circle.hm-white { fill: #B9B3A6; }
html.theme-dark .hm-thread circle.hm-white { fill: #F7F4EE; }

html.hm-js .hm-thread-end {
 display: block;
 position: relative;
 z-index: 2;
 height: 216px;
}
.hm-thread-star {
 position: absolute;
 bottom: 36px;
 left: 50%;
 width: 60px;
 height: 60px;
 margin: 0 0 0 -30px;
 opacity: 0;
 transform: scale(0.3) rotate(-50deg);
 transition: opacity 500ms ease, transform 800ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.hm-thread-star polygon {
 stroke: rgba(11, 18, 32, 0.22);
 stroke-width: 1.5;
 stroke-linejoin: round;
}
.hm-thread-end.is-on .hm-thread-star {
 opacity: 1;
 transform: none;
}

.hm-thread--dark .hm-s-white { stroke: #F7F4EE; }
.hm-thread--dark circle { stroke: #070B14; }
.hm-thread--dark circle.hm-white { fill: #F7F4EE; }
main.hm-home .hm-thread-star polygon { stroke: none; }

.hm-thread--dark .hm-s-white { stroke: #F7F4EE; }
.hm-thread--dark circle { stroke: #070B14; }
.hm-thread--dark circle.hm-white { fill: #F7F4EE; }
main.hm-home .hm-thread-star polygon { stroke: none; }
