/* loop.css — "Det levende systemet": animated living-system loop (community.com-style) */

.loop-page .page-head { text-align: center; max-width: 760px; margin-left: auto; margin-right: auto; padding-top: clamp(40px, 9vw, 120px); }
.loop-page .page-head .eyebrow { justify-content: center; }
.loop-page .page-head p { margin-left: auto; margin-right: auto; }

/* ---------- diagram frame ---------- */
.loop {
  position: relative;
  width: min(1000px, 94vw);
  aspect-ratio: 1100 / 720;
  margin: clamp(20px, 2.5vw, 32px) auto 0;
}
.loop__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }

/* ring + flowing energy */
.loop__ring { fill: none; stroke: var(--line); stroke-width: 1.5; }
.loop__flow { fill: none; stroke: color-mix(in oklab, var(--accent), #fff 25%); stroke-width: 2; stroke-dasharray: 2 10; stroke-linecap: round; opacity: .65; animation: loopdash 9s linear infinite; }
@keyframes loopdash { to { stroke-dashoffset: -240; } }

/* spokes: white at rest, full blue line + moving dots when the centre is hovered */
.loop__spoke { stroke: #fff; stroke-width: 1.5; transition: stroke .3s var(--ease); }
.loop__spokeflow { stroke: #2B43C4; stroke-width: 3.2; stroke-dasharray: 1 10; stroke-linecap: round; opacity: 0; transition: opacity .35s var(--ease); animation: spokeflow 1.3s linear infinite; }
@keyframes spokeflow { to { stroke-dashoffset: -28; } }
.loop.is-active .loop__spoke { stroke: #2B43C4; }
.loop.is-active .loop__spokeflow { opacity: 1; stroke: #fff; }

/* external arrows (node <-> source) */
.loop__arrow { stroke: var(--ink-2); stroke-width: 1.6; fill: none; opacity: 1; }
.loop__arrowflow { stroke: var(--seg, var(--accent)); stroke-width: 2; stroke-dasharray: 1 8; stroke-linecap: round; opacity: 0; transition: opacity .4s var(--ease); animation: feeddash 1.1s linear infinite; }
@keyframes feeddash { to { stroke-dashoffset: -18; } }
.loop.is-active .loop__arrowflow, .loop__arrowflow.lit { opacity: .85; }


/* expanding pulse when the centre fires the system */
.loop__pulse { fill: none; stroke: var(--accent); stroke-width: 2; opacity: 0; }
.loop__ringarc { fill: none; stroke: #C6CFDA; stroke-width: 1.9; transition: stroke .3s var(--ease), stroke-width .3s var(--ease); }
.loop__archit { fill: none; stroke: #000; stroke-opacity: 0; stroke-width: 26; pointer-events: stroke; cursor: pointer; }
.loop__arrow.lit { stroke: var(--seg); stroke-width: 2.2; opacity: 1; }
.loop__arrowg--reactivation .loop__arrow.lit { stroke: #111; }
.loop__arrowg--reactivation-1 .loop__arrow.lit { stroke: #1F8A5B; }
.loop__arrowg--reactivation-0 .loop__arrow.lit { stroke: var(--seg); }
.loop__arrowg--reviews-0 .loop__arrow.lit { stroke: #DC3D43; }
.loop__ringarc.lit { stroke: var(--seg, var(--accent)); stroke-width: 3.4; }
.loop.is-active .loop__ringarc { stroke: var(--seg, var(--accent)); stroke-width: 2.6; }
.loop.is-active .loop__pulse { animation: sysPulse 1.6s var(--ease) infinite; }
@keyframes sysPulse { 0% { r: 40px; opacity: .55; } 100% { r: 140px; opacity: 0; } }

/* ---------- pillar nodes (disc centred ON the ring) ---------- */
.loop__node {
  position: absolute; transform: translate(-50%, -50%);
  width: var(--loop-node, 58px); height: var(--loop-node, 58px);
  background: none; border: none; padding: 0; cursor: pointer;
}
.loop__disc {
  width: 100%; height: 100%; border-radius: 50%;
  background: var(--bg); border: 1.5px solid var(--line);
  box-shadow: var(--shadow-card), 0 0 0 3px transparent, 0 0 0 4.6px transparent; display: grid; place-items: center; color: var(--seg, var(--ink-2));
  opacity: .95;
  transition: transform .25s var(--ease), border-color .25s var(--ease), background .25s var(--ease), color .25s var(--ease), box-shadow .25s var(--ease), opacity .25s var(--ease);
}
.loop__node:hover .loop__disc,
.loop__node.is-active .loop__disc,
.loop.is-active .loop__node .loop__disc { opacity: 1; }
.loop__disc svg { width: calc(var(--loop-node, 58px) * 0.42); height: calc(var(--loop-node, 58px) * 0.42); }
.loop__label {
  position: absolute; left: 50%; top: calc(100% + 9px); transform: translateX(-50%);
  width: 168px; text-align: center; pointer-events: auto; cursor: pointer;
}
.loop__label .t { display: block; font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.18; }
.loop__label .s { display: block; font-size: 11px; color: var(--ink-3); margin-top: 1px; line-height: 1.2; }
/* side nodes: label sits at the top-left of the disc (reference) */
.loop__node[data-pos="left"] .loop__label,
.loop__node[data-pos="right"] .loop__label {
  top: auto; bottom: calc(100% + 2px);
  left: auto; right: calc(50% + 6px);
  transform: none;
  width: max-content; max-width: 104px;
  text-align: left;
}
.loop__node[data-pos="right"] .loop__label { left: calc(50% + 11px); right: auto; max-width: none; bottom: calc(100% + 20px); }
.loop__node[data-pos="right"] .loop__label .s { white-space: nowrap; }
.loop__node[data-pos="right"] .loop__label .t { white-space: nowrap; }
.loop__node[data-pos="left"] .loop__label { bottom: calc(100% + 16px); right: calc(50% + 18px); }
.loop__node[data-pos="left"] .loop__label .s { margin-top: 1px; text-align: right; padding: 0; }
/* top node: label sits above the icon, with air below the arrows */
.loop__node[data-pos="top"] .loop__label { top: auto; bottom: calc(100% + 6px); }
.loop__node[data-pos="bottom"] .loop__label { top: calc(100% + 10px); width: max-content; max-width: none; }
.loop__node[data-pos="bottom"] .loop__label .s { white-space: nowrap; }

.loop__node:hover .loop__disc { transform: scale(1.04); border-color: color-mix(in oklab, var(--seg, var(--accent)), #fff 35%); }
.loop.is-active .loop__node .loop__disc {
  background: var(--seg, var(--accent)); border-color: var(--seg, var(--accent)); color: #fff;
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 4.6px var(--seg, var(--accent)), 0 10px 22px -12px color-mix(in srgb, var(--seg, var(--accent)), transparent 56%);
}
.loop__node.is-active .loop__disc {
  background: var(--seg, var(--accent)); border-color: var(--seg, var(--accent)); color: #fff; transform: none;
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 4.6px var(--seg, var(--accent)), 0 10px 22px -12px color-mix(in srgb, var(--seg, var(--accent)), transparent 56%);
}
.loop__node.is-active .loop__label .t { color: var(--seg, var(--accent-strong)); font-weight: 800; }
.loop.is-active .loop__node .loop__label .t { color: var(--seg, var(--accent-strong)); font-weight: 800; }
.loop__node.is-active .loop__label .s,
.loop.is-active .loop__node .loop__label .s { color: var(--ink); font-weight: 600; }

/* ---------- external source tiles (logo drop zones) ---------- */
.loop__ext {
  position: absolute; transform: translate(-50%, -50%);
  width: var(--loop-node, 58px); height: var(--loop-node, 58px);
  background: none; border: none; padding: 0; cursor: pointer;
}
.loop__tile {
  width: 100%; height: 100%; border-radius: 0;
  background: none; border: none;
  display: grid; place-items: center; color: var(--ink);
  transition: transform .25s var(--ease), color .25s var(--ease);
}
.loop__tile svg { width: calc(var(--loop-node, 58px) * 0.64); height: calc(var(--loop-node, 58px) * 0.64); transition: stroke-width .25s var(--ease); }
.loop__ext:hover .loop__tile,
.loop__ext.is-outer .loop__tile { transform: scale(1.2); }
.loop__ext[data-pos="bottom"] .loop__tile { transform-origin: top center; }
.loop__ext[data-pos="bottom"]:hover .loop__tile,
.loop__ext[data-pos="bottom"].is-outer .loop__tile { transform: scale(1.36); }
.loop__ext[data-pos="right"] .loop__tile svg { width: calc(var(--loop-node, 58px) * 0.84); height: calc(var(--loop-node, 58px) * 0.84); }
.loop__ext[data-pos="right"]:hover .loop__tile,
.loop__ext[data-pos="right"].is-outer .loop__tile { transform: scale(1.32); }
/* Kvalitetssløyfe (left): resting size = the enlarged size; still enlarges further when active */
.loop__ext[data-pos="left"] .loop__tile svg { width: calc(var(--loop-node, 58px) * 0.9); height: calc(var(--loop-node, 58px) * 0.9); }
.loop__ext[data-pos="left"]:hover .loop__tile,
.loop__ext[data-pos="left"].is-outer .loop__tile { transform: scale(1.4); }
.loop__ext:hover .loop__tile svg,
.loop__ext.is-active .loop__tile svg { }
.loop__extlabel { position: absolute; left: 50%; top: calc(100% + 9px); transform: translateX(-50%); width: 172px; text-align: center; pointer-events: auto; cursor: pointer; }
.loop__ext[data-pos="top"] .loop__extlabel { top: auto; bottom: calc(100% + 9px); }
.loop__ext[data-pos="left"] .loop__extlabel { top: calc(100% - 4px); left: calc(50% - 12px); }
.loop__ext[data-pos="right"] .loop__extlabel { top: calc(100% - 2px); }
.loop__ext[data-pos="bottom"] .loop__extlabel { top: calc(100% + 2px); }
.loop__ext[data-pos="top"].loop__ext--bare .loop__extlabel { top: 50%; bottom: auto; transform: translate(-50%, -50%); width: max-content; white-space: nowrap; }
.loop__extlabel .t { display: block; font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.18; }
.loop__extlabel .s { display: block; font-size: 11px; color: var(--ink-3); margin-top: 1px; }
.loop__ext[data-pos="top"] .loop__extlabel .t { font-size: 14px; font-weight: 600; }
.loop__ext[data-pos="top"].is-outer .loop__extlabel .t { font-weight: 800; color: color-mix(in oklab, var(--seg, var(--accent)), #000 6%); }
.loop__ext[data-pos="top"].is-outer .loop__extlabel .s { color: var(--ink); font-weight: 600; }
.loop__ext.is-outer .loop__extlabel .t { font-weight: 800; color: var(--ink); }
.loop__badges { display: flex; gap: 3px; justify-content: center; margin: 6px 0 4px; }
.loop__sidebadges { position: absolute; transform: translateY(-50%); display: flex; flex-direction: column; gap: 3px; cursor: pointer; z-index: 4; }
.loop__sidebadges .loop__badge { width: 21px; height: 21px; }
.loop__sidebadges .loop__badge svg { width: 14px; height: 14px; }
.loop__sidebadges.is-on .loop__badge { background: color-mix(in oklab, var(--seg, var(--accent)), #fff 84%); border-color: color-mix(in oklab, var(--seg, var(--accent)), #fff 50%); color: color-mix(in oklab, var(--seg, var(--accent)), #000 6%); }
.loop__badge { width: 21px; height: 21px; border-radius: 50%; background: #EEF1F4; border: 1px solid #DDE2E8; color: #98A3B0; display: grid; place-items: center; transition: background .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease); }
.loop__badge svg { width: 14px; height: 14px; }
.loop__ext.is-outer .loop__badge { background: color-mix(in oklab, var(--seg, var(--accent)), #fff 84%); border-color: color-mix(in oklab, var(--seg, var(--accent)), #fff 50%); color: color-mix(in oklab, var(--seg, var(--accent)), #000 6%); }

/* ---------- centre hub: Markedsføring ---------- */
.loop__hub {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: var(--loop-hub, 84px); height: var(--loop-hub, 84px);
  display: grid; place-items: center; cursor: pointer; color: #2B43C4; border: none;
  background: none; box-shadow: none; padding: 0;
  transition: transform .3s var(--ease), color .3s var(--ease);
}
.loop__hub:hover, .loop.is-active .loop__hub { transform: translate(-50%, -50%) scale(2); color: #1E2F9E; }
.loop__hub svg { width: calc(var(--loop-hub, 84px) * 0.74); height: calc(var(--loop-hub, 84px) * 0.74); }
.loop__hublogo { width: calc(var(--loop-node, 58px) * 0.5); height: calc(var(--loop-node, 58px) * 0.5); object-fit: contain; display: block; transition: transform .3s var(--ease); }
.loop__hub .hub-t { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 14px; font-weight: 800; color: #2B43C4; letter-spacing: -.01em; }
.loop__hub .hub-s { position: absolute; top: -24px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-4); }

/* ---------- tooltip ---------- */
.loop-tip {
  position: absolute; transform: translate(-50%, -100%);
  background: var(--ink); color: #fff; padding: 9px 13px; border-radius: 11px;
  font-size: 12.5px; font-weight: 600; line-height: 1.35; max-width: 230px; text-align: center;
  box-shadow: 0 16px 32px -12px rgba(14,26,43,.5); pointer-events: none; z-index: 20;
  opacity: 0; transition: opacity .16s var(--ease); margin-top: -10px;
}
.loop-tip.show { opacity: 1; }
.loop-tip::after { content: ""; position: absolute; left: 50%; top: 100%; transform: translateX(-50%); border: 6px solid transparent; border-top-color: var(--ink); }

/* ---------- corner content boxes ---------- */
.loop-box { position: absolute; width: min(31%, 340px); min-height: 150px; background: var(--bg); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-card); padding: 18px 20px; z-index: 5; pointer-events: none; display: grid; place-items: center; }
.loop-box--1 { top: 0; left: 0; }
.loop-box--2 { top: 0; right: 0; }
.loop-box--3 { top: 56%; left: 0; }
.loop-box--4 { top: 56%; right: 0; }
.loop-box__num { font-size: 56px; font-weight: 800; color: var(--line); letter-spacing: -.03em; }
@media (max-width: 860px) { .loop-box { display: none; } }

/* ---------- detail panel ---------- */
.loop-detail {
  margin-top: clamp(34px, 5vw, 60px);
  display: grid; grid-template-columns: 1fr 360px; gap: clamp(24px, 4vw, 48px);
  align-items: center; min-height: 260px;
}
.loop-detail__text { max-width: 540px; }
.loop-detail__head { display: flex; align-items: center; gap: 14px; }
.loop-detail__icon { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 13px; background: var(--accent-soft); color: var(--accent-strong); display: grid; place-items: center; }
.loop-detail__icon svg { width: 23px; height: 23px; }
.loop-detail__title { font-size: clamp(22px, 2.6vw, 30px); font-weight: 700; letter-spacing: -.02em; color: var(--ink); margin: 0; }
.loop-detail__tag { font-size: 14px; font-weight: 600; color: var(--accent-strong); margin: 6px 0 0; }
.loop-detail__desc { font-size: 16.5px; line-height: 1.6; color: var(--ink-3); margin: 16px 0 0; text-wrap: pretty; }
.loop-detail__link { display: inline-flex; align-items: center; gap: 8px; margin-top: 22px; font-size: 15px; font-weight: 600; color: var(--accent-strong); }
.loop-detail__link svg { width: 16px; height: 16px; transition: transform .18s var(--ease); }
.loop-detail__link:hover svg { transform: translateX(3px); }
.loop-anim { animation: detIn .45s var(--ease); }
@keyframes detIn { from { transform: translateY(10px); } to { transform: none; } }

/* mockup card */
.mock { background: var(--bg); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-card); overflow: hidden; width: 100%; max-width: 360px; justify-self: end; }
.mock__hd { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.mock__hd .t { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.mock__hd .pill { font-size: 11px; font-weight: 700; color: #fff; background: var(--accent); border-radius: 999px; padding: 4px 10px; }
.mock__hd .pill.blue { background: var(--sms-blue); }
.mock__hd .pill.green { background: var(--success); }
.mock__body { padding: 14px 16px; display: grid; gap: 9px; }
.mock__row { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; }
.mock__row .av { width: 28px; height: 28px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-strong); font-size: 11px; font-weight: 700; display: grid; place-items: center; flex: 0 0 auto; }
.mock__row .nm { flex: 1; min-width: 0; }
.mock__row .nm b { display: block; font-size: 12.5px; color: var(--ink); font-weight: 700; }
.mock__row .nm span { font-size: 11px; color: var(--ink-3); }
.mock__row .add { font-size: 11px; font-weight: 700; color: #fff; background: var(--accent); border-radius: 999px; padding: 5px 11px; flex: 0 0 auto; }
.mock__row .conn { font-size: 11.5px; font-weight: 700; color: var(--success); flex: 0 0 auto; }
.mock__rating { display: flex; align-items: center; justify-content: space-between; }
.mock__rating .mock__stars svg { width: 17px; height: 17px; }
.mock__route { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 4px 10px; }
.mock__route.warn { color: var(--accent-strong); background: var(--accent-tint); }
.mock__bubble { font-size: 12px; line-height: 1.4; padding: 9px 12px; border-radius: 14px; }
.mock__bubble.out { background: var(--sms-blue); color: #fff; border-bottom-right-radius: 5px; align-self: flex-end; max-width: 85%; }
.mock__bubble.in { background: #fff; border: 1px solid var(--line); color: var(--ink); border-bottom-left-radius: 5px; max-width: 85%; }
.mock__cal { display: flex; align-items: center; gap: 10px; background: var(--accent-tint); border: 1px solid color-mix(in oklab, var(--accent), #fff 60%); border-radius: 11px; padding: 10px 12px; }
.mock__cal .tm { font-size: 11px; font-weight: 800; color: var(--accent-strong); }
.mock__cal .ev b { font-size: 12px; color: var(--ink); display: block; }
.mock__cal .ev span { font-size: 11px; color: var(--ink-3); }
.mock__stars { display: flex; gap: 3px; }
.mock__stars svg { width: 18px; height: 18px; color: var(--accent); }
.mock__rank { display: flex; align-items: center; gap: 9px; font-size: 12.5px; font-weight: 700; color: var(--ink); }
.mock__rank .hash { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.mock__note { font-size: 11.5px; color: var(--ink-3); background: var(--bg-soft); border: 1px dashed var(--line); border-radius: 10px; padding: 9px 11px; }
.mock__stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.mock__stat { border: 1px solid var(--line); border-radius: 11px; padding: 10px; text-align: center; }
.mock__stat .v { font-size: 18px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.mock__stat .v small { color: var(--success); font-size: 11px; }
.mock__stat .l { font-size: 10px; color: var(--ink-3); margin-top: 1px; }
.mock__bars { display: flex; align-items: flex-end; gap: 6px; height: 60px; margin-top: 4px; }
.mock__bars i { flex: 1; background: var(--accent-soft); border-radius: 4px 4px 0 0; }
.mock__bars i.hot { background: var(--accent); }
.mock__chips { display: flex; gap: 7px; flex-wrap: wrap; }
.mock__chip { font-size: 11.5px; font-weight: 600; color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 11px; display: inline-flex; gap: 6px; align-items: center; }
.mock__chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.mock__feed { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 12.5px; font-weight: 700; color: var(--accent-strong); padding: 4px 0; }
.mock__feed svg { width: 16px; height: 16px; }

@media (max-width: 860px) {
  .loop__label .t, .loop__extlabel .t { font-size: 11.5px; }
  .loop__label .s, .loop__extlabel .s { font-size: 10px; }
  .loop-detail { grid-template-columns: 1fr; gap: 26px; }
  .mock { justify-self: start; }
}
@media (prefers-reduced-motion: reduce) {
  .loop__flow, .loop__spokeflow, .loop__arrowflow, .loop__pulse { animation: none; }
}
.loop.no-flow .loop__flow, .loop.no-flow .loop__spokeflow, .loop.no-flow .loop__arrowflow, .loop.no-flow .loop__pulse { animation: none; }
