body {
  margin: 0;
  font-family: "Zalando Sans Expanded", sans-serif;
  background: #ffffff;
  color: #222;
  text-align: left;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
}

header {
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.site-header {
  width: 100%;
  max-width: calc(4 * 280px + 3 * 24px); /* Match grid width */
  margin: 0 auto;
  text-align: left;
}

h1 {
  font-weight: 700;
  font-size: 0.8rem;
  margin: 0;
  letter-spacing: -0.5px;
}

.red3 {
  color: #bd2f29;
}

.desc {
  font-weight: 400;
  color: #555;
  margin-top: 0.5rem;
  font-size: 1rem;
}

section {
  margin-bottom: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.section-header {
  width: 100%;
  max-width: calc(4 * 280px + 3 * 24px); /* Match max grid width */
  text-align: left;
  margin: 0 auto;
  box-sizing: border-box;
}

section h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.section-desc {
  font-size: 0.95rem;
  color: #666;
  margin-bottom: 1rem;
}

.font-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 280px));
  gap: 24px;
  justify-content: center;
  align-items: start;
  width: 100%;
  max-width: calc(4 * 280px + 3 * 24px); /* Match section-header width */
  box-sizing: border-box;
  margin: 0 auto;
}

.font-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  background: rgba(245, 245, 245, 0.7);
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(8px);
  padding: 1rem;
  width: 100%;
  max-width: 280px;
  min-width: 240px;
  box-sizing: border-box;
  overflow: hidden;
  transition: transform 0.2s ease;
  margin: 0;
}

.font-card:hover {
  transform: translateY(-3px);
}

.font-card img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  padding: 0;
}

.creator {
  font-size: 0.9rem;
  color: #555;
  font-weight: 400;
  margin-top: 0.5rem;
  text-align: left;
  width: 100%;
}

footer {
  text-align: left;
  margin-top: 3rem;
}

.preservia-logo {
  width: 120px;
  opacity: 0.8;
}

.backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh; 
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transition: backdrop-filter 0.35s ease-in-out, -webkit-backdrop-filter 0.35s ease-in-out, background-color 0.35s
    ease-in-out, opacity 0.35s ease-in-out;
}

.backdrop.show {
  pointer-events: all;
  background-color: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 1;
}

.details {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 40px;
  padding: 16px;
  text-align: center;
  width: clamp(280px, 90vw, 520px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  transform: scale(0.92);
  opacity: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  overflow: hidden; 
  box-sizing: border-box;
}

.details.show {
  animation: popIn 0.35s ease-in-out forwards;
}

.details.hide {
  animation: popOut 0.35s ease-in-out forwards;
}

@keyframes popIn {
  from {
    transform: scale(0.92);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes popOut {
  from {
    transform: scale(1);
    opacity: 1;
  }
  to {
    transform: scale(0.92);
    opacity: 0;
  }
}

.screenshot-wrap {
  position: relative;
  width: 100%;
  flex-shrink: 1;
  flex-grow: 1;
  min-height: 0;
  aspect-ratio: 5 / 6;
  border-radius: 28px;
  overflow: hidden;
  margin: 8px 0 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  background: rgba(255, 255, 255, 0.9);
}

.screenshot-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.details h2 {
  font-family: "Zalando Sans Expanded", sans-serif;
  font-weight: 700;
  font-size: 24px;
  margin: 0 0 4px 0;
  flex-shrink: 0;
}

.meta {
  font-size: 14px;
  font-weight: 600;
  color: #222;
  opacity: 0.75;
  margin: 0 0 8px 0;
  flex-shrink: 0;
}

.buttons {
  margin: 8px 0 8px;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-shrink: 0;
}

.btn {
  border: none;
  border-radius: 30px;
  padding: 8px 20px;
  font-family: "Zalando Sans Expanded", sans-serif;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn.download {
  background: #bd2f29;
  color: #fff;
}

.btn.download:hover {
  background: #a02620;
}

.font-card {
  cursor: pointer;
}
