/* Pauram — "light through the circuit" effects layer.
   Elements are created by pauram-fx.js after the page has hydrated.
   Loaded on every page after pauram-polish.css. */

:root {
  --pfx-gold: 255 224 130;
  --pfx-cyan: 56 189 248;
}

/* ---------- Hero: light pulses along the circuit texture ---------- */
.pfx-hero {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  mix-blend-mode: screen;
  /* Fade only the area right behind the headline and buttons, so the light
     is visible across the rest of the hero. */
  -webkit-mask-image: radial-gradient(ellipse 42% 24% at 50% 24%, transparent 55%, #000 100%);
          mask-image: radial-gradient(ellipse 42% 24% at 50% 24%, transparent 55%, #000 100%);
  opacity: 0;
  transition: opacity 1.6s ease;
}
.pfx-hero.pfx-on { opacity: 1; }

/* ---------- Proof band: counters joined by a live trace ---------- */
.pfx-proof {
  position: relative;
  overflow: hidden;
  padding: 72px 16px;
  background: #030305;
  border-top: 1px solid rgb(255 255 255 / 0.06);
}
.pfx-proof-inner {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
/* The trace running through the four chips. */
.pfx-proof-inner::before,
.pfx-proof-inner::after {
  content: "";
  position: absolute;
  left: 12.5%;
  right: 12.5%;
  top: 7px;
  height: 1px;
  pointer-events: none;
}
.pfx-proof-inner::before { background: rgb(255 255 255 / 0.1); }
.pfx-proof-inner::after {
  background: linear-gradient(90deg, rgb(var(--pfx-gold) / 0), rgb(var(--pfx-gold) / 0.9) 50%, rgb(var(--pfx-gold) / 0)) no-repeat;
  background-size: 22% 100%;
  animation: pfx-trace 4.5s cubic-bezier(0.45, 0, 0.55, 1) infinite;
  filter: drop-shadow(0 0 4px rgb(var(--pfx-gold) / 0.8));
}
@keyframes pfx-trace {
  0%   { background-position: -30% 0; }
  70%, 100% { background-position: 130% 0; }
}
.pfx-stat {
  position: relative;
  text-align: center;
  padding: 0 12px;
}
/* Chip node sitting on the trace; lights up as the pulse passes. */
.pfx-stat::before {
  content: "";
  display: block;
  width: 14px;
  height: 14px;
  margin: 0 auto 26px;
  border-radius: 3px;
  border: 1px solid rgb(var(--pfx-gold) / 0.55);
  background:
    linear-gradient(rgb(var(--pfx-gold) / 0.65), rgb(var(--pfx-gold) / 0.65)) center / 6px 4px no-repeat,
    #08080c;
  animation: pfx-node 4.5s ease-in-out infinite;
}
.pfx-stat:nth-child(2)::before { animation-delay: 0.85s; }
.pfx-stat:nth-child(3)::before { animation-delay: 1.7s; }
.pfx-stat:nth-child(4)::before { animation-delay: 2.55s; }
@keyframes pfx-node {
  0%, 30%, 100% { box-shadow: 0 0 0 0 rgb(var(--pfx-gold) / 0); }
  12%           { box-shadow: 0 0 16px 3px rgb(var(--pfx-gold) / 0.55); }
}
.pfx-value {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 300;
  font-size: clamp(40px, 5.2vw, 64px);
  line-height: 1;
  color: #f5f5f5;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.pfx-unit {
  font-size: 0.42em;
  margin-left: 6px;
  color: rgb(var(--pfx-gold));
  font-style: italic;
}
.pfx-label {
  margin-top: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #8a8a8a;
  line-height: 1.7;
}
.pfx-proof .pfx-stat {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.pfx-proof.pfx-on .pfx-stat { opacity: 1; transform: none; }
.pfx-proof.pfx-on .pfx-stat:nth-child(2) { transition-delay: 0.12s; }
.pfx-proof.pfx-on .pfx-stat:nth-child(3) { transition-delay: 0.24s; }
.pfx-proof.pfx-on .pfx-stat:nth-child(4) { transition-delay: 0.36s; }

@media (max-width: 767px) {
  .pfx-proof { padding: 56px 16px; }
  .pfx-proof-inner { grid-template-columns: repeat(2, 1fr); row-gap: 48px; }
  /* In a 2x2 grid a single trace reads as lopsided; the nodes still pulse. */
  .pfx-proof-inner::before,
  .pfx-proof-inner::after { display: none; }
}

/* ---------- Footer: giant circuit wordmark with flowing light ---------- */
.pfx-mark {
  position: relative;
  width: min(1100px, calc(100% - 32px));
  aspect-ratio: 1195 / 292;
  margin: 24px auto 32px;
  pointer-events: none;
  -webkit-mask: url("/pauram-logo.svg") center / contain no-repeat;
          mask: url("/pauram-logo.svg") center / contain no-repeat;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.09), rgb(255 255 255 / 0.03));
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1.4s ease, transform 1.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.pfx-mark.pfx-on { opacity: 1; transform: none; }
/* Particle streams: dot fields drifting through the mask, so light only
   shows inside the traces and letterforms. */
.pfx-mark::before,
.pfx-mark::after {
  content: "";
  position: absolute;
  inset: 0;
}
.pfx-mark::before {
  /* Streaks drifting right; tile sizes are staggered so no columns line up. */
  background:
    radial-gradient(16px 2px at center, rgb(var(--pfx-gold) / 0.95), rgb(var(--pfx-gold) / 0.35) 55%, transparent) 0 0 / 211px 31px,
    radial-gradient(10px 1.6px at center, rgb(255 255 255 / 0.85), transparent) 40px 11px / 157px 43px,
    radial-gradient(6px 2.5px at center, rgb(var(--pfx-gold) / 0.9), transparent) 120px 5px / 293px 19px;
  animation: pfx-flow-a 9s linear infinite;
}
.pfx-mark::after {
  /* Cyan and gold streaks drifting left, plus a slow sweep of light. */
  background:
    radial-gradient(14px 1.8px at center, rgb(var(--pfx-cyan) / 0.9), rgb(var(--pfx-cyan) / 0.3) 55%, transparent) 70px 20px / 263px 37px,
    radial-gradient(12px 2px at center, rgb(var(--pfx-gold) / 0.8), transparent) 10px 3px / 181px 27px,
    linear-gradient(100deg, transparent 40%, rgb(var(--pfx-gold) / 0.3) 50%, transparent 60%) 0 0 / 300% 100% no-repeat;
  animation: pfx-flow-b 9s linear infinite;
}
@keyframes pfx-flow-a {
  from { background-position: 0 0, 40px 11px, 120px 5px; }
  to   { background-position: 844px 0, 511px 11px, 706px 5px; }
}
@keyframes pfx-flow-b {
  from { background-position: 70px 20px, 10px 3px, 120% 0; }
  to   { background-position: -719px 20px, -714px 3px, -20% 0; }
}

/* ---------- Cursor light on cards (mouse/trackpad only) ---------- */
@media (hover: hover) and (pointer: fine) {
  main :is([class*="rounded-3xl"], [class*="rounded-2xl"])[class*="border-white"]:not([class*="bg-gradient"]):not(button):not(a) {
    background-image: radial-gradient(460px circle at var(--pfx-x, -1000px) var(--pfx-y, -1000px), rgb(var(--pfx-gold) / 0.075), transparent 42%);
  }
}

/* ---------- Film grain over the whole site ---------- */
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: 70;
  pointer-events: none;
  opacity: 0.045;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E") 0 0 / 220px 220px repeat;
}
@media (hover: hover) and (pointer: fine) {
  body::after { animation: pfx-grain 1.2s steps(6) infinite; }
}
@keyframes pfx-grain {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-3%, 2%); }
  40%  { transform: translate(2%, -4%); }
  60%  { transform: translate(-4%, -1%); }
  80%  { transform: translate(3%, 3%); }
  100% { transform: translate(0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .pfx-proof-inner::after,
  .pfx-stat::before,
  .pfx-mark::before,
  .pfx-mark::after,
  body::after { animation: none; }
}
