/* v2 cards: nibble/card-grid (.nb-cards) + nibble/card (.nb-card)
   Variants: a | b | c | d | data | ghost | case.  Tones: white | lightblue | grey | green | dark-outline | dark | none.
   Tokens come from v2.css; the fallbacks below keep the file usable on its own. */

/* ---------- grid ---------- */

.nb-cards {
  --nb-cols: 3;
  --nb-gap: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: var(--nb-gap);
  align-items: stretch;
  justify-content: flex-start;
  width: 100%;
}

.nb-cards--cols-1 {
  --nb-cols: 1;
}

.nb-cards--cols-2 {
  --nb-cols: 2;
}

.nb-cards--cols-3 {
  --nb-cols: 3;
}

.nb-cards--cols-4 {
  --nb-cols: 4;
}

.nb-cards--gap-l {
  --nb-gap: 64px;
}

.nb-cards--gap-s {
  --nb-gap: 24px;
}

.nb-cards--align-center {
  justify-content: center;
}

.nb-cards > .nb-card {
  flex: 0 0 calc((100% - (var(--nb-cols) - 1) * var(--nb-gap)) / var(--nb-cols));
  max-width: calc((100% - (var(--nb-cols) - 1) * var(--nb-gap)) / var(--nb-cols));
  margin: 0;
}

.nb-cards > .nb-card--wide {
  flex-basis: 100%;
  max-width: 100%;
}

/* ---------- card base ---------- */

.nb-card {
  --nb-card-gap: 21px;
  --nb-card-pad: 32px;
  --nb-card-icon: 80px;
  --nb-card-color: var(--nb-p500, #146deb);
  --nb-card-title-color: var(--nb-n600, #263344);
  --nb-card-text-color: var(--nb-n600, #263344);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--nb-card-gap);
  box-sizing: border-box;
  min-width: 0;
  padding: var(--nb-card-pad);
  border-radius: var(--nb-radius-m, 16px);
  background: var(--nb-white, #fff);
  box-shadow: var(--nb-shadow-5, 0 -1px 8px rgba(129, 148, 166, .05), 0 2px 4px 1px rgba(129, 148, 166, .05), 0 4px 8px -4px rgba(129, 148, 166, .05), 0 8px 16px -5px rgba(129, 148, 166, .05), 0 10px 24px -5px rgba(129, 148, 166, .05), 0 12px 24px -5px rgba(129, 148, 166, .05));
  color: var(--nb-card-text-color);
  font-family: var(--nb-ff-text, Inter, sans-serif);
  font-size: 16px;
  line-height: 24px;
  text-align: left;
}

.nb-card--tone-lightblue {
  background: var(--nb-p0, #ebf3ff);
}

.nb-card--tone-grey {
  background: var(--nb-n30, #f0f2f5);
  --nb-card-color: #a7b6c4; /* Figma N 200, outline icons on grey */
}

.nb-card--tone-green {
  background: var(--nb-teal-0, #f2fffe);
  --nb-card-color: var(--nb-teal-250, #09ab9d);
}

.nb-card--tone-none {
  background: transparent;
  box-shadow: none;
}

.nb-card--tone-dark {
  background: var(--nb-p700, #001533);
  box-shadow: none;
  --nb-card-title-color: #fff;
  --nb-card-text-color: var(--nb-p50, #cee3ff);
  --nb-card-color: #75ded5; /* Figma Ext 4 / 100 */
}

.nb-card--tone-dark-outline {
  background: transparent;
  box-shadow: none;
  border: 2px solid var(--nb-teal-200, #2dbbaf);
  --nb-card-title-color: #fff;
  --nb-card-text-color: var(--nb-teal-200, #2dbbaf);
  --nb-card-color: #75ded5; /* Figma Ext 4 / 100 */
}

/* ---------- shared parts ---------- */

.nb-card__icon {
  display: block;
  flex: 0 0 auto;
  width: var(--nb-card-icon);
  height: var(--nb-card-icon);
  color: var(--nb-card-color);
  line-height: 0;
}

.nb-card__icon svg,
.nb-card__icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: left center;
}

.nb-card__icon--img {
  width: auto;
  max-width: 100%;
}

.nb-card__icon--img img {
  width: auto;
  max-width: 100%;
}

.nb-card__eyebrow {
  margin: 0;
  color: var(--nb-n400, #617385);
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.nb-card__title {
  margin: 0;
  color: var(--nb-card-title-color);
  font-family: var(--nb-ff-display, VisbyCF, sans-serif);
  font-size: 32px;
  font-weight: 800;
  line-height: 35px;
  letter-spacing: 0;
}

.nb-card__subtitle {
  margin: 0;
  color: var(--nb-teal-300, #0d988c);
  font-size: 14px;
  font-weight: 600;
  line-height: 18px;
  letter-spacing: .005em;
}

.nb-card__lead {
  margin: 0;
  color: var(--nb-n600, #263344);
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
}

.nb-card__badge {
  align-self: flex-start;
  box-sizing: border-box;
  max-width: 100%;
  margin: 0;
  padding: 8px 12px;
  border-radius: 16px;
  background: var(--nb-teal-0, #f2fffe);
  color: var(--nb-teal-300, #0d988c);
  font-size: 14px;
  font-weight: 600;
  line-height: 18px;
  letter-spacing: .005em;
}

.nb-card__text {
  margin: 0;
  font-size: 16px;
  line-height: 24px;
}

.nb-card__text p {
  margin: 0;
}

.nb-card__text p + p {
  margin-top: 12px;
}

.nb-card__text strong,
.nb-card__ticks strong {
  font-weight: 600;
}

.nb-card__ticks {
  display: flex;
  flex-direction: column;
  gap: 21px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nb-card__ticks li {
  display: flex;
  align-items: flex-start;
  gap: 21px;
  margin: 0;
  padding: 0;
}

.nb-card__ticks li::before {
  content: none;
}

.nb-card__tick {
  display: block;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  color: #75ded5; /* Figma Ext 4 / 100 */
  line-height: 0;
}

.nb-card__tick svg {
  display: block;
  width: 24px;
  height: 24px;
}

.nb-card__tick-text {
  flex: 1 1 0;
  min-width: 0;
}

.nb-card__meta {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.nb-card__meta-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
}

.nb-card__meta-label {
  margin: 0;
  color: var(--nb-n400, #617385);
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  text-transform: uppercase;
}

.nb-card__meta-value {
  margin: 0;
  color: var(--nb-n600, #263344);
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
}

.nb-card__foot {
  margin-top: auto;
}

.nb-card__foot.nb-buttons {
  justify-content: flex-start;
}

/* ---------- variant a: tinted top (icon + title), white body ---------- */

.nb-card--a {
  --nb-card-gap: 0;
  --nb-card-pad: 0;
  overflow: hidden;
}

.nb-card--a .nb-card__top,
.nb-card--a .nb-card__body {
  display: flex;
  flex-direction: column;
  gap: 21px;
  box-sizing: border-box;
  padding: 32px;
}

.nb-card--a .nb-card__top {
  gap: 24px;
}

.nb-card--a .nb-card__top-text {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.nb-card--a .nb-card__body {
  flex: 1 1 auto;
  background: var(--nb-white, #fff);
}

/* ---------- variant b: teal outline, dark section ---------- */

.nb-card--b {
  --nb-card-icon: 64px;
}

.nb-card--b .nb-card__text {
  font-size: 18px;
  line-height: 26px;
}

.nb-card--b .nb-card__head {
  display: flex;
  align-items: center;
  gap: 21px;
}

.nb-card--b .nb-card__head .nb-card__icon {
  --nb-card-icon: 48px;
}

.nb-card--b .nb-card__title {
  font-size: 24px;
  line-height: 1.15;
}

.nb-card--b .nb-card__ticks {
  color: #b0efe9; /* Figma Ext 4 / 50 */
  font-size: 18px;
  line-height: 26px;
}

.nb-card--b.nb-card--has-head {
  --nb-card-pad: 40px;
}

/* ---------- variant c: icon + title row, text, tick list, link ---------- */

.nb-card--c {
  --nb-card-gap: 24px;
  --nb-card-pad: 40px;
  --nb-card-color: var(--nb-teal-200, #2dbbaf);
  --nb-card-title-color: var(--nb-p700, #001533);
  --nb-card-text-color: var(--nb-p700, #001533);
}

.nb-card--c .nb-card__head {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nb-card--c .nb-card__head-text {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.nb-card--c .nb-card__subtitle {
  font-size: 16px;
  line-height: 20px;
}

.nb-card--c .nb-card__text {
  font-size: 18px;
  line-height: 26px;
}

.nb-card--c .nb-card__ticks {
  color: var(--nb-n700, #111824);
}

/* ---------- variant d: icon, title, text (simple) / + link (complex) ---------- */

.nb-card--d {
  --nb-card-pad: 48px 40px;
}

.nb-card--d .nb-card__title {
  font-size: 28px;
  line-height: 1.1;
}

.nb-card--d.nb-card--tone-white .nb-card__title {
  font-size: 32px;
  line-height: 35px;
}

.nb-card--d .nb-card__text {
  font-size: 18px;
  line-height: 26px;
}

.nb-card--d.nb-card--has-foot {
  --nb-card-pad: 40px;
  --nb-card-icon: 64px;
}

.nb-card--d.nb-card--has-foot .nb-card__text {
  font-size: 16px;
  line-height: 24px;
}

/* ---------- data ---------- */

.nb-card--data {
  --nb-card-gap: 24px;
  --nb-card-pad: 40px;
  --nb-card-title-color: var(--nb-p700, #001533);
  --nb-card-text-color: var(--nb-p700, #001533);
}

.nb-card--data .nb-card__text {
  font-size: 18px;
  line-height: 26px;
}

.nb-card__stat-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nb-card__stat {
  margin: 0;
  color: var(--nb-teal-250, #09ab9d);
  font-family: var(--nb-ff-display, VisbyCF, sans-serif);
  font-size: 56px;
  font-weight: 800;
  line-height: 62px;
}

.nb-card__stat-unit {
  font-size: 40px;
  line-height: 44px;
}

.nb-card__stat-unit--word {
  margin-left: .25em;
}

.nb-card__stat-label {
  margin: 0;
  color: var(--nb-n400, #617385);
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
}

/* ---------- ghost: no box ---------- */

.nb-card--ghost {
  --nb-card-pad: 0;
  --nb-card-icon: 64px;
  --nb-card-title-color: var(--nb-p700, #001533);
  --nb-card-text-color: var(--nb-p700, #001533);
  flex-direction: row;
  align-items: flex-start;
  gap: 32px;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
}

.nb-card--ghost .nb-card__content {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.nb-card--ghost .nb-card__title {
  font-size: 24px;
  line-height: 32px;
}

.nb-card--ghost .nb-card__text {
  font-size: 18px;
  line-height: 26px;
}

/* ---------- case study ---------- */

.nb-card--case {
  flex-direction: row;
  align-items: stretch;
  gap: 32px;
}

.nb-card--case .nb-card__context-box {
  position: relative;
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 24px;
  box-sizing: border-box;
  min-width: 0;
  padding: 40px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--nb-p0, #ebf3ff);
}

.nb-card--case .nb-card__context-box::after {
  content: "";
  position: absolute;
  top: -55px;
  right: -40px;
  width: 242px;
  height: 242px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(121, 181, 255, .65), rgba(121, 181, 255, 0));
  pointer-events: none;
}

.nb-card--case .nb-card__context-box > * {
  position: relative;
  z-index: 1;
}

.nb-card--case .nb-card__title {
  font-size: 40px;
  line-height: 44px;
}

.nb-card--case .nb-card__context {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-weight: 600;
}

.nb-card--case .nb-card__context-label,
.nb-card--case .nb-card__meta-label {
  color: var(--nb-p500, #146deb);
}

.nb-card--case .nb-card__context-text {
  margin: 0;
}

.nb-card--case .nb-card__meta {
  flex: 1 1 0;
  min-width: 0;
}

/* ---------- inside a dark section ---------- */

.nb-section--dark .nb-card--ghost {
  --nb-card-title-color: #fff;
  --nb-card-text-color: var(--nb-p100, #b0d3ff);
}

.nb-section--dark .nb-card--b .nb-card__ticks {
  color: #b0efe9;
}

/* ---------- tablet / mobile ---------- */

@media (max-width: 1023px) {
  .nb-cards--cols-3,
  .nb-cards--cols-4 {
    --nb-cols: 2;
  }

  .nb-cards--gap-l {
    --nb-gap: 32px;
  }

  .nb-card--case {
    flex-direction: column;
  }

  .nb-card--case .nb-card__title {
    font-size: 32px;
    line-height: 36px;
  }
}

@media (max-width: 767px) {
  .nb-cards {
    --nb-cols: 1 !important;
    --nb-gap: 24px;
  }

  .nb-card--a .nb-card__top,
  .nb-card--a .nb-card__body {
    padding: 24px;
  }

  .nb-card--b.nb-card--has-head,
  .nb-card--c,
  .nb-card--d,
  .nb-card--d.nb-card--has-foot,
  .nb-card--data {
    --nb-card-pad: 24px;
  }

  .nb-card--case {
    --nb-card-pad: 20px;
  }

  .nb-card--case .nb-card__context-box {
    padding: 24px;
  }

  .nb-card__title,
  .nb-card--d.nb-card--tone-white .nb-card__title,
  .nb-card--case .nb-card__title {
    font-size: 24px;
    line-height: 28px;
  }

  .nb-card--ghost {
    gap: 20px;
  }

  .nb-card__stat {
    font-size: 44px;
    line-height: 50px;
  }

  .nb-card__stat-unit {
    font-size: 32px;
    line-height: 36px;
  }
}

@media (max-width: 767px) {
  .nb-card--c .nb-card__head {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }
}
