/* InvictusBoost - premium features section
   Illustrated bento grid on the homepage (components/products.njk, id="features").
   Everything is scoped under .ib #features. The tiles also carry .premium-tile so the
   homepage scroll-reveal picks them up; the rules here override that class's box. */

.ib #features {
  position: relative;
  isolation: isolate;
  padding: 3.25em 0 2.75em;
}
.ib #features::before {
  content: '';
  position: absolute;
  inset: 4% 0 auto;
  height: 70%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 46% 52% at 50% 30%, rgba(var(--accent-rgb), 0.11) 0%, transparent 70%),
    radial-gradient(ellipse 30% 40% at 12% 70%, rgba(126, 176, 255, 0.05) 0%, transparent 70%);
}
.ib #features .wrap { position: relative; z-index: 1; }

/* ------------------------------------------------------------------ head --- */
.ib #features .ibf-head {
  text-align: center;
  max-width: 660px;
  margin: 0 auto 38px;
}
.ib #features .ibf-head .ibf-eyebrow {
  margin: 0 0 14px;
  color: var(--accent-2);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}
.ib #features .ibf-head h2 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: clamp(32px, 4.8vw, 50px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.04em;
  color: var(--text);
}
.ib #features .ibf-head h2 span {
  background: linear-gradient(180deg, #a9c8ff 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--accent-2);
}
.ib #features .ibf-head .ibf-intro {
  margin: 0;
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1.55;
  text-wrap: balance;
}

/* ------------------------------------------------------------------ grid --- */
.ib #features .ibf-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}
.ib #features .ibf-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 372px;
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid rgba(120, 170, 255, 0.16);
  background: linear-gradient(165deg, rgba(18, 27, 46, 0.92) 0%, rgba(10, 16, 28, 0.96) 100%);
  box-shadow: 0 18px 40px -28px rgba(0, 0, 0, 0.7);
  transition:
    translate .28s cubic-bezier(.2, .8, .2, 1),
    border-color .22s ease,
    box-shadow .28s ease;
}
/* The reveal class (added by the homepage script) swaps the transition list: keep its
   staggered fade-in, and keep the hover lift on the separate `translate` property. */
.ib #features .ibf-tile.reveal {
  transition:
    opacity .45s cubic-bezier(.2, .8, .2, 1) var(--reveal-delay, 0ms),
    transform .45s cubic-bezier(.2, .8, .2, 1) var(--reveal-delay, 0ms),
    translate .28s cubic-bezier(.2, .8, .2, 1),
    border-color .22s ease,
    box-shadow .28s ease;
}
/* The lift is on `translate` only; the shared .premium-tile:hover transform is switched off so
   the two do not add up. */
.ib #features .ibf-tile:hover {
  transform: none;
  translate: 0 -3px;
  border-color: rgba(var(--accent-rgb), 0.42);
  box-shadow: 0 24px 46px -26px rgba(var(--accent-rgb), 0.38);
}
.ib #features .ibf-tile--wide {
  grid-column: span 2;
  flex-direction: row;
}

/* illustration area */
.ib #features .ibf-art {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 214px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 26px 20px 22px;
  background: radial-gradient(ellipse 72% 62% at 50% 44%, rgba(var(--accent-rgb), 0.10) 0%, transparent 72%);
}
.ib #features .ibf-tile--wide .ibf-art {
  flex: 0 0 50%;
  min-width: 0;
}

/* text area */
.ib #features .ibf-body {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  min-height: 152px;
  padding: 20px 22px 22px;
  border-top: 1px solid var(--line);
}
.ib #features .ibf-tile--wide .ibf-body {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 28px;
  border-top: 0;
  border-left: 1px solid var(--line);
}
.ib #features .ibf-title {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 11px;
}
.ib #features .ibf-ico {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent-2);
}
.ib #features .ibf-ico svg { width: 17px; height: 17px; display: block; }
.ib #features .ibf-tile h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
}
.ib #features .ibf-body p {
  margin: 0;
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.6;
}
.ib #features .ibf-body p a {
  color: var(--accent-2);
  text-decoration: underline;
  text-decoration-color: rgba(var(--accent-rgb), 0.45);
  text-underline-offset: 3px;
}
.ib #features .ibf-body p a:hover { color: var(--text); }
.ib #features .ibf-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  margin-top: 14px;
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 700;
}
.ib #features .ibf-link svg {
  width: 14px;
  height: 14px;
  transition: transform .22s cubic-bezier(.2, .8, .2, 1);
}
.ib #features .ibf-link:hover { color: var(--text); }
.ib #features .ibf-link:hover svg { transform: translateX(3px); }
.ib #features .ibf-body a:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 4px;
}

/* shared pill */
.ib #features .ibf-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(8, 14, 26, 0.7);
  color: #c4d6f0;
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
}
.ib #features .ibf-pill--check::before {
  content: '';
  flex: none;
  width: 9px;
  height: 5px;
  margin-top: -3px;
  border-left: 1.8px solid var(--pos);
  border-bottom: 1.8px solid var(--pos);
  transform: rotate(-45deg);
}

/* ------------------------------------------------- 1. crypto checkout --- */
.ib #features .ibf-card {
  position: relative;
  width: min(232px, 100%);
  aspect-ratio: 1.62;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 17px 15px;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(140deg, #76a6ff 0%, #4178e8 40%, #1e3d93 100%);
  box-shadow:
    0 22px 44px -20px rgba(var(--accent-rgb), 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  color: #fff;
  transition: transform .4s cubic-bezier(.2, .8, .2, 1);
}
.ib #features .ibf-card::after {
  content: '';
  position: absolute;
  inset: -40% -10% auto 35%;
  height: 120%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22) 0%, transparent 62%);
  pointer-events: none;
}
.ib #features .ibf-tile--pay:hover .ibf-card { transform: rotate(-2deg) translateY(-2px); }
.ib #features .ibf-card__top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ib #features .ibf-card__chip {
  width: 36px;
  height: 27px;
  border-radius: 6px;
  background:
    linear-gradient(90deg, transparent 47%, rgba(120, 80, 0, 0.28) 47%, rgba(120, 80, 0, 0.28) 53%, transparent 53%),
    linear-gradient(135deg, #fbe59a 0%, #dba93c 100%);
  box-shadow: inset 0 0 0 1px rgba(120, 80, 0, 0.18);
}
.ib #features .ibf-card__wave { width: 20px; height: 20px; opacity: .8; }
.ib #features .ibf-card__dots {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 9px;
}
/* four dots per group: the width is exactly four 9px background tiles */
.ib #features .ibf-card__dots i {
  flex: none;
  width: 36px;
  height: 5px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.92) 0 2.2px, transparent 2.6px) 0 50% / 9px 5px repeat-x;
}
.ib #features .ibf-card__foot {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
}
.ib #features .ibf-card__foot span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ib #features .ibf-coins {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  max-width: 264px;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
}
.ib #features .ibf-coin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(8, 14, 26, 0.7);
  color: #c4d6f0;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.06em;
}
.ib #features .ibf-coin i {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.ib #features .ibf-coin img { width: 14px; height: 14px; border-radius: 50%; object-fit: cover; }
.ib #features .ibf-coin[data-coin="BTC"] i { background: #f7931a; }
.ib #features .ibf-coin[data-coin="ETH"] i { background: #8a9cf0; }
.ib #features .ibf-coin[data-coin="LTC"] i { background: #5f8fd6; }
.ib #features .ibf-coin[data-coin="SOL"] i { background: linear-gradient(135deg, #9945ff, #14f195); }
.ib #features .ibf-coin[data-coin="USDT"] i { background: #26a17b; }
.ib #features .ibf-coin[data-coin="USDC"] i { background: #2f80e0; }

/* ------------------------------------------------------ 2. fair prices --- */
.ib #features .ibf-price {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.ib #features .ibf-price__label {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.ib #features .ibf-price__num {
  font-family: var(--font-display);
  font-size: clamp(40px, 3.6vw, 50px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text);
  text-shadow: 0 10px 38px rgba(var(--accent-rgb), 0.45);
  font-variant-numeric: tabular-nums;
}
.ib #features .ibf-price__tag { color: var(--accent-2); }
.ib #features .ibf-price__tag svg { width: 46px; height: 46px; display: block; }
.ib #features .ibf-price .ibf-pill { margin-top: 6px; }

/* --------------------------------------------------- 3. safe & private --- */
.ib #features .ibf-lock {
  position: relative;
  width: 98px;
  height: 98px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  color: var(--accent-2);
}
.ib #features .ibf-lock::before {
  content: '';
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  border: 1px solid rgba(var(--accent-rgb), 0.42);
  background: radial-gradient(circle at 50% 35%, rgba(var(--accent-rgb), 0.22), rgba(var(--accent-rgb), 0.05) 70%);
}
.ib #features .ibf-lock svg { position: relative; width: 26px; height: 26px; }
.ib #features .ibf-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ---------------------------------------------------- 4. human support --- */
.ib #features .ibf-chat {
  width: 100%;
  max-width: 232px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ib #features .ibf-chat__bubble {
  align-self: flex-end;
  max-width: 100%;
  padding: 9px 14px;
  border-radius: 14px 14px 4px 14px;
  background: linear-gradient(135deg, #5a93ff 0%, #3b6fe0 100%);
  box-shadow: 0 12px 26px -14px rgba(var(--accent-rgb), 0.7);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
}
.ib #features .ibf-chat__typing {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 11px 14px;
  border-radius: 14px 14px 14px 4px;
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
}
.ib #features .ibf-chat__typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  opacity: .35;
  animation: ibfBlink 1.3s ease-in-out infinite;
}
.ib #features .ibf-chat__typing i:nth-child(2) { animation-delay: .18s; }
.ib #features .ibf-chat__typing i:nth-child(3) { animation-delay: .36s; }
.ib #features .ibf-chat__note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.ib #features .ibf-chat__note i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.18);
}

/* -------------------------------------------------- 5. trusted reviews --- */
/* Stacked by default; number and meter sit side by side once the art area is wide enough. */
.ib #features .ibf-tile--reviews .ibf-art { container-type: inline-size; }
.ib #features .ibf-rating {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  max-width: 100%;
}
.ib #features .ibf-rating__side { align-items: center; }
@container (min-width: 300px) {
  .ib #features .ibf-rating { flex-direction: row; gap: 20px; }
  .ib #features .ibf-rating__side { align-items: flex-start; }
}
.ib #features .ibf-rating__num {
  font-family: var(--font-display);
  font-size: clamp(50px, 5vw, 66px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.05em;
  color: var(--text);
  text-shadow: 0 12px 40px rgba(var(--accent-rgb), 0.4);
  font-variant-numeric: tabular-nums;
}
.ib #features .ibf-rating__side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.ib #features .ibf-stars { display: inline-flex; gap: 3px; color: var(--star); }
.ib #features .ibf-stars svg { width: 17px; height: 17px; display: block; }
.ib #features .ibf-stars svg.is-off { color: #2a3b5c; }
.ib #features .ibf-meter { display: flex; gap: 4px; width: 152px; max-width: 100%; }
.ib #features .ibf-meter > span {
  flex: 1 1 0;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--star-off);
}
.ib #features .ibf-meter > span > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
}
.ib #features .ibf-rating__count {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
}
.ib #features .ibf-rating__count b { color: var(--text-dim); font-weight: 700; }

/* ------------------------------------------------- 6. instant delivery --- */
.ib #features .ibf-ring {
  position: relative;
  width: 92px;
  height: 92px;
  flex: none;
  display: grid;
  place-items: center;
  color: var(--accent-2);
}
.ib #features .ibf-ring__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: ibfSpin 3.4s linear infinite;
}
.ib #features .ibf-ring__track { stroke: rgba(var(--accent-rgb), 0.16); stroke-width: 5; }
.ib #features .ibf-ring__arc {
  stroke: var(--accent);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 200 276.5;
}
.ib #features .ibf-ring__check {
  position: relative;
  width: 30px;
  height: 30px;
  color: var(--text);
}
.ib #features .ibf-ring__label {
  color: var(--text-dim);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-align: center;
}
.ib #features .ibf-ring__sub {
  margin-top: -6px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}
.ib #features .ibf-ring__sub b { color: var(--text-dim); font-weight: 700; }

@keyframes ibfSpin { to { transform: rotate(360deg); } }
@keyframes ibfBlink {
  0%, 70%, 100% { opacity: .3; transform: translateY(0); }
  35% { opacity: 1; transform: translateY(-2px); }
}

/* ------------------------------------------------------------ responsive --- */
/* narrow four-column layout: copy runs to four lines, keep the dividers level */
@media (min-width: 1041px) and (max-width: 1240px) {
  .ib #features .ibf-body { min-height: 178px; }
}
@media (max-width: 1040px) {
  .ib #features .ibf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* crypto (wide) / prices + safe / support + delivery / reviews (wide) */
  .ib #features .ibf-tile--reviews { order: 1; }
  .ib #features .ibf-tile { min-height: 348px; }
  .ib #features .ibf-tile--wide { min-height: 0; }
  .ib #features .ibf-tile--wide .ibf-art { min-height: 250px; }
  .ib #features .ibf-body { min-height: 138px; }
}
@media (max-width: 640px) {
  .ib #features { padding: 2.5em 0 2em; }
  .ib #features .ibf-head { margin-bottom: 26px; }
  .ib #features .ibf-head .ibf-intro { font-size: 0.9375rem; }
  .ib #features .ibf-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .ib #features .ibf-tile,
  .ib #features .ibf-tile--wide {
    grid-column: auto;
    flex-direction: column;
    min-height: 0;
  }
  .ib #features .ibf-tile--reviews { order: 0; }
  .ib #features .ibf-art,
  .ib #features .ibf-tile--wide .ibf-art {
    flex: 0 0 auto;
    min-height: 196px;
    padding: 24px 18px 20px;
  }
  .ib #features .ibf-body,
  .ib #features .ibf-tile--wide .ibf-body {
    flex: 0 0 auto;
    min-height: 0;
    padding: 18px 20px 20px;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

@media (hover: none) {
  .ib #features .ibf-tile:hover { translate: none; }
  .ib #features .ibf-tile--pay:hover .ibf-card { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ib #features .ibf-tile,
  .ib #features .ibf-tile.reveal,
  .ib #features .ibf-card,
  .ib #features .ibf-link svg { transition: none !important; }
  .ib #features .ibf-tile:hover { translate: none; }
  .ib #features .ibf-tile::before { display: none; }
  .ib #features .ibf-tile--pay:hover .ibf-card { transform: none; }
  .ib #features .ibf-link:hover svg { transform: none; }
  .ib #features .ibf-ring__svg { animation: none; transform: rotate(-90deg); }
  .ib #features .ibf-chat__typing i { animation: none; opacity: .7; }
}