/* Dinchain welcome ring — reusable visual shell (app + marketing preview).
   Content-driven: markup supplies slots 1..6 + a center node. No app logic here.
   Works with app.css vars (--text/--line/--muted/--accent) and marketing
   styles.css vars (--ink/--line/--muted/--accent) via fallback chain. */

.dw-ring {
  --dw-text: var(--text, var(--ink, #e8eef2));
  --dw-muted: var(--muted, #8b9aa6);
  --dw-line: var(--line, #24303a);
  --dw-accent: var(--accent, #2dd4bf);
  --dw-display: var(--font-display, "Outfit", system-ui, sans-serif);
  --dw-col: minmax(0, 1fr);
  /* ring3: midden tussen te breed en te smal (~16rem ≈ 256px) */
  --dw-card-w: clamp(12.25rem, 18vw, 16rem);
  --dw-core: clamp(200px, 26vw, 360px);
  --dw-push: 1.15rem;
  --dw-pull: 0.65rem;

  position: relative;
  display: grid;
  grid-template-columns: var(--dw-col) var(--dw-core) var(--dw-col);
  grid-template-areas:
    "s1 core s2"
    "s3 core s4"
    "s5 core s6";
  gap: 0.95rem 1.25rem;
  align-items: stretch;
  width: 100%;
  margin: 0.2rem 0 0;
  justify-items: stretch;
}

.dw-ring__core {
  grid-area: core;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  min-height: 0;
}
/* Faint orbit so the six cards read as a ring around the center */
.dw-ring__core::before {
  content: "";
  position: absolute;
  inset: -6%;
  z-index: 0;
  border-radius: 50%;
  border: 1px dashed rgba(45, 212, 191, 0.14);
  pointer-events: none;
}
.dw-ring__core > * {
  position: relative;
  z-index: 1;
}

.dw-ring__card {
  position: relative;
  margin: 0;
  width: 100%;
  max-width: var(--dw-card-w);
  min-height: 7.75rem;
  padding: 1.05rem 0.88rem 1.15rem;
  border: 1px solid var(--dw-line);
  border-radius: 12px;
  background:
    radial-gradient(120% 140% at 50% -30%, rgba(255, 255, 255, 0.045), transparent 62%),
    rgba(255, 255, 255, 0.018);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  justify-content: flex-start;
  box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease;
}
/* Pull cards toward the brain so the ring stays tight while cards stay narrow */
.dw-ring__card[data-col="l"] { justify-self: end; }
.dw-ring__card[data-col="r"] { justify-self: start; }
.dw-ring__card[style*="--dw-c"] {
  border-color: rgba(255, 255, 255, 0.07);
}
.dw-ring__card:hover,
.dw-ring__card:focus-within {
  transform: translateY(-3px);
  border-color: var(--dw-c, var(--dw-accent));
  box-shadow: 0 8px 22px -12px rgba(0, 0, 0, 0.55);
}

/* Decorative connector: thin line + dot pointing at the center (visual only) */
.dw-ring__card::before,
.dw-ring__card::after {
  content: "";
  position: absolute;
  top: 50%;
  pointer-events: none;
}
.dw-ring__card::after {
  height: 1px;
  width: clamp(0.7rem, 2.2vw, 2.2rem);
  transform: translateY(-50%);
  opacity: 0.5;
}
.dw-ring__card::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: var(--dw-c, var(--dw-accent));
  box-shadow: 0 0 7px 0 var(--dw-c, var(--dw-accent));
  opacity: 0.75;
}
.dw-ring__card[data-col="l"]::after {
  left: 100%;
  background: linear-gradient(90deg, var(--dw-c, var(--dw-accent)), transparent);
}
.dw-ring__card[data-col="l"]::before {
  left: 100%;
  margin-left: -2px;
}
.dw-ring__card[data-col="r"]::after {
  right: 100%;
  background: linear-gradient(270deg, var(--dw-c, var(--dw-accent)), transparent);
}
.dw-ring__card[data-col="r"]::before {
  right: 100%;
  margin-right: -2px;
}
.dw-ring__card:hover::after,
.dw-ring__card:hover::before {
  opacity: 1;
}

/* Optical ring: middle pair sits slightly farther out than top/bottom pairs */
.dw-ring__card[data-slot="1"] { grid-area: s1; translate: var(--dw-push) 0; }
.dw-ring__card[data-slot="2"] { grid-area: s2; translate: calc(-1 * var(--dw-push)) 0; }
.dw-ring__card[data-slot="3"] { grid-area: s3; translate: calc(-1 * var(--dw-pull)) 0; }
.dw-ring__card[data-slot="4"] { grid-area: s4; translate: var(--dw-pull) 0; }
.dw-ring__card[data-slot="5"] { grid-area: s5; translate: var(--dw-push) 0; }
.dw-ring__card[data-slot="6"] { grid-area: s6; translate: calc(-1 * var(--dw-push)) 0; }

.dw-ring__head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}
.dw-ring__ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--dw-c, var(--dw-accent));
}
.dw-ring__ico svg {
  width: 15px;
  height: 15px;
}
.dw-ring__card:hover .dw-ring__ico {
  border-color: var(--dw-c, var(--dw-accent));
}
.dw-ring__title {
  margin: 0;
  font-family: var(--dw-display);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--dw-text);
}
.dw-ring__text {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.42;
  color: var(--dw-muted);
}

/* Laptop / compact desktop */
@media (max-width: 1280px) {
  .dw-ring {
    --dw-card-w: clamp(11.5rem, 17vw, 15rem);
    --dw-core: clamp(180px, 23vw, 250px);
    --dw-push: 0.75rem;
    --dw-pull: 0.4rem;
    gap: 0.8rem 0.95rem;
  }
  .dw-ring__card {
    min-height: 7.25rem;
    padding: 0.9rem 0.78rem 1rem;
  }
  .dw-ring__text {
    font-size: 0.71rem;
  }
}

/* Mobile: brain on top, cards stacked, no overlap and no connectors */
@media (max-width: 900px) {
  .dw-ring {
    grid-template-columns: 1fr;
    grid-template-areas:
      "core"
      "s1"
      "s2"
      "s3"
      "s4"
      "s5"
      "s6";
    gap: 0.5rem;
    align-items: stretch;
  }
  .dw-ring__card {
    max-width: none;
    min-height: 0;
    padding: 0.75rem 0.85rem;
    justify-self: stretch;
  }
  .dw-ring__card[data-slot] {
    translate: none;
  }
  .dw-ring__card::before,
  .dw-ring__card::after {
    display: none;
  }
  .dw-ring__core::before {
    display: none;
  }
  /* Keep the core a stretched grid item: auto margins would collapse it to 0 */
  .dw-ring__core {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dw-ring__card {
    transition: none;
  }
  .dw-ring__card:hover,
  .dw-ring__card:focus-within {
    transform: none;
  }
}

/* Light theme (app: body.theme-light, marketing: body.theme-light) */
body.theme-light .dw-ring__card {
  background:
    radial-gradient(120% 140% at 50% -30%, rgba(15, 23, 42, 0.04), transparent 62%),
    rgba(15, 23, 42, 0.02);
}
body.theme-light .dw-ring__ico {
  border-color: rgba(15, 23, 42, 0.1);
  background: rgba(15, 23, 42, 0.03);
}
body.theme-light .dw-ring__core::before {
  border-color: rgba(13, 148, 136, 0.18);
}
