/* ============================================================
   tikva-anim.css — Animation layer for infra/tikva/index.html
   ============================================================ */

/* ── Keyframes ─────────────────────────────────────────────── */
@keyframes tk-rise {
  from { opacity:0; transform:translateY(30px); }
  to   { opacity:1; transform:none; }
}
@keyframes tk-from-left {
  from { opacity:0; transform:translateX(-48px) translateY(10px); }
  to   { opacity:1; transform:none; }
}
@keyframes tk-from-right {
  from { opacity:0; transform:translateX(48px) translateY(10px); }
  to   { opacity:1; transform:none; }
}
@keyframes tk-pop {
  from { opacity:0; transform:scale(.88) translateY(20px); }
  to   { opacity:1; transform:none; }
}
@keyframes tk-clip-up {
  from { clip-path:inset(0 0 110% 0); opacity:0; }
  to   { clip-path:inset(0 0 0 0);    opacity:1; }
}

/* ── Neutralize the existing inline reveal system ───────────
   Container .reveal elements become visible instantly; their
   children are gated and animated individually below.         */
.js-tk .sec-head.reveal,        .js-tk .sec-head.reveal.in,
.js-tk .spec-grid.reveal,       .js-tk .spec-grid.reveal.in,
.js-tk .headline.reveal,        .js-tk .headline.reveal.in,
.js-tk .svc-grid.reveal,        .js-tk .svc-grid.reveal.in,
.js-tk .ila-flow.reveal,        .js-tk .ila-flow.reveal.in,
.js-tk .duct-feature.reveal,    .js-tk .duct-feature.reveal.in,
.js-tk .route-progress.reveal,  .js-tk .route-progress.reveal.in {
  opacity: 1;
  transform: none;
  transition: none;
}

/* ── CSS gate ───────────────────────────────────────────────── */
/* Hero */
.js-tk .hero h1 .gw         { display:inline-block; opacity:0; }
.js-tk .hero .hero-sub      { opacity:0; }
.js-tk .hero-stat           { opacity:0; }
.js-tk .hero .hero-cta-row  { opacity:0; }
.js-tk .final-cta .hero-cta-row { opacity:0; }

/* Section heads */
.js-tk .sec-head .marker    { opacity:0; }
.js-tk .sec-head h2         { opacity:0; }
.js-tk .sec-head .lead      { opacity:0; }

/* Spec grids */
.js-tk .spec-image          { opacity:0; }
.js-tk .spec-row            { opacity:0; }
.js-tk .duct-feature .feature-image { opacity:0; }
.js-tk .duct-feature .duct-big      { opacity:0; }

/* Headline cells */
.js-tk .headline-cell       { opacity:0; }

/* Service cards */
.js-tk .svc-card            { opacity:0; }

/* ILA flow */
.js-tk .ila-head            { opacity:0; }
.js-tk .ila-item            { opacity:0; }
.js-tk .ila-foot            { opacity:0; }

/* Route progress */
.js-tk .rp-main             { opacity:0; }
.js-tk .rp-bar              { opacity:0; }
.js-tk .rp-stats            { opacity:0; }

/* Final CTA */
.js-tk .final-cta .marker   { opacity:0; }
.js-tk .final-cta h2        { opacity:0; }
.js-tk .final-cta .lead     { opacity:0; }
.js-tk .tikva-form-wrap     { opacity:0; }

/* ── Hero animations (on load) ──────────────────────────────── */
.js-tk .hero h1.tk-in .gw {
  animation: tk-clip-up .6s cubic-bezier(.16,1,.3,1) both;
}
.js-tk .hero .hero-sub.tk-in {
  animation: tk-rise .7s cubic-bezier(.16,1,.3,1) both;
}
.js-tk .hero-stat.tk-in {
  animation: tk-pop .55s cubic-bezier(.16,1,.3,1) both;
}
.js-tk .hero .hero-cta-row.tk-in,
.js-tk .final-cta .hero-cta-row.tk-in {
  animation: tk-rise .6s cubic-bezier(.16,1,.3,1) both;
}

/* ── Section heads ──────────────────────────────────────────── */
.js-tk .sec-head .marker.tk-in {
  animation: tk-from-left .52s cubic-bezier(.16,1,.3,1) both;
}
.js-tk .sec-head h2.tk-in {
  animation: tk-rise .65s cubic-bezier(.16,1,.3,1) both;
}
.js-tk .sec-head .lead.tk-in {
  animation: tk-rise .6s cubic-bezier(.16,1,.3,1) both;
}

/* ── Spec grid — image ──────────────────────────────────────── */
/* Default: image from left (ILA, Trench) */
.js-tk .spec-image.tk-in {
  animation: tk-from-left .72s cubic-bezier(.16,1,.3,1) both;
}
/* Override: image from right (ODF, Cable) */
.js-tk .spec-image.tk-right.tk-in {
  animation: tk-from-right .72s cubic-bezier(.16,1,.3,1) both;
}

/* ── Spec rows ──────────────────────────────────────────────── */
/* Default: rows from right */
.js-tk .spec-row.tk-in {
  animation: tk-from-right .5s cubic-bezier(.16,1,.3,1) both;
}
/* Override: rows from left (ODF, Cable — image is on the right) */
.js-tk .spec-row.tk-left.tk-in {
  animation: tk-from-left .5s cubic-bezier(.16,1,.3,1) both;
}

/* ── Duct feature ────────────────────────────────────────────── */
.js-tk .duct-feature .feature-image.tk-in {
  animation: tk-from-left .72s cubic-bezier(.16,1,.3,1) both;
}
.js-tk .duct-feature .duct-big.tk-in {
  animation: tk-rise .65s cubic-bezier(.16,1,.3,1) both;
}

/* ── Headline cells ─────────────────────────────────────────── */
.js-tk .headline-cell.tk-in {
  animation: tk-pop .52s cubic-bezier(.16,1,.3,1) both;
}

/* ── Service cards ──────────────────────────────────────────── */
.js-tk .svc-card.tk-in {
  animation: tk-pop .55s cubic-bezier(.16,1,.3,1) both;
}

/* ── ILA flow ───────────────────────────────────────────────── */
.js-tk .ila-head.tk-in {
  animation: tk-rise .6s cubic-bezier(.16,1,.3,1) both;
}
.js-tk .ila-item.tk-in {
  animation: tk-from-left .38s cubic-bezier(.16,1,.3,1) both;
}
.js-tk .ila-foot.tk-in {
  animation: tk-rise .5s cubic-bezier(.16,1,.3,1) both;
}

/* ── Route progress ─────────────────────────────────────────── */
.js-tk .rp-main.tk-in {
  animation: tk-rise .7s cubic-bezier(.16,1,.3,1) both;
}
.js-tk .rp-bar.tk-in {
  animation: tk-rise .55s cubic-bezier(.16,1,.3,1) both;
}
.js-tk .rp-stats.tk-in {
  animation: tk-rise .6s cubic-bezier(.16,1,.3,1) both;
}

/* ── Final CTA ──────────────────────────────────────────────── */
.js-tk .final-cta .marker.tk-in {
  animation: tk-from-left .52s cubic-bezier(.16,1,.3,1) both;
}
.js-tk .final-cta h2.tk-in {
  animation: tk-rise .65s cubic-bezier(.16,1,.3,1) both;
}
.js-tk .final-cta .lead.tk-in {
  animation: tk-rise .6s cubic-bezier(.16,1,.3,1) both;
}
.js-tk .tikva-form-wrap.tk-in {
  animation: tk-rise .7s cubic-bezier(.16,1,.3,1) both;
}

/* ── Instant-show on scroll-up ──────────────────────────────── */
.js-tk .tk-snap,
.js-tk .tk-snap * {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}

/* ── Form drawer ─────────────────────────────────────────────── */

.cy-form-btn {
  position: fixed; bottom: 32px; right: 32px;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 22px;
  background: var(--c3-cyan, #00c8e0);
  color: #060d1f; border: none; border-radius: 50px;
  font-family: var(--font-sans); font-size: 13.5px; font-weight: 700;
  letter-spacing: .01em; cursor: pointer; white-space: nowrap;
  box-shadow: 0 8px 28px rgba(0,200,224,.32);
  z-index: 200;
  transition: transform .18s ease, box-shadow .18s ease;
}
.cy-form-btn:hover {
  transform: scale(1.04) translateY(-2px);
  box-shadow: 0 14px 40px rgba(0,200,224,.48);
}
.cy-form-btn svg { width:15px; height:15px; flex-shrink:0; }

.cy-overlay {
  position: fixed; inset: 0;
  background: rgba(4,9,22,.72);
  opacity: 0; pointer-events: none;
  transition: opacity .3s ease;
  z-index: 400;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.cy-overlay.cy-open { opacity:1; pointer-events:all; }

.cy-drawer {
  position: fixed; top: 16px; right: 16px; bottom: 16px;
  width: 440px; max-width: calc(100vw - 32px);
  background: var(--bg-base, #060d1f);
  border: 1px solid rgba(204,231,255,.12);
  border-radius: 20px;
  display: flex; flex-direction: column;
  transform: translateX(calc(100% + 32px));
  transition: transform .34s cubic-bezier(.2,0,0,1);
  z-index: 401;
  overflow: hidden;
}
.cy-drawer.cy-open { transform: translateX(0); }

.cy-drawer-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; padding: 28px 28px 22px;
  border-bottom: 1px solid rgba(204,231,255,.08);
  flex-shrink: 0;
}
.cy-drawer-label {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--c3-cyan, #00c8e0); opacity:.9;
  display: block; margin-bottom: 5px;
}
.cy-drawer-h {
  font-family: var(--font-sans); font-size: 22px; font-weight: 800;
  letter-spacing: -.035em; color: #fff; margin: 0; line-height: 1.1;
}
.cy-drawer-sub {
  font-family: var(--font-body); font-size: 13.5px;
  color: rgba(204,231,255,.55); margin: 6px 0 0; line-height: 1.45;
}
.cy-drawer-close {
  width: 36px; height: 36px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.07); border: none; border-radius: 10px;
  color: rgba(204,231,255,.65); cursor: pointer; font-size: 16px;
  transition: background .15s, color .15s;
}
.cy-drawer-close:hover { background: rgba(255,255,255,.14); color:#fff; }

.cy-drawer-body {
  flex: 1; overflow-y: auto; padding: 28px 28px 48px;
  scrollbar-width: thin;
  scrollbar-color: rgba(204,231,255,.12) transparent;
}
.cy-drawer-body::-webkit-scrollbar { width:4px; }
.cy-drawer-body::-webkit-scrollbar-track { background: transparent; }
.cy-drawer-body::-webkit-scrollbar-thumb { background: rgba(204,231,255,.15); border-radius:4px; }

.cy-drawer-body .hs-form fieldset { max-width: none !important; }
.cy-drawer-body .hs-form .hs-input,
.cy-drawer-body .hs-form input,
.cy-drawer-body .hs-form textarea,
.cy-drawer-body .hs-form select {
  width: 100% !important; box-sizing: border-box !important;
}

@media (max-width: 520px) {
  .cy-drawer {
    top: 12px; left: 12px; right: 12px; bottom: 12px;
    width: auto; max-width: none;
    border-radius: 20px;
    border: 1px solid rgba(204,231,255,.14);
    transform: translateY(calc(100% + 24px));
  }
  .cy-drawer.cy-open { transform: translateY(0); }
  .cy-form-btn { bottom: 20px; right: 16px; padding: 12px 18px; font-size: 13px; }
  .cy-drawer-head { padding: 22px 20px 18px; }
  .cy-drawer-body { padding: 20px 20px 40px; }
}

/* ── prefers-reduced-motion ─────────────────────────────────── */
@media (prefers-reduced-motion:reduce) {
  .js-tk .hero h1 .gw,
  .js-tk .hero .hero-sub,
  .js-tk .hero-stat,
  .js-tk .hero-cta-row,
  .js-tk .sec-head .marker,
  .js-tk .sec-head h2,
  .js-tk .sec-head .lead,
  .js-tk .spec-image,
  .js-tk .spec-row,
  .js-tk .duct-feature .feature-image,
  .js-tk .duct-feature .duct-big,
  .js-tk .headline-cell,
  .js-tk .svc-card,
  .js-tk .ila-head,
  .js-tk .ila-item,
  .js-tk .ila-foot,
  .js-tk .rp-main,
  .js-tk .rp-bar,
  .js-tk .rp-stats,
  .js-tk .final-cta .marker,
  .js-tk .final-cta h2,
  .js-tk .final-cta .lead,
  .js-tk .final-cta .hero-cta-row {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
}
