/* ============================================================
   Outcome flip cards.

   Front carries a photograph, the numeral and a large title, so the
   section reads as four headlines rather than four paragraphs. Clicking
   flips the card to reveal the explanation. The hover-dim behaviour is
   kept from the HoverRevealCards component.

   Two earlier passes to avoid: dark cinematic photography, which fought
   the light page; and line-art on plain white, which read as empty. What
   works is architectural photography in one muted hue per card — real
   image, real colour, but desaturated enough that the brand red on the
   numeral is still the only saturated thing in the section.
   ============================================================ */

.reveal-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(0.75rem, 1.4vw, 1rem);
  margin-top: 3rem;
}

.reveal-card {
  position: relative;
  display: block;
  width: 100%;
  height: clamp(300px, 26vw, 340px);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  perspective: 1400px;
  transition: transform 500ms var(--ease-out),
              opacity 500ms var(--ease-out),
              filter 500ms var(--ease-out);
}

/* Dim the set while the pointer is in the grid; restore the hovered one. */
.reveal-cards:hover .reveal-card { opacity: 0.6; filter: blur(1.5px); transform: scale(0.975); }
.reveal-cards .reveal-card:hover,
.reveal-cards .reveal-card:focus-visible {
  opacity: 1; filter: blur(0); transform: scale(1.03);
}
.reveal-card:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; }

.reveal-card__inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 600ms var(--ease-out);
}
.reveal-card:hover .reveal-card__inner,
.reveal-card:focus-visible .reveal-card__inner { transform: rotateY(180deg); }

.reveal-card__face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  border-radius: var(--radius-lg);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background-color: var(--surface-3);
  background-size: cover;
  background-position: center;
  border: 1px solid var(--gray-200);
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.reveal-card:hover .reveal-card__face,
.reveal-card:focus-visible .reveal-card__face {
  border-color: rgba(248, 17, 23, 0.35);
  box-shadow: 0 14px 34px rgba(11, 18, 32, 0.10);
}

/* White scrim over the lower third only. It has to clear well before the
   halfway mark — carried higher it erases the photograph, which is what
   went wrong when this was calibrated for dark images. */
.reveal-card__face--front::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top,
    rgba(255, 255, 255, 0.97) 0%,
    rgba(255, 255, 255, 0.92) 26%,
    rgba(255, 255, 255, 0.55) 42%,
    rgba(255, 255, 255, 0) 62%);
}

.reveal-card__face--back {
  transform: rotateY(180deg);
  justify-content: center;
  gap: 0.55rem;
  padding: clamp(1.25rem, 2vw, 1.75rem);
  background-image: none;
  background-color: var(--surface-2);
  border-left: 3px solid var(--brand);
  text-align: left;
}

/* The oversized numeral bleeds off the corner as a watermark over the
   photograph — the "big number as background" treatment, kept from the
   version Esther approved. The readable numeral is __kicker, below. */
.reveal-card__ghost {
  position: absolute;
  right: -0.05em;
  bottom: -0.28em;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: clamp(6rem, 9vw, 8.5rem);
  font-weight: 600;
  line-height: 1;
  color: rgba(248, 17, 23, 0.16);
  pointer-events: none;
}

.reveal-card__front-body {
  position: relative;
  z-index: 2;
  padding: clamp(1.15rem, 1.8vw, 1.6rem);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* Display scale, not a label — at 12px this read as a footnote. */
.reveal-card__kicker {
  font-family: var(--font-mono);
  font-size: clamp(1.6rem, 2.5vw, 2.1rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--brand);
}

/* The headline is the whole point of the front face, so it is large. */
.reveal-card__title {
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.reveal-card__face--back .reveal-card__kicker {
  font-size: 1.5rem;
  margin-bottom: 0.15rem;
}
.reveal-card__back-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}
.reveal-card__desc {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--gray-700);
}

/* Affordance so it is obvious the card does something. Anchored to the
   card corner, not to the copy block — hanging it off the text made it
   read as a stray mark floating mid-card. z-index clears the scrim. */
.reveal-card__face--front::before {
  content: "\2192";
  position: absolute;
  top: clamp(0.85rem, 1.3vw, 1.1rem);
  right: clamp(0.85rem, 1.3vw, 1.1rem);
  z-index: 2;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1;
  transition: border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.reveal-card:hover .reveal-card__face--front::before {
  border-color: var(--brand);
  color: var(--brand);
}

@media (max-width: 900px) { .reveal-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) {
  .reveal-cards { grid-template-columns: 1fr; }
  .reveal-card { height: 240px; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal-card, .reveal-card__inner { transition-duration: 1ms; }
  .reveal-cards:hover .reveal-card { filter: none; transform: none; opacity: 0.8; }
}

/* The back face says where the card goes. The card itself is the link —
   this is the label, not a nested anchor, which would be invalid inside
   an <a> just as it was inside the <button> this replaced. */
.reveal-card__more {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand-deep);
}
.reveal-card:hover .reveal-card__more { text-decoration: underline; }

/* No hover on touch, so the card never flips there — the tap goes straight
   to the full section, which carries the same copy and more. */
@media (hover: none) {
  .reveal-cards:hover .reveal-card { opacity: 1; filter: none; transform: none; }
}
