/* FormSMTP brand layer, shared by the marketing site and the dashboard.
   The mark is four tiles with an envelope flap cut through the middle; every graphic element below reuses
   that tile language. Motion is slow and decorative, and switched off for prefers-reduced-motion. */

/* ---- the mark ----------------------------------------------------------------------------------- */
.brand-mark { flex-shrink: 0; overflow: visible; }
.brand-mark .bm-t { transform-box: fill-box; transform-origin: center; }

/* Intro: three tiles land one by one, then the envelope appears in its slot and lifts out. */
.brand-mark.intro .bm-t1, .brand-mark.intro .bm-t2, .brand-mark.intro .bm-t3 { animation: bm-tile 0.6s cubic-bezier(0.2, 0.9, 0.25, 1.2) both; }
.brand-mark.intro .bm-t2 { animation-delay: 0.08s; }
.brand-mark.intro .bm-t3 { animation-delay: 0.16s; }
.brand-mark.intro .bm-t4 { animation: bm-launch 0.9s 0.24s cubic-bezier(0.3, 1.3, 0.4, 1) both; }
@keyframes bm-tile { from { transform: scale(0.2); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bm-launch {
  0% { transform: translate(-14%, 14%) scale(0.2); opacity: 0; }
  45% { transform: translate(-14%, 14%); opacity: 1; }
  100% { transform: none; opacity: 1; }
}

/* Hover / focus on anything that holds the logo: the envelope is sent off and a new one takes its place. */
:is(a, button):is(:hover, :focus-visible) > .brand-mark .bm-t4,
.brand-hover:hover .bm-t4 { animation: bm-send 0.9s cubic-bezier(0.5, 0, 0.3, 1); }
@keyframes bm-send {
  0% { transform: none; opacity: 1; }
  40% { transform: translate(70%, -70%) rotate(18deg) scale(0.7); opacity: 0; }
  41% { transform: translate(-14%, 14%) scale(0.2); opacity: 0; }
  100% { transform: none; opacity: 1; }
}

/* Wordmark: "Form" in ink, "SMTP" in the brand colour where it has contrast (dark surfaces). */
.brand-word b { font-weight: inherit; color: var(--word-accent, inherit); }

/* ---- graphic elements ----------------------------------------------------------------------------- */
.bshape { display: block; flex-shrink: 0; }


/* Supergraphic: the four tiles repeated and rotated, as a background. --tile-c sets the colour. */
.supergraphic {
  background-image: var(--supergraphic);
  background-size: 120px 120px;
  animation: bpan 60s linear infinite;
}
@keyframes bpan { to { background-position: 120px 120px; } }

/* Ticker band of brand shapes, edge to edge. Each group carries its own trailing gap (padding), so sliding
   the track by exactly one group (-50%) loops without a visible seam. */
.bband { overflow: hidden; width: 100%; }
.bband-track { display: flex; width: max-content; animation: bband 100s linear infinite; }
.bband-group { display: flex; align-items: center; gap: 28px; padding-right: 28px; flex-shrink: 0; }
.bband-group > * { color: var(--accent); opacity: 0.85; }
.bband-group > :nth-child(3n + 2) { color: var(--band-alt, #f1f0eb); opacity: 0.18; }
.bband-group > :nth-child(4n) { opacity: 0.35; }
@keyframes bband { to { transform: translateX(-50%); } }

/* Four-tile loader. */
.bloader { display: inline-grid; grid-template-columns: 1fr 1fr; gap: 3px; width: var(--s, 28px); height: var(--s, 28px); }
.bloader i { border-radius: 30%; background: var(--accent); animation: bload 1.2s ease-in-out infinite; }
.bloader i:nth-child(2) { animation-delay: 0.15s; }
.bloader i:nth-child(4) { animation-delay: 0.3s; }
.bloader i:nth-child(3) { animation-delay: 0.45s; }
@keyframes bload { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.55); opacity: 0.35; } }

/* Tiny four-tile glyph for eyebrows and labels: <i class="bglyph"><i></i><i></i><i></i><i></i></i>, or the
   mask version below on a pseudo-element. */
.qglyph::before {
  content: ""; display: inline-block; width: 0.82em; height: 0.82em; margin-right: 0.45em; vertical-align: -0.08em;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Crect width='22' height='22' rx='8'/%3E%3Crect x='26' width='22' height='22' rx='8'/%3E%3Crect y='26' width='22' height='22' rx='8'/%3E%3Crect x='26' y='26' width='22' height='22' rx='8'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Crect width='22' height='22' rx='8'/%3E%3Crect x='26' width='22' height='22' rx='8'/%3E%3Crect y='26' width='22' height='22' rx='8'/%3E%3Crect x='26' y='26' width='22' height='22' rx='8'/%3E%3C/svg%3E") center / contain no-repeat;
}
.bglyph { display: inline-grid; grid-template-columns: 1fr 1fr; gap: 1.5px; width: 10px; height: 10px; vertical-align: -1px; }
.bglyph i { border-radius: 1.5px; background: currentColor; }

@media (prefers-reduced-motion: reduce) {
  .brand-mark .bm-t, .supergraphic, .bband-track, .bloader i { animation: none !important; transition: none !important; }
}

/* Supergraphic tile (generated): quad mark, rotated tile, sparkle, pill and dots. Opacity comes from the layer. */
:root { --supergraphic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='%23c8f251'%3E%3Crect x='8.0' y='8.0' width='20.8' height='20.8' rx='8.3'/%3E%3Crect x='31.2' y='8.0' width='20.8' height='20.8' rx='8.3'/%3E%3Crect x='8.0' y='31.2' width='20.8' height='20.8' rx='8.3'/%3E%3Crect x='31.2' y='31.2' width='20.8' height='20.8' rx='8.3'/%3E%3Crect x='70' y='70' width='40' height='40' rx='15' transform='rotate%2845 90 90%29' fill-opacity='.55'/%3E%3Cpath d='M90 8c1.2 8.6 7.4 14.8 16 16-8.6 1.2-14.8 7.4-16 16-1.2-8.6-7.4-14.8-16-16 8.6-1.2 14.8-7.4 16-16Z'/%3E%3Crect x='6' y='84' width='48' height='16' rx='8' fill-opacity='.55'/%3E%3Ccircle cx='66' cy='50' r='2.6' fill-opacity='.7'/%3E%3Ccircle cx='66' cy='58' r='2.6' fill-opacity='.7'/%3E%3Ccircle cx='76' cy='50' r='2.6' fill-opacity='.7'/%3E%3Ccircle cx='76' cy='58' r='2.6' fill-opacity='.7'/%3E%3Ccircle cx='86' cy='50' r='2.6' fill-opacity='.7'/%3E%3Ccircle cx='86' cy='58' r='2.6' fill-opacity='.7'/%3E%3C/g%3E%3C/svg%3E"); }
