/* BestInEst Hub – iseseisev kujundus, töötab iga teemaga. v1.1 */
.bieh {
  --h-navy: #070D1E;
  --h-txt: #EAF0FF;
  --h-mute: #9FB0D3;
  --h-line: rgba(118, 165, 255, .2);
  --h-blue: #1E6FE0;
  --h-sky: #4C9BFF;
  --h-ease: cubic-bezier(.2, .7, .2, 1);
  --h-pad: clamp(20px, 3.4vw, 44px);
  --mx: 50%;
  --my: 0%;

  position: relative;
  box-sizing: border-box;
  max-width: 1180px;
  margin: 0 auto;
  padding: var(--h-pad);
  border-radius: 30px;
  overflow: hidden;
  isolation: isolate;
  color: var(--h-txt);
  font-family: inherit;
  line-height: 1.55;
  background:
    radial-gradient(820px 480px at 8% -10%, rgba(30, 111, 224, .42), transparent 62%),
    radial-gradient(700px 440px at 98% 0%, rgba(76, 155, 255, .2), transparent 60%),
    var(--h-navy);
}
.bieh *, .bieh *::before, .bieh *::after { box-sizing: border-box; }
.bieh p, .bieh h1, .bieh h2, .bieh ul { margin: 0; }
.bieh ul { list-style: none; padding: 0; }
.bieh a { text-decoration: none; }
.bieh button { font: inherit; }

/* peen võrgustik taustal */
.bieh::before {
  content: "";
  position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(rgba(140, 180, 255, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140, 180, 255, .055) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(900px 560px at 20% 0%, #000 10%, transparent 75%);
  mask-image: radial-gradient(900px 560px at 20% 0%, #000 10%, transparent 75%);
}
/* kursorit järgiv valgus */
.bieh-glow {
  position: absolute; inset: -20%; z-index: -1; pointer-events: none;
  opacity: 0; transition: opacity .5s var(--h-ease);
  background: radial-gradient(420px 420px at var(--mx) var(--my), rgba(76, 155, 255, .20), transparent 68%);
}
.bieh:hover .bieh-glow { opacity: 1; }

/* ilmumine kerimisel */
.bieh-js [data-rv] { opacity: 0; transform: translateY(16px); }
.bieh-js [data-rv].rv-in { opacity: 1; transform: none; transition: opacity .6s var(--h-ease), transform .6s var(--h-ease); transition-delay: var(--d, 0ms); }

/* --- päis --- */
.bieh-hero { position: relative; padding: clamp(4px, 1.4vw, 16px) 0 clamp(22px, 2.6vw, 32px); }
.bieh-kicker { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: #7FC4FF; margin-bottom: 14px; }
.bieh-hero h1 { font-size: clamp(30px, 5.4vw, 58px); line-height: 1.03; letter-spacing: -.025em; font-weight: 800; text-wrap: balance; }
.bieh-hero h1 span { color: #89AEEC; }
.bieh-lead { max-width: 620px; margin-top: 15px; font-size: clamp(15px, 1.5vw, 17.5px); color: #CFDAF1; }

/* kiirvalik */
.bieh-need { display: none; margin-top: 26px; }
.bieh-js .bieh-need { display: block; }
.bieh-chip-all { display: none; }
.bieh.is-focus .bieh-chip-all { display: inline-flex; }
.bieh-need-l { display: block; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--h-mute); margin-bottom: 10px; }
.bieh-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.bieh-chip {
  padding: 10px 17px; border-radius: 999px; cursor: pointer;
  font-size: 14px; font-weight: 600; color: #D8E3FA;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--h-line);
  transition: background .25s, border-color .25s, color .25s, transform .2s var(--h-ease);
}
.bieh-chip:hover { background: rgba(76, 155, 255, .16); border-color: rgba(76, 155, 255, .5); transform: translateY(-1px); }
.bieh-chip[aria-pressed="true"] { background: linear-gradient(135deg, var(--h-blue), #3E8BFF); border-color: transparent; color: #fff; }
.bieh-chip:focus-visible { outline: 2px solid var(--h-sky); outline-offset: 2px; }

.bieh-stats { display: flex; flex-wrap: wrap; gap: 14px 42px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--h-line); }
.bieh-stats li { min-width: 112px; }
.bieh-stats b { display: block; font-size: clamp(20px, 2.4vw, 28px); font-weight: 800; letter-spacing: -.015em; font-variant-numeric: tabular-nums; }
.bieh-stats span { font-size: 13px; color: var(--h-mute); }

/* --- marsruudiriba --- */
.bieh-route { position: relative; height: 44px; margin: 10px 4px 0; display: none; }
.bieh-route-l { position: absolute; left: 0; right: 0; top: 21px; height: 2px; background: repeating-linear-gradient(90deg, rgba(140, 185, 255, .7) 0 8px, transparent 8px 16px); }
.bieh-route-n { position: absolute; top: 13px; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: var(--h-navy); border: 2px solid rgba(140, 185, 255, .8); box-shadow: 0 0 0 4px rgba(7, 13, 30, .9); }
.bieh-route-d {
  position: absolute; top: 6px; left: 0; width: 32px; height: 32px; margin-left: -16px;
  display: grid; place-items: center; border-radius: 50%;
  background: linear-gradient(135deg, var(--h-blue), #4C9BFF);
  box-shadow: 0 0 0 5px rgba(30, 111, 224, .18), 0 8px 18px -8px rgba(30, 111, 224, 1);
  animation: bieh-run 11s linear infinite;
}
.bieh-route-d svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
@keyframes bieh-run {
  0%   { left: 2%; }
  28%  { left: 16.6%; }
  36%  { left: 16.6%; }
  60%  { left: 50%; }
  68%  { left: 50%; }
  92%  { left: 83.4%; }
  100% { left: 98%; }
}
@media (min-width: 981px) { .bieh[data-cards="3"] .bieh-route { display: block; } }

/* --- kaardid --- */
.bieh-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 14px; perspective: 1200px; }
.bieh[data-cards="1"] .bieh-cards { grid-template-columns: minmax(0, 560px); }
.bieh[data-cards="2"] .bieh-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bieh[data-cards="4"] .bieh-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bieh[data-cards="5"] .bieh-cards { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.bieh[data-cards="5"] .bieh-card:nth-child(-n+3) { grid-column: span 2; }
.bieh[data-cards="5"] .bieh-card:nth-child(n+4) { grid-column: span 3; }

/* "Valmib" kaart – ei ole klikitav */
.bieh-card.is-soon { opacity: .78; }
.bieh-card.is-soon:hover { transform: none; box-shadow: none; }
.bieh-card.is-soon .bieh-cta { opacity: .7; }
.bieh-soon {
  position: absolute; right: 18px; top: 22px; z-index: 2;
  font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: #fff; background: rgba(0, 0, 0, .3); border: 1px solid rgba(255, 255, 255, .35);
  padding: 5px 11px; border-radius: 999px;
}

.bieh-card {
  --rx: 0deg; --ry: 0deg; --sx: 50%; --sy: 0%;
  position: relative;
  display: flex; flex-direction: column;
  padding: 26px 24px 22px;
  border-radius: 24px;
  background: var(--h-navy);
  border: 1px solid var(--h-line);
  overflow: hidden;
  isolation: isolate;
  transform: perspective(1100px) rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition: transform .4s var(--h-ease), box-shadow .4s, opacity .4s, filter .4s;
}
.bieh-card::before {
  content: ""; position: absolute; inset: 0; z-index: -2; opacity: .92;
  background: linear-gradient(155deg, var(--c1), var(--c2));
}
/* kursori valgustäpp kaardil */
.bieh-card::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  opacity: 0; transition: opacity .35s var(--h-ease);
  background: radial-gradient(320px 260px at var(--sx) var(--sy), rgba(255, 255, 255, .26), transparent 70%);
}
.bieh-card:hover, .bieh-card.is-on { box-shadow: 0 30px 56px -28px rgba(3, 8, 20, .95); }
.bieh-card:hover::after, .bieh-card.is-on::after { opacity: 1; }
.bieh-card.is-on { border-color: rgba(255, 255, 255, .5); }
.bieh-card.is-dim { opacity: .4; filter: saturate(.45); }
.bieh-card.c-blue { --c1: #1E6FE0; --c2: #091A3A; }
.bieh-card.c-violet { --c1: #5B46D6; --c2: #150F37; }
.bieh-card.c-green { --c1: #1F7A55; --c2: #092219; }
.bieh-card.c-amber { --c1: #B9791B; --c2: #291A06; }
.bieh-card.c-steel { --c1: #3D4657; --c2: #10141D; }

.bieh-card-link { position: absolute; inset: 0; z-index: 3; }
.bieh-card-link:focus-visible { outline: 3px solid #fff; outline-offset: -5px; border-radius: 24px; }
.bieh-ic {
  width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px;
  background: rgba(255, 255, 255, .16); margin-bottom: 16px;
  transform: translateZ(30px);
  transition: transform .4s var(--h-ease), background .3s;
}
.bieh-card:hover .bieh-ic { background: rgba(255, 255, 255, .26); transform: translateZ(44px) scale(1.06); }
.bieh-ic svg { width: 27px; height: 27px; fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.bieh-tag { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; opacity: .74; }
.bieh-card h2 { font-size: clamp(20px, 2.1vw, 25px); line-height: 1.12; margin-top: 4px; letter-spacing: -.015em; font-weight: 800; text-wrap: balance; transform: translateZ(18px); }
.bieh-desc { margin-top: 10px; font-size: 14.5px; color: rgba(255, 255, 255, .85); }
.bieh-bul { margin-top: 16px; display: grid; gap: 7px; flex: 1; }
.bieh-bul li { position: relative; padding-left: 20px; font-size: 13.5px; color: rgba(255, 255, 255, .82); }
.bieh-bul li::before { content: ""; position: absolute; left: 2px; top: .52em; width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .78); }
.bieh-cta { display: inline-flex; align-items: center; gap: 8px; margin-top: 20px; font-weight: 700; font-size: 14.5px; transform: translateZ(14px); }
.bieh-cta svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s var(--h-ease); }
.bieh-card:hover .bieh-cta svg, .bieh-card.is-on .bieh-cta svg { transform: translateX(6px); }

/* --- ristmüügi riba --- */
.bieh-cross {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin-top: 16px; padding: 20px clamp(18px, 2.4vw, 28px);
  border-radius: 22px;
  background: rgba(255, 255, 255, .06);
  border: 1px dashed var(--h-line);
  transition: border-color .4s, background .4s;
}
.bieh-cross.is-on { border-style: solid; border-color: rgba(76, 155, 255, .6); background: rgba(76, 155, 255, .12); }
.bieh-cross-ic { flex: none; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: rgba(76, 155, 255, .18); }
.bieh-cross-ic svg { width: 22px; height: 22px; fill: none; stroke: var(--h-sky); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.bieh-cross p { flex: 1; min-width: 240px; font-size: 15px; color: #D3DDF2; }
.bieh-btn {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 24px; border-radius: 999px;
  font-weight: 700; font-size: 15px; color: #fff;
  background: linear-gradient(135deg, var(--h-blue), #3E8BFF);
  box-shadow: 0 14px 30px -14px rgba(30, 111, 224, .9);
  transition: transform .2s var(--h-ease);
}
.bieh-btn:hover { transform: translateY(-2px); color: #fff; }

/* --- jalus --- */
.bieh-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-top: 26px; padding-top: 20px;
  border-top: 1px solid var(--h-line);
  font-size: 13.5px; color: var(--h-mute);
}
.bieh-foot b { display: block; color: var(--h-txt); font-size: 15px; }
.bieh-foot-c { display: flex; gap: 18px; flex-wrap: wrap; }
.bieh-foot a { color: var(--h-sky); }
.bieh-foot a:hover { color: #fff; }

@media (max-width: 980px) {
  .bieh-cards, .bieh[data-cards="4"] .bieh-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bieh[data-cards="5"] .bieh-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bieh[data-cards="5"] .bieh-card:nth-child(-n+3),
  .bieh[data-cards="5"] .bieh-card:nth-child(n+4) { grid-column: span 1; }
}
@media (max-width: 640px) {
  .bieh { border-radius: 22px; }
  .bieh-cards, .bieh[data-cards="2"] .bieh-cards, .bieh[data-cards="4"] .bieh-cards, .bieh[data-cards="5"] .bieh-cards { grid-template-columns: 1fr; }
  .bieh-stats { gap: 12px 26px; }
  .bieh-stats li { min-width: 92px; }
  .bieh-btn { width: 100%; }
  .bieh-chip { padding: 9px 14px; font-size: 13.5px; }
}
@media (hover: none) {
  .bieh-card { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .bieh-card, .bieh-card::after, .bieh-ic, .bieh-cta svg, .bieh-btn, .bieh-chip, .bieh-glow { transition: none; }
  .bieh-route-d { display: none; }
  .bieh-js [data-rv] { opacity: 1; transform: none; }
}
