body {
  font-family: sans-serif;
  background: #9001EE;
  text-align: center;
  margin: 0;
  padding: 2rem;
  box-sizing: border-box;
}

/* GRID */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
  box-sizing: border-box;
}

/* CARD CONTAINER */
.card {
  width: 100%;
  max-width: 500px;
  aspect-ratio: 3 / 3;
  cursor: pointer;
  perspective: 1000px;
  position: relative;
  z-index: 1;
  margin: 0 auto;
}

/* INNER WRAPPER FOR ROTATION */
.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s;
  transform-style: preserve-3d;
  transform-origin: center center;
}

/* FRONT & BACK FACES */
.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
}

.card-front img,
.card-back img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  border-radius: 8px;
}

.card-back {
  transform: rotateY(180deg);
}

/* ZOOMED CARD CONTAINER */
.card.zoomed {
  position: fixed;
  top: 50%;
  left: 50%;
  /* Move up by 15% of its own height */
  transform: translate(-50%, calc(-50% - 15%));
  /* or a fixed pixel offset: translate(-50%, calc(-50% - 50px)); */
  
  width: 40vw;
  max-width: 40vw;
  max-height: 60vh;
  z-index: 9999;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  outline: none;
}

/* PERSPECTIVE WRAPPER INSIDE ZOOMED CARD */
.card-zoom-wrapper {
  width: 100%;
  height: 100%;
  perspective: 1500px;
}

/* ROTATE THE INNER CARD */
/*.card.zoomed .card-inner {
  animation: rotate 3s linear infinite;
}*/

.card.zoomed .card-inner {
  transform: rotateY(0deg);
  transition: transform 0.1s ease-out;
}

/* ROTATION KEYFRAMES */
@keyframes rotate {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(360deg); }
}

/* FILTER BUTTONS */
#filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  justify-content: center;
  margin-bottom: 1rem;
}

#filters button {
  padding: 0.5rem 1rem;
  font-size: 1rem;
  border: none;
  background: #1a1a1a;
  color: white;
  cursor: pointer;
  border-radius: 4px;
}

#filters button:hover {
  background: #555;
}

/* RESPONSIVE GRID */
@media (max-width: 800px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .card-grid {
    grid-template-columns: 1fr;
    justify-items: center;
  }
}

/* WIGGLE ANIMATION 
@keyframes wiggle {
  0% { transform: rotate(0deg); }
  20% { transform: rotate(-5deg); }
  40% { transform: rotate(5deg); }
  60% { transform: rotate(-4deg); }
  80% { transform: rotate(4deg); }
  100% { transform: rotate(0deg); }
}
*/

.card.clicked .card-inner {
  animation: wiggle 0.2s ease;
}

/* Reset html/body */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

header, footer {
  color: #E0E0E0;
}

footer {
  padding: 1.5rem 0; /* top and bottom padding */
  /* or margin if you prefer space outside */
  /* margin-top: 2rem; */
  color: #eee; /* optional: to contrast with your background */
  font-size: 0.9rem;
}
header {
  text-align: center; /* already centered, but explicit */
  /*margin-bottom: 1rem;*/
}

header .logo {
  display: block;
  margin: 0 auto 1rem auto; /* center horizontally with bottom spacing */
  max-width: 800px; /* adjust size as you want */
  height: auto;
  padding-top: 30px;
  padding-bottom: 50px 0; /* 10px top & bottom, 0 left & right */
}

@media (max-width: 500px) {
  header .logo {
    padding: 20px 0; /* more padding top & bottom on mobile */
    max-width: 300px; /* maybe reduce size on mobile */
  }
}

@media (max-width: 800px) {
  header .logo {
    padding: 20px 0; /* more padding top & bottom on mobile */
    max-width: 300px; /* maybe reduce size on mobile */
  }
}

@media (max-width: 500px) {
  #filters button {
    padding: 1rem 1.5rem; /* increase padding for easier tap targets */
  }
}

@media (max-width: 500px) {
  .card.zoomed {
    width: 120vw;    /* wider on small screens */
    max-width: 90vw;
    max-height: 90vh;
  }
}

#filters button.active {
  background-color: #e0e0e0; /* bright accent color */
  color: #000;               /* dark text for contrast */
}

.purchase-button {
  display: inline-block;
  margin: 1rem auto 1.5rem; /* center and spacing */
  padding: 1rem 2.5rem;
  background: #1a1a1a;
  color: white;
  font-size: 1.25rem;
  text-decoration: none;
  border-radius: 4px;
  letter-spacing: 0.05em;
  transition: background-color 0.3s ease;
  box-shadow: none !important;
}

.purchase-button:hover {
  background-color: #555;
}
.purchase-button {
  margin: 4rem auto 1rem; /* 2rem top & bottom margin, auto left/right to center */
  padding: 1rem 1.5rem;
  /* other styles */
}

header p {
  line-height: 1.4;
}

@media (max-width: 500px) {
  .purchase-button {
    margin-top: 1rem;
    margin-bottom: 1rem; /* smaller space on mobile */
  }
}

#random-card-btn {
  margin-top: 0rem;
  margin-bottom: 1.5rem;
}

.card:focus {
  outline: none; /* no outline by default */
}

.card {
  outline: none; /* no outline by default */
}

body.keyboard-navigation .card:focus {
  outline: 1px solid #e0e0e0;
  outline-offset: 1px;
  border-radius: 10px;
}

.card.zoomed,
.card.zoomed * {
  outline: none !important;
}

@font-face {
  font-family: 'Ancial Regular';
  src: url('/fonts/Ancial-Regular.woff2') format('woff2'),
       url('/fonts/Ancial-Regular.woff') format('woff');
  font-weight: normal;
  font-size: 18pt;
  letter-spacing: 0.05em;
  font-display: swap;
  line-height: 1;
}

/* Apply to your instructions */
header p {
  font-family: 'Ancial Regular', serif;
  font-size: 18pt;
  letter-spacing: 0.05em;
  line-height: 1;
}

body, button, footer {
  font-family: 'Ancial Regular', serif;
  letter-spacing: 0.05em;
}
body, button, footer, header, p, h1, h2, h3, h4, h5, h6, strong, b {
  font-weight: normal !important;
  letter-spacing: 0.08em;
}

.email-link {
  color: #e0e0e0;            /* link color */
  text-decoration: none;     /* remove underline */
  font-weight: bold;         /* optional bold */
  cursor: pointer;
  transition: color 0.3s ease;
    font-weight: normal !important;
}

.email-link:hover,
.email-link:focus {
    font-weight: normal !important;
  color: #1a1a1a;            /* darker on hover/focus */
}