@font-face {
  font-family: Ambidexter;
  src: url("assets/fonts/ambidexter-regular.woff2?v=25261bcad24d") format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

.tarot { padding: var(--section-space-cards) var(--pad) var(--space-12); background: var(--rose); color: #101216; overflow: clip; }
.tarot-header { display: grid; grid-template-columns: var(--grid); gap: var(--gap); align-items: last baseline; }
.tarot-header > div:first-child { grid-column: 1 / span 7; }
.tarot-intro { grid-column: 8 / -1; }
.tarot .eyebrow { color: #51424b; display: block; margin-bottom: var(--space-6); }
.tarot h2 { letter-spacing: 0; font-size: var(--text-title); line-height: var(--leading-display); text-transform: uppercase; }
.tarot-intro > p:first-child { font-size: var(--text-action); line-height: var(--leading-lead); }
.tarot-intro > p:last-child { font-size: var(--text-small); max-width: 33ch; margin-top: var(--space-5); min-height: 3em; }
.tarot-spread { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(var(--space-4), 3.3vw, var(--space-14)); max-width: 70rem; margin: 4.5rem auto var(--space-12); padding-inline: var(--space-4); }
.tarot-card { --card-corner: 1.5rem; --card-inset: .5rem; --caption-corner: .5rem; position: relative; min-width: 0; perspective: 1400px; transform: rotate(-5deg); }
.tarot-card-2 { transform: translateY(-1rem) rotate(2deg); }
.tarot-card-3 { transform: rotate(6deg); }
.tarot-card-inner { display: grid; height: 100%; transform-style: preserve-3d; transition: transform 550ms cubic-bezier(.2,.65,.2,1); }
.tarot-front, .tarot-back { --smooth-corner: var(--card-corner); grid-area: 1/1; padding: var(--space-6); min-height: 27rem; border-radius: var(--smooth-corner); corner-shape: squircle; background: var(--paper); backface-visibility: hidden; position: relative; display: flex; align-items: center; flex-direction: column; text-align: center; }
.tarot-number { display: block; font-size: var(--text-label); text-transform: uppercase; letter-spacing: var(--tracking-label); }
.tarot-art { display: block; width: min(100%, 11rem); height: auto; aspect-ratio: 1; margin: var(--space-3) auto; flex: 0 0 auto; }
.tarot-front h3 { font: 700 var(--text-action)/var(--leading-heading) var(--display); letter-spacing: 0; margin-top: auto; }
.tarot-description { font-size: var(--text-small); line-height: var(--leading-body); margin-top: var(--space-3); max-width: 28ch; min-height: 4.5em; }
.tarot-front h3, .tarot-description { overflow-wrap: anywhere; }
.tarot-back { display: none; justify-content: end; align-items: stretch; padding: var(--card-inset); overflow: hidden; background: #101216; color: var(--ink); text-align: left; }
.tarot-back-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tarot-card-1 .tarot-back-photo { object-position: 57% center; }
.tarot-card-2 .tarot-back-photo { object-position: center 60%; }
.tarot-card-3 .tarot-back-photo { object-position: 52% center; }
.tarot-back-caption { --smooth-corner: var(--caption-corner); position: relative; display: grid; gap: var(--space-3); padding: var(--space-4); border-radius: var(--smooth-corner); corner-shape: squircle; background: var(--glass-fill); -webkit-backdrop-filter: var(--glass-filter); backdrop-filter: var(--glass-filter); }
.tarot-back-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.tarot-back .tarot-number { font: 500 var(--text-label)/var(--leading-small) var(--body); letter-spacing: var(--tracking-label); }
.tarot-back-heading svg { display: block; width: 1.75rem; height: 1.75rem; stroke-width: 1.5; flex: 0 0 auto; }
/* The expressive face is reserved for three short words; every label stays in Golos. */
.tarot-back-title { display: flex; flex-direction: column; font: 400 clamp(3.5rem, 5.2vw, 5rem)/1 Ambidexter, "Golos Text", sans-serif; font-synthesis: none; text-transform: none; letter-spacing: 0; }
.tarot-title-prefix { font: 400 var(--text-small)/var(--leading-heading) var(--body); color: var(--ink); }
/* Compensate for the display face's upper whitespace so the two lines read together. */
.tarot-title-word { display: block; margin-top: -.24em; }
.tarot-tap { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); font: 500 var(--text-label)/var(--leading-small) var(--body); color: var(--glass-muted); }
.tarot-close { display: none; }
.tarot-ready .tarot-close { display: flex; align-items: center; justify-content: space-between; align-self: stretch; gap: var(--space-4); margin-top: var(--space-3); font: 500 var(--text-label)/var(--leading-small) var(--body); text-align: left; }
.tarot-tap .link-label, .tarot-close .link-label { text-decoration-color: transparent; }
.tarot-tap svg, .tarot-close svg { width: 2rem; height: 2rem; padding: var(--space-1); stroke-width: 1.5; flex: 0 0 auto; color: #101216; background: var(--acid); border-radius: 50%; transition: transform 240ms var(--ease-enter); }
.tarot-ready .tarot-back { display: flex; }
.tarot-ready .tarot-front { transform: rotateY(180deg); }
.tarot-ready .is-revealed .tarot-card-inner { transform: rotateY(180deg); }
.tarot-card-toggle { position: absolute; inset: 0; width: 100%; border: 0; border-radius: var(--card-corner); corner-shape: squircle; padding: 0; color: transparent; font-size: 0; cursor: pointer; background: transparent; }
.tarot-swipe { display: none; }
.tarot-swipe-end { display: inline-flex; align-items: center; gap: .45em; white-space: nowrap; }
.tarot-card:has(.tarot-card-toggle:not([aria-disabled="true"]):focus-visible) :is(.tarot-tap, .tarot-close) .link-label { text-decoration-color: currentColor; }
.tarot-card-toggle[aria-disabled="true"] { cursor: wait; }
.tarot-reading { max-width: 70rem; margin: 0 auto var(--space-8); padding-inline: var(--space-4); }
.tarot-reading-label { font: 500 var(--text-label)/var(--leading-small) var(--body); text-transform: uppercase; letter-spacing: var(--tracking-label); color: #51424b; margin-bottom: var(--space-3); }
.tarot-reading h3 { font: 700 var(--text-action)/var(--leading-lead) var(--body); overflow-wrap: anywhere; }
.tarot-reading > p:last-child { max-width: 64ch; font-size: var(--text-body); line-height: var(--leading-body); margin-top: var(--space-3); overflow-wrap: anywhere; }
.has-reading .tarot-spread { margin-bottom: var(--space-8); }
.tarot-actions { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-6) var(--space-8); max-width: 70rem; margin-inline: auto; padding-inline: var(--space-4); }
.tarot-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); }
.tarot-deal { cursor: pointer; gap: var(--space-12); min-width: 17rem; }
.tarot-save { cursor: pointer; gap: var(--space-5); }
.tarot-save svg { stroke-width: 1.5; }
.has-reading .tarot-deal { min-width: 0; background: transparent; color: #101216; padding-inline: var(--space-4); gap: var(--space-4); }
.tarot-export { max-width: 70rem; margin: 0 auto; padding-inline: var(--space-4); display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); font-size: var(--text-small); color: #51424b; }
.tarot-export:has(> :not([hidden])) { margin-top: var(--space-4); }
.tarot-credit { display: block; max-width: 70rem; margin: var(--space-4) auto 0; padding-inline: var(--space-4); font-size: var(--text-label); color: #51424b; }
.tarot-credit .link { min-height: 2.75rem; }
.tarot-save[aria-disabled="true"] { opacity: .7; cursor: wait; }
.tarot-deal > span { font: inherit; }
.tarot-deal svg { stroke-width: 1.5; }
.tarot-deal[aria-disabled="true"] { background: var(--action-bg); color: var(--action-ink); opacity: .7; cursor: wait; translate: none; transition: none; }
.tarot-actions > p { font-size: var(--text-small); color: #51424b; }

.tarot-card { transition: translate 240ms var(--ease-enter); }
.tarot-deal svg { transition: transform 240ms var(--ease-enter); }
@media (hover: hover) and (pointer: fine) {
  .tarot-card:has(.tarot-card-toggle:not([aria-disabled="true"]):hover) { translate: 0 -.375rem; }
  .tarot-card:has(.tarot-card-toggle:not([aria-disabled="true"]):hover) :is(.tarot-tap, .tarot-close) .link-label { text-decoration-color: currentColor; }
}

/* Smooth corners without JS, including browsers without corner-shape.
   Four fixed-size corners and two strips keep the curves undistorted as cards resize.
   The mask belongs on each face, never on the preserve-3d flip container. */
@supports not (corner-shape: squircle) {
  .tarot-front, .tarot-back, .tarot-back-caption {
    border-radius: 0;
    --corner-tile: calc(2 * var(--smooth-corner));
    mask:
      url("assets/illustrations/smooth-corner.svg?v=1b3625cc0ccb") top left / var(--corner-tile) var(--corner-tile) no-repeat,
      url("assets/illustrations/smooth-corner.svg?v=1b3625cc0ccb") top right / var(--corner-tile) var(--corner-tile) no-repeat,
      url("assets/illustrations/smooth-corner.svg?v=1b3625cc0ccb") bottom right / var(--corner-tile) var(--corner-tile) no-repeat,
      url("assets/illustrations/smooth-corner.svg?v=1b3625cc0ccb") bottom left / var(--corner-tile) var(--corner-tile) no-repeat,
      linear-gradient(#000 0 0) center / calc(100% - var(--corner-tile)) 100% no-repeat,
      linear-gradient(#000 0 0) center / 100% calc(100% - var(--corner-tile)) no-repeat;
  }
  /* The full card remains clickable outside the clipped faces. */
  .tarot-card-toggle { border-radius: 0; }
}

@media (max-width: 1050px) {
  .tarot-front, .tarot-back { min-height: 24rem; }
  .tarot-front { padding: var(--space-5); }
  .tarot-art { width: min(100%, 10rem); }
  .tarot-back-caption { padding: var(--space-4); }
  .tarot-spread { gap: var(--space-6); padding: 0; }
}
@media (max-width: 760px) {
  .tarot-header > div:first-child, .tarot-intro { grid-column: 1 / -1; }
  .tarot-header { grid-template-columns: 1fr; gap: var(--space-8); }
  .tarot .eyebrow { margin-bottom: var(--space-4); }
  .tarot h2 { letter-spacing: 0; font-size: var(--text-title); }
  .tarot-intro > p:last-child { max-width: 36ch; min-height: 0; }
  .tarot-spread { grid-template-columns: 1fr; max-width: 22rem; margin-block: var(--space-10); padding-inline: var(--space-2); }
  .tarot-ready .tarot-spread { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: min(78vw, 20rem); gap: var(--space-6); max-width: none; margin: var(--space-4) calc(-1 * var(--pad)) var(--space-6); padding: var(--space-6) var(--pad); overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--pad); scrollbar-width: thin; scrollbar-color: #51424b transparent; }
  .tarot-card { scroll-snap-align: center; }
  .tarot-ready .tarot-swipe { display: block; margin-top: var(--space-6); font-size: var(--text-label); color: #51424b; }
  .tarot-card, .tarot-card-2, .tarot-card-3 { transform: rotate(-2deg); }
  .tarot-card-2 { transform: rotate(2deg); }
  .tarot-front, .tarot-back { min-height: 25rem; }
  .tarot-art { width: min(100%, 10rem); }
  .tarot-front h3 { font-size: var(--text-lead); }
  .tarot-back-title { font-size: clamp(3.5rem, 17vw, 4.5rem); }
  .tarot-actions { flex-direction: column; align-items: stretch; gap: var(--space-6); padding: 0; }
  .tarot-reading { padding: 0; margin-bottom: var(--space-6); }
  .has-reading .tarot-spread { margin-bottom: var(--space-6); }
  .tarot-buttons { flex-direction: column; align-items: stretch; gap: var(--space-2); }
  .tarot-actions > p { order: 1; }
  .tarot-deal { min-width: 0; width: 100%; }
  .tarot-save { width: 100%; padding-inline: var(--space-4); justify-content: space-between; }
  .has-reading .tarot-deal { align-self: start; justify-content: start; width: auto; padding-inline: 0; }
  .tarot-export { padding: 0; }
  .tarot-credit { padding: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .tarot-ready .tarot-front, .tarot-ready .is-revealed .tarot-card-inner { transform: none; }
  .tarot-ready .tarot-front { visibility: hidden; }
  .tarot-ready .is-revealed .tarot-front { visibility: visible; }
  .tarot-ready .is-revealed .tarot-back { visibility: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
