/* Berri product family pages: /product/chat/, /cowork/, /code/, /projects/, /mods/, /connectors/, /enterprise/.
   Prefix fm-. Builds on /b2.css, /home.css, /home-motion.css and /product/product.css (pd- story, photos, FAQ).
   Transform and opacity only. Every start state is scoped to html.js or a scroll timeline that only moves things. */

/* ---------- Status tags: one look per state, used on every feature ---------- */
.fm-tag { display: inline-flex; align-items: center; gap: 7px; min-height: 26px; padding: 0 11px 0 9px; border-radius: 999px; font: 600 .76rem/1 var(--b2-body); letter-spacing: 0; white-space: nowrap; background: rgb(255 255 255 / .85); border: 1px solid var(--b2-line); color: var(--b2-ink-2); vertical-align: middle; }
.fm-tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--b2-ink-3); }
.fm-tag--now { border-color: #CBE6D8; color: #1D5A43; }
.fm-tag--now::before { background: var(--b2-leaf); animation: pd-beat 2.4s ease-out infinite; }
.fm-tag--roll { border-color: #D6DBF6; color: #2E3290; }
.fm-tag--roll::before { background: var(--b2-blueberry); }
.fm-tag--req { border-color: #F1DFAE; color: #7A5410; }
.fm-tag--req::before { background: var(--b2-mango); }
.fm-tag--built { border-color: #F3CCDA; color: #7A1238; }
.fm-tag--built::before { background: var(--b2-strawberry); }
.fm-tag--soon::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--b2-ink-3); }

/* Under the hero: the family, each with its state */
.fm-fam { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; list-style: none; margin: 24px 0 0; padding: 0; }
.fm-fam a { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 8px 0 16px; border-radius: 999px; background: rgb(255 255 255 / .75); border: 1px solid var(--b2-line); text-decoration: none; font-size: .9rem; color: var(--b2-ink); transition: transform .3s var(--b2-ease), box-shadow .3s var(--b2-ease); }
.fm-fam a:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -14px rgb(27 26 31 / .35); }
.fm-fam a[aria-current="page"] { background: var(--b2-surface); border-color: var(--b2-line-strong); padding-right: 16px; font-weight: 600; box-shadow: 0 8px 20px -14px rgb(120 40 70 / .45); }
.fm-fam a[aria-current="page"]::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--b2-strawberry); }
.fm-fam a:not([aria-current]) { padding-right: 16px; }
.fm-fam .fm-tag { min-height: 26px; }
.js .fm-fam { animation: hm-fade-up .5s var(--b2-ease) .45s both; }
.is-instant .fm-fam { animation: none; }

/* Copy blocks that carry a tag above the headline */
.fm-cap-tag { margin-bottom: -4px; }

/* ---------- Ledger: everything on the page, with its state ---------- */
.fm-ledger { list-style: none; margin: clamp(36px, 5vw, 56px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.fm-ledger li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; align-items: start; padding: 22px 22px 24px; border-radius: 20px; background: rgb(255 255 255 / .78); 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); }
.fm-ledger li:hover { transform: translateY(-3px); box-shadow: 0 1px 0 #fff inset, 0 22px 44px -22px rgb(27 26 31 / .25); }
.fm-ledger h3 { margin: 0; font: 650 1.12rem/1.3 var(--b2-display); letter-spacing: -.012em; }
.fm-ledger p { grid-column: 1 / -1; margin: 0; color: var(--b2-ink-2); }
.fm-ledger .fm-tag { justify-self: end; }
.fm-ledger--soon li { background: rgb(255 255 255 / .5); border-style: dashed; }
@media (max-width: 760px) { .fm-ledger { grid-template-columns: minmax(0, 1fr); } }
.fm-ledger-h { margin: clamp(56px, 8vw, 88px) 0 0; font: 650 clamp(1.3rem, 2.4vw, 1.6rem)/1.2 var(--b2-display); letter-spacing: -.02em; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- Connection cards with drawn, brand-neutral glyphs ---------- */
.fm-conn { list-style: none; margin: clamp(36px, 5vw, 56px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 2vw, 20px); }
.fm-conn > li { position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr); grid-template-rows: auto auto 1fr; gap: 8px 16px; align-content: start; padding: 24px 22px 26px; border-radius: 24px; background: rgb(255 255 255 / .8); 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); }
.fm-conn > li:hover { transform: translateY(-4px); box-shadow: 0 1px 0 #fff inset, 0 26px 50px -24px rgb(27 26 31 / .28); }
.fm-conn .pd-ico { grid-row: span 2; width: 56px; height: 56px; padding: 11px; border-radius: 16px; background: var(--b2-bg-soft); }
.fm-conn h3 { margin: 0; font: 650 1.15rem/1.25 var(--b2-display); letter-spacing: -.012em; }
.fm-conn .fm-tag { justify-self: start; }
.fm-conn p { grid-column: 1 / -1; margin: 6px 0 0; color: var(--b2-ink-2); }
.fm-conn .hm-link { grid-column: 1 / -1; justify-self: start; align-self: end; margin-top: 4px; }
.fm-conn > li:has(.fm-tag--now) { border-color: #CBE6D8; background: linear-gradient(160deg, #F4FBF7, rgb(255 255 255 / .85) 55%); }
@media (max-width: 1000px) { .fm-conn { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .fm-conn { grid-template-columns: minmax(0, 1fr); } }
.fm-group { margin-top: clamp(56px, 8vw, 88px); }
.fm-group:first-of-type { margin-top: 0; }

/* ---------- A drawn hub: Berri in the middle, the doors around it ---------- */
.fm-hub { position: relative; max-width: 900px; margin: clamp(48px, 7vw, 72px) auto 0; aspect-ratio: 16 / 9; }
.fm-hub svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.fm-hub__line { fill: none; stroke: rgb(27 26 31 / .2); stroke-width: 1.5; stroke-dasharray: 3 6; }
.fm-hub__pulse { fill: none; stroke-width: 3.2; stroke-linecap: round; stroke-dasharray: .14 1; stroke-dashoffset: 1; }
.fm-hub__pulse--g { stroke: var(--b2-leaf); } .fm-hub__pulse--b { stroke: var(--b2-blueberry); } .fm-hub__pulse--m { stroke: var(--b2-mango); } .fm-hub__pulse--s { stroke: var(--b2-strawberry); }
@keyframes fm-flow { to { stroke-dashoffset: 0; } }
.js .fm-hub.is-in .fm-hub__pulse, .js .b2-rise.is-in .fm-hub__pulse { animation: fm-flow 3.2s linear infinite; }
.fm-hub__pulse:nth-of-type(2n) { animation-delay: -1.1s !important; }
.fm-hub__pulse:nth-of-type(3n) { animation-delay: -2.2s !important; }
.fm-hub__core { position: absolute; left: 50%; top: 50%; width: clamp(84px, 13vw, 112px); aspect-ratio: 1; translate: -50% -50%; display: grid; place-items: center; border-radius: 30%; background: var(--b2-surface); box-shadow: 0 0 0 10px rgb(255 255 255 / .6), 0 30px 60px -20px rgb(120 40 70 / .45); }
.fm-hub__core img { width: 48%; height: auto; }
.fm-hub__node { position: absolute; translate: -50% -50%; display: inline-flex; align-items: center; gap: 8px; padding: 11px 16px; border-radius: 999px; background: rgb(255 255 255 / .94); border: 1px solid var(--b2-line); box-shadow: 0 14px 30px -16px rgb(27 26 31 / .35); font: 600 .92rem/1 var(--b2-body); white-space: nowrap; }
.fm-hub__node i { width: 8px; height: 8px; border-radius: 50%; background: var(--b2-leaf); }
.fm-hub__node--req i { background: var(--b2-mango); } .fm-hub__node--soon i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--b2-ink-3); }
.fm-n1 { left: 14%; top: 18%; } .fm-n2 { left: 86%; top: 18%; } .fm-n3 { left: 8%; top: 52%; } .fm-n4 { left: 92%; top: 52%; } .fm-n5 { left: 18%; top: 86%; } .fm-n6 { left: 82%; top: 86%; }
@keyframes fm-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.js .fm-hub__node { animation: fm-bob 5s var(--b2-ease) infinite; }
.fm-hub__node:nth-of-type(2n) { animation-delay: -1.6s; } .fm-hub__node:nth-of-type(3n) { animation-delay: -3.1s; }
@media (max-width: 560px) { .fm-hub { aspect-ratio: 4 / 5; } .fm-hub svg { display: none; } .fm-hub__node { font-size: .74rem; padding: 7px 10px; } .fm-n1 { left: 26%; top: 10%; } .fm-n2 { left: 74%; top: 10%; } .fm-n3 { left: 22%; top: 34%; } .fm-n4 { left: 78%; top: 66%; } .fm-n5 { left: 26%; top: 90%; } .fm-n6 { left: 74%; top: 90%; } }

/* ---------- Terminal frame for the command line page (no command until one is published) ---------- */
.fm-term { position: relative; border-radius: 22px; background: #1F1E24; color: #F3F0EA; box-shadow: 0 1px 0 rgb(255 255 255 / .08) inset, 0 40px 80px -30px rgb(27 26 31 / .55); overflow: hidden; font: 500 .9rem/1.75 var(--b2-mono); }
.fm-term__bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid rgb(255 255 255 / .08); }
.fm-term__bar i { width: 11px; height: 11px; border-radius: 50%; background: #3A3842; }
.fm-term__bar i:nth-child(1) { background: #E46A86; } .fm-term__bar i:nth-child(2) { background: #E8B44F; } .fm-term__bar i:nth-child(3) { background: #5DB38E; }
.fm-term__bar span { margin-left: 8px; font: 600 .78rem/1 var(--b2-body); color: #B9B4C2; }
.fm-term__body { padding: 20px 20px 26px; display: grid; gap: 6px; min-height: 220px; align-content: start; }
.fm-term__body p { margin: 0; white-space: pre-wrap; word-break: break-word; }
.fm-term__dim { color: #8F8A99; }
.fm-term__body b { color: #F6E2A8; font-weight: 500; }
.fm-term__body em { color: #F6C1D3; font-style: normal; }
.fm-caret { display: inline-block; width: .6em; height: 1.1em; vertical-align: -.2em; background: #F6C1D3; }
@keyframes fm-blink { 50% { opacity: 0; } }
.js .fm-caret { animation: fm-blink 1.1s steps(1) infinite; }
.fm-term .fm-tag { position: absolute; right: 14px; top: 9px; background: rgb(255 255 255 / .08); border-color: rgb(255 255 255 / .14); color: #E9E5EF; }

/* ---------- Settings panel drawing for Mods ---------- */
.fm-set { position: relative; border-radius: 26px; background: var(--b2-surface); border: 1px solid var(--b2-line); box-shadow: 0 1px 0 #fff inset, 0 40px 80px -34px rgb(120 40 70 / .38); padding: clamp(18px, 3vw, 28px); display: grid; gap: 18px; text-align: left; }
.fm-set__h { display: flex; align-items: center; gap: 10px; margin: 0; font: 650 1.05rem/1.2 var(--b2-display); }
.fm-set__h img { width: 22px; height: 22px; }
.fm-set__row { display: grid; gap: 9px; padding-top: 16px; border-top: 1px solid var(--b2-line); }
.fm-set__k { display: flex; align-items: center; justify-content: space-between; gap: 10px; font: 600 .82rem/1.2 var(--b2-body); color: var(--b2-ink-2); }
.fm-set__box { padding: 12px 14px; border-radius: 14px; background: var(--b2-bg-soft); border: 1px solid var(--b2-line); font-size: .9rem; line-height: 1.5; color: var(--b2-ink); }
.fm-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.fm-seg span { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--b2-line); background: #fff; font-size: .85rem; }
.fm-seg .is-sel { border-color: var(--b2-ink); box-shadow: inset 0 0 0 1px var(--b2-ink); font-weight: 600; }
.fm-swatch { display: flex; gap: 10px; }
.fm-swatch i { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--b2-line); background: linear-gradient(135deg, #FAF7F2 50%, #F1E9DD 50%); }
.fm-swatch i:nth-child(2) { background: linear-gradient(135deg, #2A2830 50%, #1B1A1F 50%); }
.fm-swatch i:nth-child(3) { background: linear-gradient(135deg, #FAF7F2 50%, #1B1A1F 50%); }
.fm-swatch i.is-sel { box-shadow: 0 0 0 2px var(--b2-surface), 0 0 0 4px var(--b2-ink); }
/* A gentle highlight sweeps down the settings rows, one after another */
@keyframes fm-sweep { 0%, 12% { opacity: 0; transform: translateX(-14px); } 22%, 40% { opacity: 1; transform: none; } 55%, 100% { opacity: 0; transform: none; } }
.fm-set__row { position: relative; }
.fm-set__row::after { content: ""; position: absolute; left: -12px; top: 18px; width: 4px; height: 22px; border-radius: 4px; background: var(--b2-strawberry); opacity: 0; }
.js .b2-rise.is-in .fm-set__row::after { animation: fm-sweep 8s var(--b2-ease) infinite; }
.fm-set__row:nth-of-type(2)::after { animation-delay: 2s !important; background: var(--b2-blueberry); }
.fm-set__row:nth-of-type(3)::after { animation-delay: 4s !important; background: var(--b2-mango); }
.fm-set__row:nth-of-type(4)::after { animation-delay: 6s !important; background: var(--b2-leaf); }

/* ---------- Mode picker drawing for Chat ---------- */
.fm-modes { list-style: none; margin: 0; padding: clamp(14px, 2.4vw, 20px); display: grid; gap: 8px; border-radius: 24px; background: var(--b2-surface); border: 1px solid var(--b2-line); box-shadow: 0 1px 0 #fff inset, 0 40px 80px -34px rgb(120 40 70 / .35); }
.fm-modes li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 2px 14px; align-items: center; padding: 12px 14px; border-radius: 16px; }
.fm-modes li.is-sel { background: var(--b2-bg-soft); box-shadow: inset 0 0 0 1px var(--b2-line); }
.fm-modes .hm-fruit { grid-row: span 2; width: 40px; height: 40px; border-radius: 12px; }
.fm-modes .hm-fruit i { width: 22px; height: 22px; }
.fm-modes b { font: 650 1rem/1.2 var(--b2-display); }
.fm-modes span.fm-modes__l { grid-column: 2; font-size: .85rem; color: var(--b2-ink-2); }
.fm-modes .fm-tag { grid-row: 1 / span 2; grid-column: 3; }
.fm-auto { width: 40px; height: 40px; grid-row: span 2; border-radius: 12px; background: conic-gradient(from 200deg, var(--b2-light-berry), var(--b2-light-gold), var(--b2-light-berry)); display: grid; place-items: center; }
.fm-auto::after { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--b2-surface); box-shadow: 0 0 0 4px rgb(255 255 255 / .5); }
@keyframes fm-turn { to { transform: rotate(1turn); } }
.js .b2-rise.is-in .fm-auto { animation: fm-turn 9s linear infinite; }

/* ---------- Approval card preview (Soon) inside a scene ---------- */
.fm-ask { display: grid; gap: 10px; padding: 14px; border-radius: 16px; border: 1px dashed var(--b2-line-strong); background: rgb(255 255 255 / .6); }
.fm-ask__h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0; font: 600 .86rem/1.3 var(--b2-body); }
.fm-ask__b { display: flex; gap: 8px; }
.fm-ask__b span { display: inline-flex; align-items: center; min-height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--b2-line-strong); font: 600 .8rem/1 var(--b2-body); }
.fm-ask__b span:first-child { background: var(--b2-ink); color: var(--b2-bg); border-color: var(--b2-ink); }

/* Job steps: a calm checklist that fills as a helper works */
.fm-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fm-steps li { display: flex; align-items: center; gap: 10px; font-size: .88rem; }
.fm-steps li::before { content: ""; flex: none; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--b2-line-strong); background: #fff; transition: background-color .3s, border-color .3s; }
.fm-steps li.is-on::before, .hm-sc:not(.is-play) .fm-steps li::before { border-color: var(--b2-leaf); background: radial-gradient(circle, #fff 0 3px, var(--b2-leaf) 3.5px); }
.fm-steps li.fm-steps__soon { color: var(--b2-ink-3); }
.fm-steps li.fm-steps__soon::before { border-style: dashed; background: #fff; border-color: var(--b2-ink-3); }

/* Project list inside an app sidebar */
.fm-proj { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 4px; }
.fm-proj li { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 10px; font-size: .84rem; color: var(--b2-ink-2); }
.fm-proj li::before { content: ""; width: 14px; height: 11px; border-radius: 3px; background: var(--b2-light-gold); box-shadow: inset 0 0 0 1px rgb(27 26 31 / .12); }
.fm-proj li:nth-child(2)::before { background: var(--b2-light-blue); } .fm-proj li:nth-child(3)::before { background: var(--b2-light-mint); }
.fm-proj li.is-on { background: #fff; color: var(--b2-ink); font-weight: 600; box-shadow: inset 0 0 0 1px var(--b2-line); }
.fm-proj__sub { list-style: none; margin: -2px 0 6px 22px; padding: 0 0 0 10px; border-left: 1px solid var(--b2-line); display: grid; gap: 2px; font-size: .8rem; color: var(--b2-ink-3); }
.fm-proj__sub li { padding: 4px 0; }
.fm-note { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 14px; background: #FDF6E2; border: 1px solid #F1DFAE; font-size: .82rem; line-height: 1.45; color: #5E4310; }
.fm-note::before { content: ""; flex: none; width: 16px; height: 16px; margin-top: 1px; border-radius: 4px; background: var(--b2-mango); box-shadow: inset 0 0 0 4px #F6E2A8; }

/* Enterprise: plain capability rows */
.fm-rows { list-style: none; margin: clamp(36px, 5vw, 56px) 0 0; padding: 0; border-top: 1px solid var(--b2-line); }
.fm-rows li { display: grid; grid-template-columns: 56px minmax(0, 1.1fr) minmax(0, 1.6fr) auto; gap: 8px 24px; align-items: center; padding: 22px 4px; border-bottom: 1px solid var(--b2-line); }
.fm-rows .pd-ico { width: 48px; height: 48px; padding: 9px; border-radius: 14px; background: var(--b2-bg-soft); }
.fm-rows h3 { margin: 0; font: 650 1.12rem/1.3 var(--b2-display); letter-spacing: -.012em; }
.fm-rows p { margin: 0; color: var(--b2-ink-2); }
@media (max-width: 860px) {
  .fm-rows li { grid-template-columns: 48px minmax(0, 1fr); }
  .fm-rows p, .fm-rows .fm-tag { grid-column: 2; }
  .fm-rows .fm-tag { justify-self: start; }
}

/* A closing contact band that is not the main CTA */
.fm-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px; margin-top: clamp(40px, 6vw, 64px); padding: clamp(22px, 3vw, 32px); border-radius: 24px; background: linear-gradient(120deg, #FDF6E2, #FCEBF1 60%, #EEF1FC); border: 1px solid var(--b2-line); }
.fm-band p { margin: 0; max-width: 40rem; font: 600 clamp(1.05rem, 1.8vw, 1.25rem)/1.4 var(--b2-display); letter-spacing: -.01em; }
.fm-band .b2-btn { min-height: 48px; padding-inline: 22px; }

@media (prefers-reduced-motion: reduce) {
  .fm-tag--now::before, .js .fm-fam, .fm-hub__pulse, .fm-hub__node, .fm-caret, .fm-set__row::after, .fm-auto { animation: none !important; }
  .fm-hub__pulse { stroke-dasharray: none; opacity: .5; }
  .fm-ledger li, .fm-conn > li, .fm-fam a { transition: none !important; }
  .fm-ledger li:hover, .fm-conn > li:hover, .fm-fam a:hover { transform: none; }
}
.is-still .fm-tag--now::before, .is-still .fm-hub__node, .is-still .fm-caret, .is-still .fm-hub__pulse, .is-still .fm-fam { animation: none !important; }
