/*
 * The TorPayment brand: emblem and wordmark (markup: src/brand/logo.ts; rules of use:
 * docs/DESIGN.md). One file for the landing page, the checkout and both panels.
 * Both are sized by `height`; the width follows the drawing.
 */
.emblem { display: block; flex: none; width: auto; height: 36px; overflow: visible; }
.wordmark { display: block; flex: none; width: auto; height: 16px; overflow: visible; }
/* The flag next to a language in every language switch. */
.flag { display: inline-block; flex: none; width: 18px; height: 12.6px; border-radius: 2.5px; overflow: hidden; box-shadow: 0 0 0 1px rgba(127, 127, 140, 0.35); }
.emblem .em-body, .emblem .em-coin, .emblem .em-spark, .emblem .em-ring { transform-box: fill-box; transform-origin: center; }
.emblem .em-body { transform-origin: 50% 70%; }
.wordmark .wm-o2, .wordmark .wm-o3 { transform-box: fill-box; transform-origin: center; }
/* Where the gaps of the layer rings rest (the animation turns them from here). */
.emblem .em-ring-1 { rotate: -35deg; }
.emblem .em-ring-2 { rotate: 140deg; }

/* The cut onion: its layers swell from the point where they meet. */
.emblem .em-band { transform-origin: 100px 160px; }

/* The flat style: one violet, white lines, no light effects. */
.em-flat .em-band-w { fill: #fff; }
.em-flat .em-band-v { fill: #6d4df2; }
.em-flat .em-stem, .em-flat .em-root { stroke: #6d4df2; }
.em-flat .em-gloss, .em-flat .em-disc-in { display: none; }
.em-flat .em-band path, .em-flat .em-skin { stroke: none; }
.em-flat .em-skin { fill: #6d4df2; }
.em-flat .em-sweep-g, .em-flat .em-glow { display: none; }
.em-flat .em-layer { stroke: #fff; }
.em-flat.em-rings .em-skin { fill: none; stroke: #7a5cff; }
.em-flat .em-ring { stroke: #7a5cff; }
.em-flat.em-rings .em-disc { fill: #7a5cff; }
.em-flat.em-rings .em-sign { stroke: #fff; }
.em-flat .em-layer-2 { stroke-opacity: 0.8; }
.em-flat .em-disc { fill: #fff; stroke: none; }
.em-flat .em-sign { stroke: #6d4df2; }
.wm-flat .wm-pay { stroke: #8f7bff; }

/* The name with its descriptor: side by side with the emblem (headers) or stacked (brand moments). */
.brand-lock { display: inline-flex; align-items: center; gap: 11px; min-width: 0; color: inherit; text-decoration: none; }
.brand-lock:hover { text-decoration: none; }
.brand-words { display: grid; gap: 5px; min-width: 0; }
.brand-tag { color: var(--muted, #8f96b8); font: 600 7.6px/1 var(--font, Inter, system-ui, sans-serif); letter-spacing: 0.26em; text-transform: uppercase; white-space: nowrap; }
.brand-hero { display: grid; justify-items: center; gap: 22px; }
.brand-hero .emblem { height: 260px; }
.brand-hero .wordmark { height: 42px; }
.brand-hero .brand-tag { display: flex; align-items: center; gap: 14px; padding-left: 0.34em; font-size: 12.5px; letter-spacing: 0.34em; }
.brand-hero .brand-tag::before, .brand-hero .brand-tag::after { content: ""; width: 44px; height: 1px; background: linear-gradient(90deg, transparent, rgba(167, 139, 250, 0.9)); }
.brand-hero .brand-tag::after { transform: scaleX(-1); }

@media (prefers-reduced-motion: no-preference) {
  /* Emblem: the bulb grows in, then floats; a gap travels along each layer; the coin beats. */
  .emblem .em-body { animation: em-in 0.9s cubic-bezier(0.2, 0.9, 0.25, 1.12) 0.05s both, em-float 5.4s ease-in-out 1s infinite alternate; }
  .em-compact .em-body { animation: em-in 0.9s cubic-bezier(0.2, 0.9, 0.25, 1.12) 0.05s both; }
  .emblem .em-band { animation: em-swell 4.4s ease-in-out infinite alternate; }
  .emblem .em-b1 { animation-delay: 0.25s; }
  .emblem .em-b2 { animation-delay: 0.5s; }
  .emblem .em-b3 { animation-delay: 0.75s; }
  .emblem .em-ring-1 { animation: em-turn 14s linear infinite; }
  .emblem .em-ring-2 { animation: em-turn-back 9s linear infinite; }
  .emblem .em-layer-1 { animation: em-run 13s linear infinite; }
  .emblem .em-layer-2 { animation: em-run-back 8s linear infinite; }
  .emblem .em-coin { animation: em-pop 0.8s cubic-bezier(0.3, 1.5, 0.5, 1) 0.45s both, em-beat 2.8s ease-in-out 1.6s infinite; }
  .emblem .em-sweep { animation: em-sweep 4.6s cubic-bezier(0.4, 0, 0.2, 1) 1.4s infinite; }
  .emblem .em-glow { animation: em-fade 1.2s ease both, em-glow 3.6s ease-in-out 1.2s infinite alternate; }
  .emblem .em-orbits { animation: em-fade 0.9s ease 0.8s both; }
  .emblem .em-spark { animation: em-twinkle 3.2s ease-in-out infinite both; }
  .emblem .em-d1 { animation-delay: 1.1s; }
  .emblem .em-d2 { animation-delay: 2.2s; }
  .emblem .em-d3 { animation-delay: 0.6s; }
  /*
   * Wordmark: the name itself does not move. The whole word appears at once rather than letter by
   * letter — a reveal that runs across the name reads as the page still loading, which is the last
   * thing a payment page should suggest. Two things move, and only these two: the ring inside the
   * O of TOR turns, and a light crosses the letters now and then.
   * (The per-letter wm-i* classes stay in the markup as hooks; nothing times off them any more.)
   */
  .wordmark .wm-l { animation: wm-in 0.5s ease 0.1s both; }
  .wordmark .wm-o2 { animation: wm-in 0.5s ease 0.1s both, wm-spin 9s linear 0.1s infinite; }
  .wordmark .wm-o3 { animation: wm-in 0.5s ease 0.1s both; }
  .wordmark .wm-shine { animation: wm-shine 5.2s cubic-bezier(0.4, 0, 0.2, 1) 1.4s infinite; }
}
/* The orbits and the pulse are driven by SMIL, which CSS cannot pause: without motion they are left out. */
@media (prefers-reduced-motion: reduce) {
  .emblem .em-orbits, .emblem .em-pulse, .emblem .em-spark { display: none; }
}
@keyframes em-in { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: scale(1); } }
@keyframes em-pop { from { opacity: 0; transform: scale(0.2); } to { opacity: 1; transform: scale(1); } }
@keyframes em-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes em-float { from { transform: translateY(0); } to { transform: translateY(-5px); } }
@keyframes em-swell { from { scale: 1; } to { scale: 1.035; } }
@keyframes em-turn { from { rotate: -35deg; } to { rotate: 325deg; } }
@keyframes em-turn-back { from { rotate: 140deg; } to { rotate: -220deg; } }
@keyframes em-run { to { stroke-dashoffset: -100; } }
@keyframes em-run-back { to { stroke-dashoffset: 100; } }
@keyframes em-beat { 0%, 60%, 100% { transform: scale(1); } 72% { transform: scale(1.12); } 84% { transform: scale(0.98); } }
@keyframes em-sweep { 0%, 55% { transform: translateX(-80px); opacity: 0; } 57%, 97% { opacity: 1; } 100% { transform: translateX(320px); opacity: 0; } }
@keyframes em-glow { from { opacity: 0.6; } to { opacity: 1; } }
@keyframes em-twinkle { 0%, 100% { opacity: 0; transform: scale(0.3) rotate(0deg); } 50% { opacity: 1; transform: scale(1) rotate(45deg); } }
@keyframes wm-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes wm-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
/* The light is invisible while it waits outside the letters. */
@keyframes wm-shine { 0%, 45% { transform: translateX(-80px); opacity: 0; } 47%, 97% { opacity: 1; } 100% { transform: translateX(420px); opacity: 0; } }
