/* Головна сторінка: перший екран, стрічки, маніфест, послуги, кейси, рентген, стек, цифри. */

/* ── Перший екран ── */
.hero { position: relative; overflow: clip; display: flex; align-items: center; min-height: min(860px, calc(100svh - var(--header-h))); }
.wave { position: absolute; inset: 0; width: 100%; height: 100%; -webkit-mask-image: radial-gradient(ellipse at 60% 50%, #000 30%, transparent 80%); mask-image: radial-gradient(ellipse at 60% 50%, #000 30%, transparent 80%); }
/* Без миші canvas не малюємо — статична сітка точок тим самим кроком */
html:not(.fine) .wave { background: radial-gradient(circle, rgba(140, 137, 120, .32) 1.4px, transparent 1.8px) 0 0 / 28px 28px; }
.hero__in { position: relative; display: flex; flex-wrap: wrap; gap: 56px; align-items: center; padding-top: 64px; padding-bottom: 80px; pointer-events: none; }
.hero__text { flex: 1.3 1 600px; min-width: 0; pointer-events: auto; }
.hero__stack { flex: 1 1 400px; min-width: 0; pointer-events: auto; }
.hero__title { font-size: clamp(48px, 7.4vw, 108px); margin-top: 28px; }
.hero__lead { font-size: clamp(17px, 1.5vw, 20px); max-width: 560px; margin-top: 32px; }
.hero .btn-row { margin-top: 36px; }
.hero__hint { font-size: 12px; margin-top: 40px; }
html:not(.fine) .hero__hint { display: none; }

.slot { height: 1.08em; overflow: hidden; color: var(--accent); }
.slot span { display: block; height: 1.08em; line-height: 1.08em; white-space: nowrap; }

/* ── Стопка карток аудиту ── */
.stack { position: relative; height: 448px; perspective: 1200px; touch-action: pan-y; }
.scard { position: absolute; left: 0; right: 40px; top: 40px; height: 360px; border-radius: 26px; border: 1px solid var(--line-2); background: #151512; padding: 24px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .9); transition: transform .8s var(--ease-io), opacity .8s, filter .8s; }
.p0 { transform: none; z-index: 4; opacity: 1; }
.p1 { transform: translate(20px, -20px) scale(.95); z-index: 3; opacity: .65; filter: brightness(.7); }
.p2 { transform: translate(40px, -40px) scale(.9); z-index: 2; opacity: .35; filter: brightness(.5); }
.p3 { transform: translate(-60px, 60px) scale(.9) rotate(-8deg); z-index: 1; opacity: 0; }
.p1, .p2, .p3 { pointer-events: none; }
.scard-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-family: var(--font-mono); font-size: 12px; color: var(--dim); }
.scard-title { font-size: clamp(20px, 2vw, 24px); margin-top: 8px; }
.scard-title.center { font-size: 20px; margin-top: 0; }
.scard-note { font-size: 14px; }
.ring { position: relative; width: 150px; height: 150px; margin: 6px auto; }
.ring .arc { stroke: var(--accent); stroke-dasharray: 327; stroke-dashoffset: var(--arc, 16); }
.motion .p0 .ring .arc { animation: arc 1.6s var(--ease) .3s both; }
.ring-num { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 40px; font-variant-numeric: tabular-nums; }
.vitals { display: flex; flex-direction: column; gap: 16px; margin-top: auto; }
.vit { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; font-family: var(--font-mono); font-size: 12px; color: var(--text-2); }
.vit-t { height: 8px; border-radius: 8px; background: #23231D; overflow: hidden; }
.vit-t i { display: block; height: 100%; border-radius: 8px; background: var(--accent); transform-origin: left; animation: barloop 3s var(--ease) infinite; }
.term { flex: 1; border-radius: 14px; background: var(--bg-deep); border: 1px solid #23231D; padding: 16px; font-family: var(--font-mono); font-size: 13px; line-height: 2; color: var(--text-2); }
.motion .tl { opacity: 0; }
.motion .tl1 { animation: tl1 6s infinite; }
.motion .tl2 { animation: tl2 6s infinite; }
.motion .tl3 { animation: tl3 6s infinite; }
.motion .tl4 { animation: tl4 6s infinite; }
.checks { display: flex; flex-direction: column; gap: 12px; font-size: 15px; margin-top: auto; }
.checks li { display: flex; align-items: center; gap: 12px; }
.checks .ico { color: var(--accent); flex: none; }
.motion .checks .ico path { stroke-dasharray: 24; animation: tick 4s ease var(--d, 0s) infinite; }
/* Точки — під карткою (її низ на 400px), по центру (картка зсунута від правого краю на 40px) */
.dots { position: absolute; left: 0; right: 40px; top: 404px; z-index: 6; display: flex; justify-content: center; }
.dot-btn { width: 44px; height: 44px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; padding: 0; }
.dot-btn span { display: block; width: 10px; height: 10px; border-radius: 999px; background: var(--line-3); transition: width .4s, background-color .3s; }
.dot-btn.on span { width: 28px; background: var(--accent); }

/* ── Стрічки ── */
.tapes { position: relative; height: 240px; overflow: hidden; margin-top: -20px; }
.tape { position: absolute; left: -5%; right: -5%; padding: 20px 0; overflow: hidden; }
.tape.a { top: 56px; background: var(--accent); color: var(--bg); transform: rotate(-3deg); z-index: 2; }
.tape.b { top: 80px; background: var(--card-2); color: #E6E3D8; transform: rotate(2.5deg); border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.tape-track { display: flex; width: max-content; will-change: transform; }
.tape-half { display: flex; gap: 36px; padding-right: 36px; }
.tape-item { display: inline-flex; align-items: center; gap: 36px; font-family: var(--font-display); font-weight: 700; font-size: clamp(20px, 2.6vw, 34px); white-space: nowrap; letter-spacing: -0.02em; }
.tape-item svg { flex: none; animation: spin 5s linear infinite; }

/* ── Маніфест ── */
.statement { font-family: var(--font-display); font-weight: 700; font-size: clamp(26px, 4.4vw, 60px); line-height: 1.15; letter-spacing: -0.03em; margin-top: 32px; max-width: 1180px; }
.sw { transition: color .35s; }
.sw.hl { color: var(--accent); }
.motion .sw:not(.lit) { color: var(--line-2); }

/* ── Послуги: горизонтальна стрічка ── */
.hs { position: relative; padding: 40px 0; }
.hs-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 36px; }
.hs-hint { font-size: 13px; }
.hs-track { display: flex; gap: 24px; padding: 0 var(--gutter); overflow-x: auto; scrollbar-width: none; scroll-snap-type: x mandatory; scroll-padding-left: var(--gutter); overscroll-behavior-x: contain; }
.hs-track::-webkit-scrollbar { display: none; }
.hs-bar { height: 2px; background: var(--line); margin-top: 28px; overflow: hidden; }
.hs-fill { height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); }
/* Блок прилипає, прокручування вниз рухає стрічку (home.js задає висоту секції). Без анімацій — свайп убік */
.hs.is-pinned { padding: 0; }
.hs.is-pinned .hs-sticky { position: sticky; top: var(--header-h); height: calc(100svh - var(--header-h)); overflow: hidden; display: flex; flex-direction: column; justify-content: center; }
.hs.is-pinned .hs-track { overflow: visible; width: max-content; scroll-snap-type: none; will-change: transform; }
.hs.is-pinned .svc { height: min(540px, calc(100svh - var(--header-h) - 250px)); }
.hs.is-pinned .stage { min-height: 120px; }
html .hs.is-pinned .hs-hint .only-fine { display: inline; }
html .hs.is-pinned .hs-hint .only-touch { display: none; }

.svc { flex: none; scroll-snap-align: start; width: min(460px, 82vw); height: 540px; border-radius: 30px; border: 1px solid var(--line); background: var(--card); padding: 28px; display: flex; flex-direction: column; gap: 16px; color: var(--text); transition: border-color .4s, transform .5s var(--ease); }
a.svc:hover { border-color: var(--accent); transform: translateY(-8px); color: var(--text); }
.svc-intro { background: transparent; border-style: dashed; justify-content: flex-end; }
.svc-intro__title { font-size: clamp(24px, 2.4vw, 30px); line-height: 1.15; }
.svc-intro .btn { align-self: flex-start; }
.svc-num { font-family: var(--font-mono); font-size: 13px; color: var(--accent); }
.svc-title { font-size: clamp(20px, 2vw, 24px); }
.svc-text { font-size: 15px; }

/* ── Кейси стопкою ── */
.cstack { display: flex; flex-direction: column; gap: 40px; }
.cs { display: flex; flex-wrap: wrap; gap: 32px; min-height: 520px; border-radius: 34px; border: 1px solid var(--line-2); background: var(--card); padding: clamp(20px, 3vw, 40px); color: var(--text); box-shadow: 0 -30px 60px -30px rgba(0, 0, 0, .8); transform-origin: 50% 0; will-change: transform; }
a.cs:hover { color: var(--text); }
.cs-info { flex: 1 1 300px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.cs-meta { font-size: 13px; }
.cs-name { font-size: clamp(36px, 6vw, 84px); color: var(--c); overflow-wrap: anywhere; }
.cs-text { max-width: 380px; }
.cs .shot { flex: 1.5 1 440px; min-width: 0; }
.cs-arrow { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--bg); transition: transform .5s var(--ease); margin-top: auto; }
.cs:hover .cs-arrow { transform: rotate(-45deg) scale(1.1); }
@media (min-width: 900px) {
    .cs { position: sticky; top: calc(var(--header-h) + 24px + var(--i) * 26px); }
}

/* ── Рентген сторінки ── */
.xray { position: relative; padding: clamp(64px, 10vw, 140px) 0; }
.xray__in { display: flex; flex-wrap: wrap; gap: 48px; align-items: center; }
.xray__text { flex: 1 1 380px; min-width: 0; }
.xray-tabs { display: flex; flex-direction: column; margin-top: 36px; border-top: 1px solid var(--line); }
.xray-tab { display: grid; grid-template-columns: 36px 1fr; gap: 0 12px; align-items: baseline; text-align: left; padding: 18px 0; background: none; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; min-height: 44px; }
.xray-tab__n { font-size: 12px; color: var(--dim); transition: color .3s; }
.xray-tab__name { font-family: var(--font-display); font-weight: 600; font-size: clamp(19px, 2vw, 24px); letter-spacing: -0.01em; color: var(--dim); transition: color .3s; }
.xray-tab__desc { grid-column: 2; font-size: 15px; display: grid; grid-template-rows: 0fr; transition: grid-template-rows .5s var(--ease), margin .5s var(--ease); overflow: hidden; }
.xray-tab__desc::before { content: ''; }
.xray-tab__desc { max-height: 0; opacity: 0; transition: max-height .5s var(--ease), opacity .4s, margin .5s var(--ease); }
.xray-tab.on .xray-tab__desc { max-height: 160px; opacity: 1; margin-top: 8px; }
.xray-tab.on .xray-tab__name { color: var(--text); }
.xray-tab.on .xray-tab__n, .xray-tab:hover .xray-tab__name { color: var(--accent); }

.xray-stage { --lc: var(--accent); flex: 1.2 1 440px; min-width: 0; border-radius: 26px; border: 1px solid var(--line-2); background: var(--card); overflow: hidden; }
.xray-stage[data-layer="a11y"] { --lc: #8FA8FF; }
.xray-stage[data-layer="perf"] { --lc: #FF8A3D; }
.xray-stage[data-layer="seo"] { --lc: #4FD1C5; }
.xr-bar { display: flex; align-items: center; gap: 7px; padding: 14px 18px; border-bottom: 1px solid var(--line); color: var(--dim); font-size: 12px; }
.xr-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-3); }
.xr-bar span { margin-left: 12px; }
.xr-page { padding: clamp(14px, 2vw, 22px); display: flex; flex-direction: column; gap: 14px; }
.xr-el { position: relative; border-radius: 12px; outline: 1.5px dashed color-mix(in srgb, var(--lc) 70%, transparent); outline-offset: 3px; transition: outline-color .5s; }
.xr-header { display: flex; align-items: center; gap: 10px; padding: 12px; background: var(--card-2); }
.xr-header b { width: 44px; height: 12px; border-radius: 6px; background: var(--text-2); margin-right: auto; }
.xr-header span { width: 34px; height: 8px; border-radius: 4px; background: var(--line-3); }
.xr-hero { padding: 26px 18px 22px; background: var(--card-2); display: flex; flex-direction: column; gap: 12px; min-height: 150px; justify-content: flex-end; }
.xr-el u { display: block; height: 16px; width: 72%; border-radius: 8px; background: var(--text-2); text-decoration: none; }
.xr-el u.s { height: 8px; width: 48%; background: var(--line-3); }
.xr-hero s { display: block; width: 96px; height: 28px; border-radius: 999px; background: var(--lc); transition: background-color .5s; }
.xr-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.xr-card { padding: 10px; background: var(--card-2); display: flex; flex-direction: column; gap: 8px; }
.xr-card i { display: block; height: 64px; border-radius: 8px; background: #2A2A23; }
.xr-card u { height: 8px; width: 80%; }
.xr-footer { display: flex; gap: 10px; padding: 14px 12px; background: var(--card-2); }
.xr-footer span { width: 60px; height: 8px; border-radius: 4px; background: var(--line-3); }
.xr-tag { position: absolute; right: 8px; top: 8px; max-width: calc(100% - 16px); padding: 3px 8px; border-radius: 6px; background: var(--lc); color: var(--bg); font-family: var(--font-mono); font-size: 11px; font-style: normal; font-weight: 500; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transform: translateY(8px) scale(.94); transition: opacity .35s, transform .5s var(--ease); }
.xr-header .xr-tag { top: 50%; margin-top: -11px; right: auto; left: 64px; }
.xr-row .xr-el:nth-child(2) .xr-tag { transition-delay: .06s; }
.xr-row .xr-el:nth-child(3) .xr-tag { transition-delay: .12s; }
.xr-footer .xr-tag { transition-delay: .18s; }
[data-layer="sem"] .l-sem, [data-layer="a11y"] .l-a11y, [data-layer="perf"] .l-perf, [data-layer="seo"] .l-seo { opacity: 1; transform: none; }
/* Десктоп: секція висока, вміст прилипає — шар змінюється прокручуванням (home.js) */
.xray.is-pinned { padding: 0; height: 320vh; }
.xray.is-pinned .xray-sticky { position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); display: flex; align-items: center; }

/* ── Стек ── */
.section--stack { padding-top: clamp(40px, 6vw, 80px); }
.tech-wrap { display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; margin-top: 36px; }
.tech-words { flex: 2 1 560px; min-width: 0; display: flex; flex-wrap: wrap; gap: 4px 20px; font-family: var(--font-display); font-weight: 700; font-size: clamp(26px, 4vw, 54px); letter-spacing: -0.03em; line-height: 1.15; }
.tw { background: none; border: 0; padding: 0; min-height: 44px; font: inherit; letter-spacing: inherit; color: var(--line-3); cursor: pointer; transition: color .3s, transform .4s cubic-bezier(.3, 1.6, .5, 1); }
.tw:hover { color: var(--text); }
.tw.on { color: var(--accent); transform: translateY(-4px); }
.tech-panel { flex: 1 1 320px; min-width: 0; border-radius: 28px; border: 1px solid var(--line-2); background: var(--card); padding: 32px; min-height: 260px; display: flex; flex-direction: column; gap: 14px; }
.panel-in { display: flex; flex-direction: column; gap: 14px; }
.panel-in .chip { align-self: flex-start; }
.panel-in.flip { animation: panel .5s var(--ease) both; }
.tech-name { font-size: clamp(24px, 2.4vw, 30px); }
.tech-note { margin-top: auto; padding-top: 12px; font-size: 12px; }

/* ── Цифри ── */
.section--nums { padding-top: 0; }
.nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); border-top: 1px solid var(--line); }
.num { padding: 36px 24px 36px 0; border-bottom: 1px solid var(--line); }
.cnt { font-family: var(--font-display); font-weight: 800; font-size: clamp(52px, 7vw, 96px); letter-spacing: -0.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.num-label { margin-top: 10px; }

@keyframes arc { from { stroke-dashoffset: 327; } }
@keyframes barloop { 0% { transform: scaleX(0); } 50%, 100% { transform: scaleX(1); } }
@keyframes tl1 { 0%, 5% { opacity: 0; transform: translateX(-8px); } 10%, 90% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes tl2 { 0%, 22% { opacity: 0; transform: translateX(-8px); } 27%, 90% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes tl3 { 0%, 40% { opacity: 0; transform: translateX(-8px); } 45%, 90% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes tl4 { 0%, 58% { opacity: 0; transform: translateX(-8px); } 63%, 90% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes tick { 0%, 10% { stroke-dashoffset: 24; } 30%, 90% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 24; } }
@keyframes panel { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

@media (max-width: 900px) {
    .hero { min-height: 0; }
    .hero__in { padding-top: 40px; padding-bottom: 56px; gap: 40px; }
    .hero__title { font-size: clamp(40px, 12.5vw, 96px); }
    .svc { height: 500px; }
    .cs { min-height: 0; }
    .cs-arrow { width: 52px; height: 52px; }
    .xr-tag { font-size: 10px; }
}

@media (max-width: 720px) {
    .scard { right: 24px; }
    .dots { right: 24px; }
    .tapes { height: 190px; }
    .tape { padding: 14px 0; }
    .tape.a { top: 44px; }
    .tape.b { top: 64px; }
    .tech-panel { padding: 24px; min-height: 0; }
    .num { padding: 28px 16px 28px 0; }
    .nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
