<?php
/**
 * Shared PPPHP brand mark — the crystal "PP" monogram, with a gradual crystal
 * shine sweep + twinkling diamond sparkles (animation lives in
 * public/assets/css/app-theme.css, class-based; honours prefers-reduced-motion).
 *
 * A faceted, gem-cut treatment of the ppradhan.com PP monogram: crystal gradient
 * (sky → indigo / lilac → violet), a glassy top-left sheen, a crisp facet glint,
 * sharp edge highlight and two diamond sparkles at the letter joints.
 *
 * Options (set before include):
 *   $brandLogoSize  int  pixel size (default 34)
 *   $brandLogoClass str  extra CSS class(es) (default "logo-svg")
 *
 * Gradient/clip ids are made unique per render so several instances on one page
 * don't collide.
 */
$__sz  = isset($brandLogoSize) ? (int) $brandLogoSize : 34;
$__cls = isset($brandLogoClass) ? (string) $brandLogoClass : 'logo-svg';
$__u   = 'ppl' . bin2hex(random_bytes(3));
// Reset the one-shot overrides so a later default-size include isn't affected.
$brandLogoSize = null;
$brandLogoClass = null;
// The two overlapping P letterforms (evenodd carves each bowl's counter).
$__p1 = 'M 90 70 h 100 c 55.23 0 100 44.77 100 100 c 0 55.23 -44.77 100 -100 100 h -50 v 60 c 0 16.57 -13.43 30 -30 30 c -16.57 0 -30 -13.43 -30 -30 V 70 z M 150 120 v 100 h 40 c 27.61 0 50 -22.39 50 -50 c 0 -27.61 -22.39 -50 -50 -50 h -40 z';
$__p2 = 'M 170 140 h 100 c 55.23 0 100 44.77 100 100 c 0 55.23 -44.77 100 -100 100 h -50 v 60 c 0 16.57 -13.43 30 -30 30 c -16.57 0 -30 -13.43 -30 -30 V 140 z M 230 190 v 100 h 40 c 27.61 0 50 -22.39 50 -50 c 0 -27.61 -22.39 -50 -50 -50 h -40 z';
?>
<svg class="pp-brand <?= htmlspecialchars($__cls) ?>" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 400" width="<?= $__sz ?>" height="<?= $__sz ?>" role="img" aria-label="PPPHP">
  <defs>
    <linearGradient id="<?= $__u ?>b" x1="0%" y1="0%" x2="100%" y2="100%">
      <stop offset="0%" stop-color="#7dd3fc"/><stop offset="42%" stop-color="#4f7cf7"/><stop offset="100%" stop-color="#4338ca"/>
    </linearGradient>
    <linearGradient id="<?= $__u ?>p" x1="0%" y1="0%" x2="100%" y2="100%">
      <stop offset="0%" stop-color="#e9d5ff"/><stop offset="50%" stop-color="#a855f7"/><stop offset="100%" stop-color="#6d28d9"/>
    </linearGradient>
    <linearGradient id="<?= $__u ?>s" x1="0%" y1="0%" x2="70%" y2="100%">
      <stop offset="0%" stop-color="#ffffff" stop-opacity=".6"/><stop offset="38%" stop-color="#ffffff" stop-opacity="0"/><stop offset="100%" stop-color="#ffffff" stop-opacity="0"/>
    </linearGradient>
    <linearGradient id="<?= $__u ?>f" x1="0%" y1="0%" x2="100%" y2="100%">
      <stop offset="49%" stop-color="#ffffff" stop-opacity="0"/><stop offset="52%" stop-color="#ffffff" stop-opacity=".55"/><stop offset="56%" stop-color="#ffffff" stop-opacity="0"/>
      <stop offset="72%" stop-color="#ffffff" stop-opacity="0"/><stop offset="74%" stop-color="#ffffff" stop-opacity=".26"/><stop offset="77%" stop-color="#ffffff" stop-opacity="0"/>
    </linearGradient>
    <linearGradient id="<?= $__u ?>g" x1="0" y1="0" x2="1" y2="0">
      <stop offset="0" stop-color="#ffffff" stop-opacity="0"/><stop offset=".40" stop-color="#ffffff" stop-opacity="0"/><stop offset=".47" stop-color="#eaf6ff" stop-opacity=".95"/><stop offset=".52" stop-color="#ffffff" stop-opacity=".95"/><stop offset=".59" stop-color="#ffffff" stop-opacity="0"/><stop offset=".70" stop-color="#ffffff" stop-opacity="0"/><stop offset=".76" stop-color="#ffffff" stop-opacity=".5"/><stop offset=".82" stop-color="#ffffff" stop-opacity="0"/><stop offset="1" stop-color="#ffffff" stop-opacity="0"/>
    </linearGradient>
    <clipPath id="<?= $__u ?>c"><path d="<?= $__p1 ?>" fill-rule="evenodd"/><path d="<?= $__p2 ?>" fill-rule="evenodd"/></clipPath>
  </defs>
  <path d="<?= $__p1 ?>" fill="url(#<?= $__u ?>b)" fill-rule="evenodd"/>
  <path d="<?= $__p1 ?>" fill="url(#<?= $__u ?>f)" fill-rule="evenodd"/>
  <path d="<?= $__p1 ?>" fill="url(#<?= $__u ?>s)" fill-rule="evenodd"/>
  <path d="<?= $__p2 ?>" fill="url(#<?= $__u ?>p)" fill-rule="evenodd"/>
  <path d="<?= $__p2 ?>" fill="url(#<?= $__u ?>f)" fill-rule="evenodd"/>
  <path d="<?= $__p2 ?>" fill="url(#<?= $__u ?>s)" fill-rule="evenodd"/>
  <path d="<?= $__p2 ?>" fill="none" stroke="#ffffff" stroke-opacity=".42" stroke-width="2.5" fill-rule="evenodd"/>
  <g clip-path="url(#<?= $__u ?>c)"><polygon class="pp-shine" points="30,-20 130,-20 70,420 -30,420" fill="url(#<?= $__u ?>g)" opacity="0">
    <animateTransform attributeName="transform" type="translate" values="-120 0; 470 0; 470 0" keyTimes="0; 0.42; 1" dur="4.8s" repeatCount="indefinite"/>
    <animate attributeName="opacity" values="0; 0.95; 0.95; 0; 0" keyTimes="0; 0.06; 0.36; 0.42; 1" dur="4.8s" repeatCount="indefinite"/>
  </polygon></g>
  <g class="pp-spark"><path fill="#ffffff" d="M150 98 L158 120 L150 142 L142 120 Z"/><circle fill="#ffffff" opacity=".9" cx="150" cy="120" r="2.4"/>
    <animate attributeName="opacity" values="0.72; 1; 0.72" dur="3.4s" repeatCount="indefinite"/></g>
  <g class="pp-spark pp-spark--b"><path fill="#ffffff" d="M230 168 L238 190 L230 212 L222 190 Z"/><circle fill="#ffffff" opacity=".9" cx="230" cy="190" r="2.4"/>
    <animate attributeName="opacity" values="0.72; 1; 0.72" dur="3.4s" begin="1.2s" repeatCount="indefinite"/></g>
</svg>
