/* =====================================================================
   ABOUT DECK , "The human behind the automations"
   Interactive polaroid story deck. All classes prefixed ab- to avoid
   collisions with the site stylesheet. Cream/paper aesthetic.
   ===================================================================== */

.ab-deck {
  --ab-paper: #fdf8ec;
  --ab-paper-edge: #f1e6cd;
  --ab-ink: #3a3226;
  --ab-muted: #8a7a5f;
  --ab-accent: #b4552d;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 1rem 1rem;
}

/* ---------- stage ---------- */
.ab-stage {
  position: relative;
  height: clamp(480px, 62vw, 560px);
  margin: 0.5rem 0 0.25rem;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.ab-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(230px, 68vw, 300px);
  cursor: pointer;
  transition: transform 0.45s cubic-bezier(0.22, 0.9, 0.3, 1.15), opacity 0.35s ease;
  will-change: transform;
}

.ab-inner {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 3.9;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.3, 0.7, 0.3, 1);
}

.ab-card.ab-flipped .ab-inner {
  transform: rotateY(180deg);
}

.ab-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: var(--ab-paper);
  border: 1px solid var(--ab-paper-edge);
  border-radius: 6px;
  box-shadow: 0 18px 40px rgba(58, 50, 38, 0.22), 0 3px 8px rgba(58, 50, 38, 0.12);
  padding: 12px 12px 10px;
  display: flex;
  flex-direction: column;
}

/* little tape strip on top of each polaroid */
.ab-face::before {
  content: "";
  position: absolute;
  top: -11px;
  left: 50%;
  width: 92px;
  height: 24px;
  transform: translateX(-50%) rotate(-3deg);
  background: rgba(214, 188, 140, 0.55);
  border-left: 1px dashed rgba(255, 255, 255, 0.7);
  border-right: 1px dashed rgba(255, 255, 255, 0.7);
  border-radius: 2px;
  z-index: 2;
}

.ab-back {
  transform: rotateY(180deg);
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem 1.4rem;
  background:
    repeating-linear-gradient(
      var(--ab-paper) 0px,
      var(--ab-paper) 27px,
      rgba(180, 85, 45, 0.08) 28px
    );
}

.ab-photo {
  width: 100%;
  aspect-ratio: 3 / 3.4;
  overflow: hidden;
  border-radius: 3px;
  background: #e9dfc8;
}

.ab-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ab-caption {
  font-family: "Caveat", "Segoe Print", "Bradley Hand", "Chalkboard SE", cursive;
  font-size: 1.65rem;
  font-weight: 600;
  color: var(--ab-ink);
  text-align: center;
  margin: auto 0 0;
  padding: 0.55rem 0 0.15rem;
  line-height: 1.1;
}

.ab-story {
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--ab-ink);
  margin: 0;
}

.ab-backhint {
  margin-top: 1.2rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ab-muted);
}

/* poem card front (no photo) */
.ab-poemfront {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--ab-paper-edge);
}

.ab-poemtease {
  font-family: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  font-size: 1.9rem;
  font-weight: 600;
  color: var(--ab-accent);
  line-height: 1.25;
  padding: 1rem;
}

.ab-poemlines p {
  font-family: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  font-size: 1.35rem;
  line-height: 1.5;
  color: var(--ab-ink);
  margin: 0.1rem 0;
}

/* ---------- controls ---------- */
.ab-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  margin-top: 0.4rem;
}

.ab-nav {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--ab-paper-edge);
  background: var(--ab-paper);
  color: var(--ab-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(58, 50, 38, 0.14);
  transition: transform 0.15s ease, background 0.2s ease;
}

.ab-nav:hover {
  transform: scale(1.08);
  background: #fffdf6;
}

.ab-nav svg {
  width: 22px;
  height: 22px;
}

.ab-dots {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 46vw;
}

.ab-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: none;
  background: #d8c9a8;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s ease, background 0.2s ease;
}

.ab-dot.ab-active {
  background: var(--ab-accent);
  transform: scale(1.35);
}

.ab-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.7rem;
  color: var(--ab-muted);
  font-size: 0.9rem;
}

.ab-shuffle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--ab-paper-edge);
  background: var(--ab-paper);
  color: var(--ab-ink);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-size: 0.88rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(58, 50, 38, 0.1);
  transition: transform 0.15s ease;
}

.ab-shuffle:hover {
  transform: rotate(-3deg) scale(1.05);
}

.ab-shuffle svg {
  width: 16px;
  height: 16px;
}

.ab-hint {
  text-align: center;
  color: var(--ab-muted);
  font-size: 0.85rem;
  margin: 0.6rem 0 0;
}

/* ---------- bottom CTA (reuses .cs-cta-btn from site css) ---------- */
.ab-cta {
  text-align: center;
  margin-top: 2.6rem;
  padding: 2rem 1.2rem;
  background: var(--ab-paper);
  border: 1px solid var(--ab-paper-edge);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(58, 50, 38, 0.1);
}

.ab-cta h3 {
  color: var(--ab-ink);
  margin: 0 0 1.1rem;
  font-size: 1.25rem;
}

/* ---------- small phones ---------- */
@media (max-width: 480px) {
  .ab-stage {
    height: 500px;
  }
  .ab-caption {
    font-size: 1.45rem;
  }
  .ab-story {
    font-size: 0.95rem;
  }
  .ab-poemlines p {
    font-size: 1.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ab-card,
  .ab-inner,
  .ab-nav,
  .ab-shuffle {
    transition: none;
  }
}

/* Miniature deck on phones (2026-10-03): smaller polaroids, whole stack fits */
@media (max-width: 560px) {
  .ab-stage { height: 400px; }
  .ab-card { width: 200px; }
  .ab-caption { font-size: 1.3rem; }
  .ab-story { font-size: 0.95rem; line-height: 1.55; }
  .ab-poemtease { font-size: 1.5rem; }
  .ab-poemlines p { font-size: 1.12rem; }
}
