/* ==========================================================================
   Gljáandi glerbakgrunnur (gler-bak.js býr til .gb)
   ========================================================================== */
html { background: linear-gradient(170deg, #3d424e 0%, #2a2d34 50%, #1d1f24 100%) fixed; background-color: #24272d; }
body { background: none !important; }
body::before, body::after { display: none !important; }

.gb { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }

/* Ljósið undir glerinu: fimm mjúkir hnettir sem líða hægt */
.gb__ljos { position: absolute; inset: -10%; }
.gb__ljos i { position: absolute; border-radius: 50%; will-change: transform; }
.gb__ljos i:nth-child(1) { width: 46vmax; height: 46vmax; left: 52%; top: -10%; background: radial-gradient(circle, rgba(255, 200, 120, .75), rgba(255, 170, 90, 0) 70%); animation: gb-a 26s ease-in-out infinite alternate; }
.gb__ljos i:nth-child(2) { width: 50vmax; height: 50vmax; left: -14%; top: 14%; background: radial-gradient(circle, rgba(110, 160, 255, .7), rgba(110, 160, 255, 0) 70%); animation: gb-b 32s ease-in-out infinite alternate; }
.gb__ljos i:nth-child(3) { width: 40vmax; height: 40vmax; left: 40%; top: 46%; background: radial-gradient(circle, rgba(220, 140, 230, .55), rgba(220, 140, 230, 0) 70%); animation: gb-c 29s ease-in-out infinite alternate; }
.gb__ljos i:nth-child(4) { width: 44vmax; height: 44vmax; left: 72%; top: 62%; background: radial-gradient(circle, rgba(80, 210, 180, .55), rgba(80, 210, 180, 0) 70%); animation: gb-a 35s ease-in-out infinite alternate-reverse; }
.gb__ljos i:nth-child(5) { width: 30vmax; height: 30vmax; left: 10%; top: 70%; background: radial-gradient(circle, rgba(255, 150, 120, .45), rgba(255, 150, 120, 0) 70%); animation: gb-b 24s ease-in-out infinite alternate-reverse; }
@keyframes gb-a { to { transform: translate3d(-12vmax, 8vmax, 0) scale(1.15); } }
@keyframes gb-b { to { transform: translate3d(14vmax, -6vmax, 0) scale(.9); } }
@keyframes gb-c { to { transform: translate3d(-8vmax, -10vmax, 0) scale(1.1); } }

/* Glerplöturnar: blörra og brjóta ljósið, með gljáa á brúnunum */
.gb__plata {
  position: absolute; border-radius: 64px; will-change: transform;
  background: linear-gradient(135deg, rgba(255, 255, 255, .2) 0%, rgba(255, 255, 255, .06) 38%, rgba(255, 255, 255, .03) 60%, rgba(255, 255, 255, .11) 100%);
  border: 1px solid rgba(255, 255, 255, .34);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, .7), inset 1.5px 0 0 rgba(255, 255, 255, .25), inset 0 -1px 0 rgba(255, 255, 255, .12),
              inset 0 -40px 80px -40px rgba(255, 255, 255, .12), 0 50px 100px -50px rgba(0, 0, 0, .65);
  overflow: hidden;
}
/* Endurskin: mjúk hvít rák sem hallar yfir plötuna */
.gb__plata::before {
  content: ''; position: absolute; inset: -40% auto -40% 12%; width: 22%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .26), rgba(255, 255, 255, 0));
  transform: rotate(24deg); filter: blur(6px);
}
/* Gljái sem fer hægt yfir */
.gb__plata::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 40%, rgba(255, 255, 255, .16) 50%, transparent 60%) -160% 0 / 260% 100% no-repeat;
  animation: gb-gljai 11s ease-in-out infinite;
}
.gb__plata--2::after { animation-delay: 3s; } .gb__plata--3::after { animation-delay: 6s; } .gb__plata--4::after { animation-delay: 8s; }
@keyframes gb-gljai { 0%, 60% { background-position: -160% 0; } 100% { background-position: 260% 0; } }

.gb__plata--1 { width: 40vw; height: 34vw; min-width: 340px; min-height: 290px; right: -6vw; top: -6vw; transform: rotate(-14deg); animation: gb-svif1 24s ease-in-out infinite alternate; }
.gb__plata--2 { width: 32vw; height: 26vw; min-width: 280px; min-height: 230px; left: -8vw; top: 38vh; transform: rotate(11deg); animation: gb-svif2 28s ease-in-out infinite alternate; }
.gb__plata--3 { width: 22vw; height: 16vw; min-width: 200px; min-height: 150px; left: 44vw; bottom: -4vw; transform: rotate(-7deg); border-radius: 48px; animation: gb-svif3 22s ease-in-out infinite alternate; }
.gb__plata--4 { width: 14vw; height: 12vw; min-width: 140px; min-height: 120px; left: 18vw; top: 4vh; transform: rotate(22deg); border-radius: 40px; animation: gb-svif4 30s ease-in-out infinite alternate; }
@keyframes gb-svif1 { to { transform: translate3d(-2vw, 3vh, 0) rotate(-10deg); } }
@keyframes gb-svif2 { to { transform: translate3d(2.5vw, -3vh, 0) rotate(15deg); } }
@keyframes gb-svif3 { to { transform: translate3d(-3vw, -2vh, 0) rotate(-3deg); } }
@keyframes gb-svif4 { to { transform: translate3d(2vw, 4vh, 0) rotate(28deg); } }

/* Daufur glampi efst eins og ljós falli á glerið */
.gb__glampi { position: absolute; inset: 0; background: radial-gradient(70% 40% at 50% -10%, rgba(255, 255, 255, .12), transparent 70%); }

/* Korn ofan á svo þetta líti út eins og ljósmynd af gleri */
.gb::after {
  content: ''; position: absolute; inset: 0; opacity: .11; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
html::after { display: none; }

/* Í síma: tvær plötur, hægari hreyfing, minna blörr (sparar rafhlöðu) */
@media (max-width: 760px) {
  .gb__plata--3, .gb__plata--4 { display: none; }
  .gb__plata { border-radius: 44px; }
  .gb__plata--1 { width: 78vw; height: 60vw; right: -24vw; top: -10vw; }
  .gb__plata--2 { width: 70vw; height: 54vw; left: -30vw; top: 50vh; }

}
@media (prefers-reduced-motion: reduce) {
  .gb__ljos i, .gb__plata, .gb__plata::after { animation: none !important; }
}

/* Meðan skrunað er stendur bakgrunnurinn kyrr, svo skrunið fái allan kraftinn */
html.er-ad-skruna .gb__ljos i, html.er-ad-skruna .gb__plata, html.er-ad-skruna .gb__plata::after { animation-play-state: paused; }

/* Yfirferð: í síma stendur bakgrunnurinn kyrr og kornið er tekið (léttara fyrir símann) */
@media (max-width: 760px) {
  .gb::after { display: none; }
  .gb__plata::after { animation: none; }
}
