/* «Арна тарихы» page. Dark hero, stats, a centred timeline of eras, wins and a closing call. */
/* the page is dark in both themes; clip-path keeps the fixed film layer inside the page (it never covers the footer) */
.hx { position: relative; isolation: isolate; overflow-x: clip; clip-path: inset(0); background: #120d08; }
.hx > :not(.hx-film):not(.hx-progress) { position: relative; z-index: 1; }

/* archive photos of the Zhezkazgan studio crossfading behind the page like an old sepia film */
.hx-film { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; background: #120d08; }
.hx-film i { position: absolute; inset: -3%; background: center / cover no-repeat; opacity: 0; transition: opacity 2.6s ease; filter: sepia(.9) saturate(1.15) contrast(1.08) brightness(.48); will-change: opacity, transform; }
.hx-film i.on { opacity: 1; }
.hx-film i.kb { animation: hx-kb 18s linear both; }
.hx-film i:nth-child(2).kb { animation-name: hx-kb2; }
@keyframes hx-kb { from { transform: scale(1.12) translate(1.5%, 1%); } to { transform: scale(1) translate(0, 0); } }
@keyframes hx-kb2 { from { transform: scale(1) translate(0, 0); } to { transform: scale(1.12) translate(-1.5%, -1%); } }
/* grain */
.hx-film::before { content: ""; position: absolute; inset: -50%; z-index: 2; opacity: .22; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: hx-grain .9s steps(6) infinite; }
/* vignette, scratches and a faint projector flicker */
.hx-film::after { content: ""; position: absolute; inset: 0; z-index: 3;
  background:
    linear-gradient(90deg, transparent 23.6%, rgba(255,240,210,.07) 23.7%, transparent 23.85%, transparent 71%, rgba(255,240,210,.05) 71.08%, transparent 71.2%),
    radial-gradient(ellipse at center, transparent 45%, rgba(10,6,2,.85) 100%),
    linear-gradient(180deg, rgba(18,13,8,.35), rgba(18,13,8,.6));
  animation: hx-flicker 5s steps(1) infinite, hx-scratch 7s linear infinite; }
@keyframes hx-grain { 0% { transform: translate(0, 0); } 20% { transform: translate(-6%, 4%); } 40% { transform: translate(5%, -7%); } 60% { transform: translate(-4%, -3%); } 80% { transform: translate(7%, 5%); } 100% { transform: translate(-2%, 6%); } }
@keyframes hx-flicker { 0%, 100% { opacity: 1; } 31% { opacity: .9; } 32% { opacity: 1; } 67% { opacity: .93; } 68% { opacity: 1; } }
@keyframes hx-scratch { 0%, 100% { background-position: 0 0, 0 0, 0 0; } 50% { background-position: 4vw 0, 0 0, 0 0; } }
.hx-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; pointer-events: none; }
.hx-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--gold)); }

/* hero */
.hx-hero { position: relative; overflow: hidden; min-height: min(86vh, 820px); display: flex; align-items: flex-end; }
.hx-hero::before { content: ""; position: absolute; inset: 0; background:
  radial-gradient(60% 70% at 78% 30%, rgba(255,75,62,.22), transparent 70%),
  repeating-linear-gradient(0deg, rgba(255,255,255,.03) 0 1px, transparent 1px 4px);
  animation: hx-glow 14s ease-in-out infinite alternate; }
.hx-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(12,8,4,.75), rgba(12,8,4,.15) 70%), linear-gradient(0deg, rgba(12,8,4,.7), transparent 45%); }
.hx-hero__in, .hx-stat, .hx-h2, .hx-final__q, .hx-final__s { text-shadow: 0 2px 18px rgba(0,0,0,.6); }
/* the gradient title is clipped text: a text-shadow would show through it, so it gets a drop-shadow instead */
.hx-hero h1 { text-shadow: none; filter: drop-shadow(0 3px 16px rgba(0,0,0,.55)); }
.hx-hero__bg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-end; pointer-events: none; }
.hx-hero__bg span { font-size: clamp(160px, 30vw, 460px); font-weight: 900; line-height: .8; letter-spacing: -.04em; color: transparent; -webkit-text-stroke: 2px rgba(255,255,255,.1); margin-right: -2vw; transform: translateY(var(--hx-shift, 0)); }
.hx-hero__in { position: relative; z-index: 1; padding-top: 120px; padding-bottom: 72px; display: flex; flex-direction: column; gap: 18px; }
.hx-hero h1 { font-size: clamp(48px, 9vw, 128px); line-height: .95; letter-spacing: -.03em; background: linear-gradient(180deg, #fff 30%, #ffb3ab); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hx-hero__lead { max-width: 680px; font-size: clamp(17px, 1.6vw, 21px); color: var(--text2); line-height: 1.6; }
.hx-hero__down { align-self: flex-start; margin-top: 10px; display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: #fff; padding: 12px 20px; border-radius: 999px; border: 1px solid rgba(255,255,255,.2); }
.hx-hero__down .ico { transform: rotate(90deg); transition: transform .2s; }
.hx-hero__down:hover { color: #fff; border-color: var(--accent); }
.hx-hero__down:hover .ico { transform: rotate(90deg) translateX(3px); }
@keyframes hx-glow { from { transform: scale(1); } to { transform: scale(1.12) translateX(-2%); } }

/* stats */
.hx-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin-top: -1px; padding-top: 56px; padding-bottom: 24px; }
.hx-stat { padding: 26px 22px; border-left: 2px solid var(--accent); display: flex; flex-direction: column; gap: 6px; }
.hx-stat b { font-size: clamp(30px, 3.6vw, 52px); font-weight: 900; line-height: 1; letter-spacing: -.02em; }
.hx-stat span { color: var(--muted); font-size: 14px; }

/* timeline */
.hx-tl { position: relative; padding-top: 56px; padding-bottom: 56px; display: flex; flex-direction: column; gap: 40px; }
.hx-tl::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; transform: translateX(-1px); background: linear-gradient(180deg, transparent, var(--accent) 8%, var(--accent) 92%, transparent); opacity: .5; }
.hx-era { position: relative; width: calc(50% - 48px); padding: 30px 32px; border-radius: 14px; background: rgba(16,13,10,.78); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border: 1px solid rgba(255,230,190,.1); display: flex; flex-direction: column; gap: 14px; }
.hx-era:nth-child(odd) { align-self: flex-start; }
.hx-era:nth-child(even) { align-self: flex-end; }
.hx-era::before { content: ""; position: absolute; top: 40px; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 6px var(--accent-soft), 0 0 24px rgba(255,75,62,.6); }
.hx-era:nth-child(odd)::before { right: -57px; }
.hx-era:nth-child(even)::before { left: -57px; }
.hx-era__y { font-size: clamp(36px, 4.4vw, 64px); font-weight: 900; line-height: 1; letter-spacing: -.03em; color: var(--accent-ink); }
.hx-era h2 { font-size: clamp(22px, 2.2vw, 30px); }
.hx-era p { color: var(--text2); line-height: 1.75; }
.hx-era p b { color: var(--text); }
.hx-era__list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; }
.hx-era__list li { display: flex; gap: 14px; padding: 10px 14px; border-radius: 8px; background: var(--panel2); color: var(--text2); }
.hx-era__list b { color: var(--text); min-width: 92px; font-variant-numeric: tabular-nums; }
.hx-era--dark { background: linear-gradient(160deg, #1a0f10, #0d0e12); border-color: rgba(255,75,62,.25); --text: #f2f3f5; --text2: #c9cdd4; color: var(--text); }
.hx-era--accent { background: linear-gradient(150deg, var(--accent), #b3241b); border-color: transparent; --text: #fff; --text2: rgba(255,255,255,.9); --accent-ink: #fff; color: #fff; }
.hx-era--now { background: linear-gradient(150deg, #10151c, #0b0c10); border-color: rgba(46,196,214,.35); --text: #f2f3f5; --text2: #c9cdd4; --accent-ink: var(--teal); color: var(--text); }
.hx-era--now::before { background: #2ec4d6; box-shadow: 0 0 0 6px rgba(46,196,214,.18), 0 0 24px rgba(46,196,214,.7); animation: pulse 1.8s ease-out infinite; }

/* wins */
.hx-wins { background: radial-gradient(70% 90% at 50% 0%, rgba(255,75,62,.16), transparent 70%), rgba(10,7,4,.55); padding: 88px 0; }
.hx-h2 { font-size: clamp(30px, 4vw, 54px); margin: 12px 0 36px; letter-spacing: -.02em; }
.hx-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.hx-card { padding: 28px; border-radius: 14px; background: rgba(16,13,10,.7); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.09); display: flex; flex-direction: column; gap: 12px; transition: transform .25s, border-color .25s; }
.hx-card:hover { transform: translateY(-4px); border-color: rgba(255,75,62,.5); }
.hx-card b { font-size: 40px; font-weight: 900; line-height: 1; color: var(--gold); }
.hx-card h3 { font-size: 21px; }
.hx-card p { color: var(--text2); line-height: 1.7; }

/* final */
.hx-final { position: relative; overflow: hidden; background: rgba(10,7,4,.45); padding: 110px 0; text-align: center; }
.hx-credit { margin-top: 18px; font-size: 13px; color: var(--muted); }
.hx-credit a { text-decoration: underline; text-underline-offset: 3px; }
.hx-final::before { content: ""; position: absolute; inset: 0; background: radial-gradient(50% 80% at 50% 100%, rgba(255,75,62,.35), transparent 70%); }
.hx-final__in { position: relative; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.hx-final__q { font-size: clamp(40px, 7vw, 96px); font-weight: 900; line-height: 1; letter-spacing: -.03em; }
.hx-final__s { color: var(--text2); font-size: 18px; max-width: 560px; }
.hx-final__btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 8px; }

/* reveal on scroll (site.js adds .hx-js; without JS everything stays visible) */
.hx-js [data-reveal] { opacity: 0; transform: translateY(32px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
.hx-js [data-reveal].in { opacity: 1; transform: none; }

@media (max-width: 980px) {
  .hx-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 0; }
  .hx-cards { grid-template-columns: minmax(0, 1fr); }
  .hx-tl::before { left: 9px; }
  .hx-era, .hx-era:nth-child(odd), .hx-era:nth-child(even) { width: auto; align-self: stretch; margin-left: 38px; }
  .hx-era:nth-child(odd)::before, .hx-era:nth-child(even)::before { left: -37px; right: auto; }
}
@media (max-width: 760px) {
  .hx-hero { min-height: 620px; }
  .hx-hero__in { padding-top: 80px; padding-bottom: 48px; }
  .hx-hero__bg { align-items: flex-start; padding-top: 40px; }
  .hx-era { padding: 22px 20px; }
  .hx-stat { padding: 18px 14px; }
  .hx-wins, .hx-final { padding: 64px 0; }
  .hx-final__btns { width: 100%; }
  .hx-final__btns .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .hx-hero::before, .hx-era--now::before, .hx-film::before, .hx-film::after, .hx-film i.kb { animation: none; }
  .hx-js [data-reveal] { opacity: 1; transform: none; transition: none; }
}
