/* Hero text animations */
.blur-text {
  display: flex;
  flex-wrap: wrap;
}

.bg-brand-primary {
    --tw-bg-opacity: 1;
    background-color: rgb(37 99 235 / var(--tw-bg-opacity, 1));
}

#hero-content h1 .inline-block {
  display: inline-block;
  margin-right: 2px;
}

.no-js #hero-content h1,
.no-js #hero-content p {
  opacity: 1;
  filter: blur(0);
}

.hero-title {
  opacity: 0;
  animation: fadeIn 0.5s ease-out forwards;
  animation-delay: 0.3s;
  letter-spacing: normal;
}

.hero-title .word {
  display: inline-block;
  margin-right: 0.1em;
  white-space: nowrap;
}

.hero-title .space {
  display: inline-block;
  width: 0.1em;
  min-width: 0.1em;
}

.hero-title .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(15px);
  animation: charAnimation 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  letter-spacing: -0.01em;
}

.hero-title .extra-space {
  margin-right: 0.4em;
}

.hero-title .text-accent {
  position: relative;
  display: inline-block;
}

.hero-title .text-accent::before {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  color: transparent;
  text-shadow: 0 0 15px rgba(71, 184, 255, 0.7), 0 0 25px rgba(255, 255, 255, 0.6);
  animation: aura-glow 2s ease-in-out infinite alternate;
  filter: blur(4px);
}

.hero-title .text-accent::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 5%;
  width: 0;
  height: 3px;
  background-color: currentColor;
  animation: lineExpand 1s ease-out forwards;
  animation-delay: 1.5s;
}

@keyframes charAnimation {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  to { opacity: 1; }
}

@keyframes lineExpand {
  to { width: 90%; }
}

@keyframes text-glow {
  0% { text-shadow: 0 0 5px rgba(255,255,255,0.3); }
  100% { text-shadow: 0 0 10px rgba(255,255,255,0.6), 0 0 20px rgba(71, 184, 255, 0.4); }
}

@keyframes line-glow {
  0% { box-shadow: 0 0 5px rgba(255,255,255,0.3); }
  100% { box-shadow: 0 0 8px rgba(255,255,255,0.6), 0 0 12px rgba(71, 184, 255, 0.4); }
}

@keyframes aura-glow {
  0% { opacity: 0.6; filter: blur(4px); }
  100% { opacity: 0.9; filter: blur(7px); }
}

.company-image { border-radius: 1rem; }

.hero-bg-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.hero-bg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: subtle-zoom 30s infinite alternate ease-in-out;
  filter: brightness(0.9) contrast(1.1);
  opacity: 0.2;
}

.hero-overlay { display: none; }

@keyframes subtle-zoom {
  0% { transform: scale(1); }
  100% { transform: scale(1.05); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-bg-image { animation: none; }
}

.hero-title.animation-completed .space {
  width: 0.1em !important;
  margin-right: 0 !important;
}

/* Wave cards */
.e-card {
  background: transparent;
  box-shadow: 0px 8px 28px -9px rgba(0,0,0,0.45);
  position: relative;
  height: 480px;
  border-radius: 16px;
  overflow: hidden;
  width: 100%;
  transition: all 0.3s ease;
}

.e-card:hover {
  transform: translateY(-10px);
  box-shadow: 0px 15px 35px -5px rgba(0,0,0,0.5);
}

.wave {
  position: absolute;
  width: 540px;
  height: 700px;
  opacity: 0.6;
  left: 0;
  top: 0;
  margin-left: -50%;
  margin-top: -70%;
  background: linear-gradient(744deg,#105cdb,#3c89ef 60%,#00ddeb);
  z-index: 1;
}

.wave-color-1 { background: linear-gradient(744deg,#105cdb,#3c89ef 60%,#00ddeb); }
.wave-color-2 { background: linear-gradient(744deg,#1e40af,#3b82f6 60%,#38bdf8); }
.wave-color-3 { background: linear-gradient(744deg,#4338ca,#6366f1 60%,#93c5fd); }

.printer-image {
  width: 90%;
  max-height: 220px;
  margin: 0 auto;
  padding: 1.5em 0;
  position: relative;
  z-index: 2;
  object-fit: contain;
  filter: drop-shadow(0 5px 10px rgba(0,0,0,0.2));
}

.card-content {
  position: relative;
  z-index: 2;
  background: white;
  padding: 1.5rem;
  border-radius: 12px 12px 0 0;
  margin-top: -12px;
  height: calc(100% - 200px);
  display: flex;
  flex-direction: column;
}

.printer-tag {
  align-self: flex-start;
  margin-bottom: 0.75rem;
  background: rgba(0,0,0,0.05);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 0.75rem;
  font-family: var(--font-heading);
}

.card-desc {
  font-size: 0.875rem;
  color: #666;
  margin-bottom: 1rem;
  flex-grow: 1;
}

.card-link {
  position: relative;
  font-weight: 600;
  color: #3b82f6;
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: color 0.2s ease;
}

.card-link:hover { color: #1d4ed8; }

.card-link svg {
  margin-left: 0.35rem;
  width: 1rem;
  height: 1rem;
}

.wave:nth-child(2), .wave:nth-child(3) { top: 210px; }

.playing .wave { border-radius: 40%; animation: wave 3000ms infinite linear; }
.e-card .wave { border-radius: 40%; animation: wave 55s infinite linear; }
.playing .wave:nth-child(2) { animation-duration: 4000ms; }
.e-card .wave:nth-child(2) { animation-duration: 50s; }
.playing .wave:nth-child(3) { animation-duration: 5000ms; }
.e-card .wave:nth-child(3) { animation-duration: 45s; }

@keyframes wave {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Cookie consent */
.cookie-consent {
  position: fixed;
  bottom: -100%;
  left: 0;
  right: 0;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
  transition: bottom 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  border-top: 1px solid rgba(59, 130, 246, 0.2);
}

.cookie-consent.active { bottom: 0; }

.cookie-content {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 10px;
}

.cookie-wave {
  position: absolute;
  width: 400px;
  height: 400px;
  opacity: 0.1;
  border-radius: 40%;
  right: -150px;
  bottom: -250px;
  background: linear-gradient(744deg,#105cdb,#3c89ef 60%,#00ddeb);
  animation: wave 25s infinite linear;
  z-index: -1;
}

.cookie-wave:nth-child(2) { animation-duration: 20s; right: -100px; bottom: -230px; opacity: 0.07; }

.cookie-btn-group { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.cookie-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6em 1.2em;
  border-radius: 0.4em;
  font-weight: 500;
  transition: all 0.3s;
  min-width: 120px;
  min-height: 44px;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.cookie-btn-accept { background: var(--btn-bg-2, #1e40af); color: white; border: none; }
.cookie-btn-accept:hover { background: #1a365d; transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.15); }
.cookie-btn-settings { background: white; border: 2px solid var(--btn-bg-2, #1e40af); color: var(--btn-bg-2, #1e40af); }
.cookie-btn-settings:hover { background: rgba(59, 130, 246, 0.1); transform: translateY(-2px); }

.cookie-preferences-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.cookie-preferences-modal.active { opacity: 1; pointer-events: auto; }

.cookie-modal-content {
  background: white;
  border-radius: 12px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  position: relative;
  padding: 1.5rem;
}

.cookie-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 1rem;
}

.cookie-modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  color: #6b7280;
  border-radius: 50%;
  line-height: 0.75;
}

.cookie-modal-close:hover { background: rgba(0, 0, 0, 0.05); color: #111827; }

.cookie-option {
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.cookie-option:hover { background: rgba(59, 130, 246, 0.05); }

.cookie-option-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.cookie-switch { position: relative; display: inline-block; width: 50px; height: 24px; }
.cookie-switch input { opacity: 0; width: 0; height: 0; }

.cookie-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 24px;
}

.cookie-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .cookie-slider { background-color: var(--btn-bg-2, #1e40af); }
input:focus + .cookie-slider { box-shadow: 0 0 1px var(--btn-bg-2, #1e40af); }
input:checked + .cookie-slider:before { transform: translateX(26px); }

.cookie-option-description { color: #6b7280; font-size: 0.875rem; }

.cookie-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
  margin-top: 1rem;
}

input:disabled + .cookie-slider { background-color: var(--btn-bg-2, #1e40af); opacity: 0.7; cursor: not-allowed; }

@media (max-width: 640px) {
  .cookie-consent { padding-bottom: calc(env(safe-area-inset-bottom) + 1rem); }
  .cookie-content { flex-direction: column; }
  .cookie-btn-group { margin-top: 1rem; justify-content: center; }
  .cookie-btn { width: 100%; justify-content: center; }
}

/* Wave SVG / droplet effects */
.wave-svg { transform: translateY(1px); }
.wave-path { transform-origin: center bottom; transform: translateY(20px); }
.wave1 { animation: wave-animation-1 8s linear infinite; }
.wave2 { animation: wave-animation-2 12s linear infinite alternate; }

@keyframes wave-animation-1 {
  0%   { transform: translateX(0%); }
  50%  { transform: translateX(-2%); }
  100% { transform: translateX(0%); }
}

@keyframes wave-animation-2 {
  0%   { transform: translateX(-1%); }
  50%  { transform: translateX(1%); }
  100% { transform: translateX(-1%); }
}

.droplet {
  position: absolute;
  width: 10px;
  height: 10px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  box-shadow: 0 0 5px rgba(255, 255, 255, 0.7);
  z-index: 5;
  animation: droplet-fall 2s ease-in forwards;
  pointer-events: none;
}

@keyframes droplet-fall {
  0%   { transform: translateY(0) scale(0.3); opacity: 0.9; }
  80%  { opacity: 0.9; }
  100% { transform: translateY(150px) scale(0); opacity: 0; }
}

.splash {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.7);
  opacity: 1;
  animation: splash 0.6s ease-out forwards;
  pointer-events: none;
}

@keyframes splash {
  0%   { transform: scale(0); opacity: 0.8; }
  100% { transform: scale(1.5); opacity: 0; }
}

.bg-pattern {
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.2'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-20px); }
}

.printer-float-animation { animation: float 6s ease-in-out infinite; }

/* Anchored card hover */
a:hover .e-card { transform: translateY(-10px); box-shadow: 0px 15px 35px -5px rgba(0, 0, 0, 0.5); }
.e-card.cursor-pointer:hover { outline: 2px solid rgba(59, 130, 246, 0.3); }
a:hover .card-link { color: #1d4ed8; }

/* Back-to-top button */
.button {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: rgb(20, 20, 20);
  border: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0px 0px 0px 4px rgba(59, 130, 246, 0.25);
  cursor: pointer;
  transition-duration: 0.3s;
  overflow: hidden;
  position: fixed;
  bottom: 2rem;
  right: 2rem;
}

.svgIcon { width: 12px; transition-duration: 0.3s; }
.svgIcon path { fill: white; }

.button:hover {
  width: 140px;
  border-radius: 50px;
  transition-duration: 0.3s;
  background-color: rgb(59, 130, 246);
  align-items: center;
}

.button:hover .svgIcon { transition-duration: 0.3s; transform: translateY(-200%); }

.button::before {
  position: absolute;
  bottom: -20px;
  content: "Back to Top";
  color: white;
  font-size: 0px;
}

.button:hover::before { font-size: 13px; opacity: 1; bottom: unset; transition-duration: 0.3s; }
.button.visible { opacity: 1; }

/* Donate / CTA button */
.btn-donate {
  --clr-font-main: hsla(0 0% 20% / 100);
  --btn-bg-1: hsla(194 100% 69% / 1);
  --btn-bg-2: hsla(217 100% 56% / 1);
  --btn-bg-color: hsla(360 100% 100% / 1);
  --radii: 0.5em;
  cursor: pointer;
  padding: 0.9em 1.4em;
  min-width: 120px;
  min-height: 44px;
  font-size: var(--size, 1rem);
  font-family: var(--font-sans);
  font-weight: 500;
  transition: 0.8s;
  background-size: 280% auto;
  background-image: linear-gradient(325deg, var(--btn-bg-2) 0%, var(--btn-bg-1) 55%, var(--btn-bg-2) 90%);
  border: none;
  border-radius: var(--radii);
  color: var(--btn-bg-color);
  box-shadow:
    0px 0px 20px rgba(71, 184, 255, 0.5),
    0px 5px 5px -1px rgba(58, 125, 233, 0.25),
    inset 4px 4px 8px rgba(175, 230, 255, 0.5),
    inset -4px -4px 8px rgba(19, 95, 216, 0.35);
  display: inline-block;
  text-align: center;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn-header { --size: 0.9rem; padding: 0.7em 1.2em; min-height: 40px; }

.btn-donate:hover { background-position: right top; transform: translateY(-3px); }

.btn-donate:is(:focus, :focus-visible, :active) {
  outline: none;
  box-shadow: 0 0 0 3px var(--btn-bg-color), 0 0 0 6px var(--btn-bg-2);
}

.btn-donate:not(.btn-header) { animation: button-glow 2s infinite alternate; }

@keyframes button-glow {
  0% {
    box-shadow:
      0px 0px 15px rgba(71, 184, 255, 0.4),
      0px 5px 5px -1px rgba(58, 125, 233, 0.25),
      inset 4px 4px 8px rgba(175, 230, 255, 0.5),
      inset -4px -4px 8px rgba(19, 95, 216, 0.35);
  }
  100% {
    box-shadow:
      0px 0px 25px rgba(71, 184, 255, 0.6),
      0px 5px 10px -1px rgba(58, 125, 233, 0.35),
      inset 4px 4px 8px rgba(175, 230, 255, 0.5),
      inset -4px -4px 8px rgba(19, 95, 216, 0.35);
  }
}

.btn-donate:not(.btn-header)::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.3) 10%, transparent 10.01%);
  background-repeat: no-repeat;
  background-position: 50%;
  transform: scale(10, 10);
  opacity: 0;
  transition: transform 0.4s, opacity 0.8s;
}

.btn-donate:not(.btn-header):active::after { transform: scale(0, 0); opacity: 0.3; transition: 0s; }

@media (prefers-reduced-motion: reduce) {
  .btn-donate { transition: linear; animation: none; }
  .hero-title .text-accent,
  .hero-title .text-accent::after { animation: none; }
}
