/* Berri Connections: directory and detail pages. Prefix cn-. Builds on b2, home, product (pd-) and family (fm-).
   Logos are Simple Icons marks, unmodified, in brand colour on a white tile (single ink in dark theme).
   Transform and opacity only; every start state is scoped to html.js; reduced motion is static. */

.cn-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Logo tiles ---------- */
.cn-tile { flex: none; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: #fff; border: 1px solid var(--b2-line); box-shadow: 0 1px 0 #fff inset, 0 8px 18px -12px rgb(27 26 31 / .32); }
.cn-tile img { width: 28px; height: 28px; display: block; }
.cn-tile--s { width: 32px; height: 32px; border-radius: 10px; box-shadow: none; }
.cn-tile--s img { width: 18px; height: 18px; }
.cn-tile--l { width: clamp(72px, 14vw, 96px); height: clamp(72px, 14vw, 96px); border-radius: 28%; box-shadow: 0 1px 0 #fff inset, 0 26px 50px -24px rgb(120 40 70 / .45); }
.cn-tile--l img { width: 50%; height: 50%; }
.cn-tile--glyph { background: var(--b2-bg-soft); border-style: dashed; border-color: var(--b2-line-strong); }
.cn-tile--glyph svg { width: 28px; height: 28px; fill: none; stroke: var(--b2-ink-2); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.cn-tile--s.cn-tile--glyph svg { width: 18px; height: 18px; }
.cn-tile--l.cn-tile--glyph svg { width: 46%; height: 46%; }
:root[data-theme="dark"] .cn-tile { background: var(--b2-surface); box-shadow: none; }
:root[data-theme="dark"] .cn-tile:not(.cn-tile--own) img { filter: brightness(0) invert(.94); }

/* ---------- Hub: logo nodes ---------- */
.cn-hub .cn-hubnode { gap: 10px; padding: 7px 14px 7px 7px; }
.cn-hub .cn-hubnode .cn-tile { border-radius: 999px; }
.cn-hub .cn-hubnode i.cn-dot { width: 7px; height: 7px; border-radius: 50%; margin-left: 2px; }
.cn-dot--now { background: var(--b2-leaf) !important; }
.cn-dot--req { background: var(--b2-mango) !important; }
.cn-dot--soon { background: transparent !important; box-shadow: inset 0 0 0 1.5px var(--b2-ink-3); }
@media (max-width: 560px) { .cn-hub .cn-hubnode { padding: 5px 10px 5px 5px; gap: 7px; } .cn-hub .cn-hubnode .cn-tile { width: 26px; height: 26px; } .cn-hub .cn-hubnode .cn-tile img { width: 15px; height: 15px; } }

/* ---------- Directory ---------- */
.cn-dir { padding-top: clamp(56px, 8vw, 96px); }
.cn-dir__top { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 20px 32px; }
.cn-find { position: relative; flex: 1 1 280px; max-width: 420px; }
.cn-find svg { position: absolute; left: 18px; top: 50%; width: 20px; height: 20px; translate: 0 -50%; fill: none; stroke: var(--b2-ink-3); stroke-width: 1.8; stroke-linecap: round; pointer-events: none; }
.cn-find__in { width: 100%; min-height: 52px; padding: 0 20px 0 48px; border-radius: 999px; border: 1px solid var(--b2-line-strong); background: var(--b2-surface); color: var(--b2-ink); font: 500 16px/1 var(--b2-body); box-shadow: 0 10px 26px -18px rgb(27 26 31 / .35); transition: box-shadow .3s var(--b2-ease), border-color .3s; }
.cn-find__in::placeholder { color: var(--b2-ink-3); }
.cn-find__in:focus-visible { outline: none; border-color: var(--b2-ink); box-shadow: 0 0 0 3px var(--b2-berry-soft), 0 14px 30px -18px rgb(27 26 31 / .4); }

.cn-chips { display: flex; gap: 8px; margin: 28px calc(var(--b2-gutter) * -1) 0; padding: 2px var(--b2-gutter) 6px; overflow-x: auto; scrollbar-width: none; }
.cn-chips::-webkit-scrollbar { display: none; }
.cn-chip { flex: none; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--b2-line); background: rgb(255 255 255 / .7); color: var(--b2-ink-2); font: 600 .9rem/1 var(--b2-body); cursor: pointer; transition: background-color .25s, color .25s, border-color .25s, transform .25s var(--b2-ease); }
.cn-chip:hover { transform: translateY(-1px); border-color: var(--b2-line-strong); }
.cn-chip[aria-pressed="true"] { background: var(--b2-ink); border-color: var(--b2-ink); color: var(--b2-bg); }
.cn-chip:focus-visible { outline: 2px solid var(--b2-focus); outline-offset: 2px; }

.cn-grid { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 2vw, 20px); }
.cn-card { position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr); grid-template-rows: auto auto 1fr auto; gap: 6px 16px; align-content: start; padding: 22px 22px 18px; border-radius: 24px; background: rgb(255 255 255 / .82); border: 1px solid var(--b2-line); box-shadow: 0 1px 0 #fff inset; transition: transform .45s var(--b2-ease), box-shadow .45s var(--b2-ease), opacity .7s var(--b2-ease); }
.cn-card[hidden] { display: none; }
.cn-card > .cn-tile { grid-row: span 2; transition: transform .45s var(--b2-ease); }
.cn-card h3 { margin: 4px 0 0; font: 650 1.15rem/1.25 var(--b2-display); letter-spacing: -.012em; }
.cn-card h3 a { color: inherit; text-decoration: none; }
.cn-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.cn-card .fm-tag { justify-self: start; }
.cn-card p { grid-column: 1 / -1; margin: 10px 0 0; color: var(--b2-ink-2); }
.cn-card__foot { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--b2-line); font: 500 .8rem/1.2 var(--b2-body); color: var(--b2-ink-3); }
.cn-card__go { color: var(--b2-ink); font-weight: 600; }
.cn-card__go::after { content: "\2192"; display: inline-block; margin-left: 6px; transition: transform .3s var(--b2-ease); }
.cn-card:hover { transform: translateY(-4px); box-shadow: 0 1px 0 #fff inset, 0 26px 50px -24px rgb(27 26 31 / .28); }
.cn-card:hover > .cn-tile { transform: scale(1.06) rotate(-3deg); }
.cn-card:hover .cn-card__go::after { transform: translateX(4px); }
.cn-card:has(a:focus-visible) { outline: 2px solid var(--b2-focus); outline-offset: 3px; }
.cn-card h3 a:focus-visible { outline: none; }
.cn-card--now { border-color: #CBE6D8; background: linear-gradient(160deg, #F4FBF7, rgb(255 255 255 / .9) 55%); }
.cn-card--soon { background: rgb(255 255 255 / .6); }
/* staggered reveal across each row */
.js .cn-grid > .b2-rise:nth-child(3n+2) { transition-delay: .08s; }
.js .cn-grid > .b2-rise:nth-child(3n) { transition-delay: .16s; }
.cn-empty { margin: 32px 0 0; padding: 28px; border-radius: 20px; border: 1px dashed var(--b2-line-strong); text-align: center; color: var(--b2-ink-2); }
.cn-count { margin: 16px 0 0; min-height: 1.2em; font-size: .85rem; color: var(--b2-ink-3); }
@media (max-width: 1000px) { .cn-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .cn-grid { grid-template-columns: minmax(0, 1fr); } .cn-find { max-width: none; } }

/* ---------- Detail hero: Berri + logo lockup with a line that draws itself ---------- */
.cn-hero .hm-hero__in { justify-items: center; text-align: center; }
.cn-back { justify-self: center; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; margin-bottom: 8px; border-radius: 999px; background: rgb(255 255 255 / .7); border: 1px solid var(--b2-line); color: var(--b2-ink-2); font: 600 .86rem/1 var(--b2-body); text-decoration: none; transition: transform .3s var(--b2-ease); }
.cn-back::before { content: "\2190"; transition: transform .3s var(--b2-ease); }
.cn-back:hover::before { transform: translateX(-3px); }
.cn-lock { display: flex; align-items: center; justify-content: center; margin: 12px auto 28px; }
.cn-lock__line { width: clamp(64px, 16vw, 150px); height: 20px; overflow: visible; }
.cn-lock__line path { fill: none; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.cn-lock__base { stroke: rgb(27 26 31 / .16); stroke-width: 1.5; stroke-dasharray: 3 6; }
.cn-lock__draw { stroke: var(--b2-ink); stroke-width: 1.5; }
.cn-lock__pulse { stroke: var(--b2-strawberry); stroke-width: 4; stroke-dasharray: .1 1; stroke-dashoffset: 1; opacity: 0; }
@keyframes cn-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes cn-run { 0% { stroke-dashoffset: 1.1; opacity: 1; } 70% { opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes cn-pop { from { opacity: 0; transform: scale(.82) translateY(8px); } }
.js .cn-lock__draw { stroke-dasharray: 1; animation: cn-draw 1s var(--b2-ease) .35s both; }
.js .cn-lock__pulse { animation: cn-run 2.6s var(--b2-ease) 1.4s infinite; }
.js .cn-lock > .cn-tile { animation: cn-pop .7s cubic-bezier(.3, 1.3, .5, 1) both; }
.js .cn-lock > .cn-tile:last-child { animation-delay: .9s; }
.cn-h1 { max-width: 18ch; }
.cn-status { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; margin: 18px 0 0; }
.cn-status__cat { font: 500 .85rem/1 var(--b2-body); color: var(--b2-ink-3); }
.cn-hero .hm-hero__lede { margin-top: 18px; }

/* ---------- Detail body ---------- */
.cn-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 2.6vw, 28px); }
.cn-block { padding: clamp(24px, 3vw, 36px); border-radius: 26px; background: rgb(255 255 255 / .82); border: 1px solid var(--b2-line); box-shadow: 0 1px 0 #fff inset; }
.cn-h2 { margin: 0 0 20px; font: 650 clamp(1.35rem, 2.4vw, 1.75rem)/1.2 var(--b2-display); letter-spacing: -.02em; }
.cn-ticks, .cn-steps, .cn-see ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.cn-ticks li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; }
.cn-ticks li::before { content: ""; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; background: #E3F3EA url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M6.5 11.5l3 3 6-6.5' fill='none' stroke='%232F8F6B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 22px no-repeat; }
.cn-steps { gap: 0; }
.cn-steps li { position: relative; padding: 0 0 20px 34px; }
.cn-steps li::before { content: ""; position: absolute; left: 4px; top: 5px; width: 13px; height: 13px; border-radius: 50%; background: var(--b2-surface); box-shadow: inset 0 0 0 2px var(--b2-strawberry); }
.cn-steps li:not(:last-child)::after { content: ""; position: absolute; left: 10px; top: 22px; bottom: 2px; width: 1.5px; background: var(--b2-line-strong); }
.cn-steps li:last-child { padding-bottom: 0; }
.cn-note { margin: 22px 0 0; padding: 14px 16px; border-radius: 16px; background: var(--b2-bg-soft); font-size: .92rem; color: var(--b2-ink-2); }
.cn-note a, .cn-empty a { color: var(--b2-berry-ink); font-weight: 600; }
.cn-see { margin-top: clamp(28px, 4vw, 44px); }
.cn-see h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; font: 650 1.15rem/1.2 var(--b2-display); }
.cn-see h3::before { content: ""; width: 10px; height: 10px; border-radius: 50%; }
.cn-block--can h3::before { background: var(--b2-leaf); }
.cn-block--not h3::before { background: transparent; box-shadow: inset 0 0 0 2px var(--b2-strawberry); }
.cn-see li { padding-left: 18px; position: relative; color: var(--b2-ink-2); }
.cn-see li::before { content: ""; position: absolute; left: 0; top: .7em; width: 6px; height: 1.5px; background: var(--b2-ink-3); }
.cn-fine { margin: 24px 0 0; font-size: .9rem; color: var(--b2-ink-3); }
.cn-mini { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.cn-mini a { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: center; gap: 8px 12px; min-height: 64px; padding: 14px 16px; border-radius: 18px; background: rgb(255 255 255 / .8); border: 1px solid var(--b2-line); color: var(--b2-ink); text-decoration: none; font-weight: 600; transition: transform .35s var(--b2-ease), box-shadow .35s var(--b2-ease); }
.cn-mini a .fm-tag { grid-column: 1 / -1; justify-self: start; }
.cn-mini a:hover { transform: translateY(-3px); box-shadow: 0 18px 36px -22px rgb(27 26 31 / .3); }
.cn-all { margin-top: 24px; }
@media (max-width: 860px) { .cn-two { grid-template-columns: minmax(0, 1fr); } .cn-mini { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Trademark notice: last thing in main, just above the footer */
.cn-tm { margin: 0 auto; padding-block: 28px; border-top: 1px solid var(--b2-line); font-size: .8rem; line-height: 1.5; color: var(--b2-ink-3); text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .js .cn-lock__draw, .js .cn-lock > .cn-tile { animation: none; stroke-dasharray: none; }
  .js .cn-lock__pulse { animation: none; opacity: 0; }
  .cn-card, .cn-card > .cn-tile, .cn-chip, .cn-mini a, .cn-card__go::after { transition: none !important; }
  .cn-card:hover, .cn-card:hover > .cn-tile, .cn-mini a:hover { transform: none; }
}
.is-still .cn-lock__pulse { animation: none; opacity: 0; }
