/* The fx layer: masked headings, the signpost cards, and the larger type of a dive's signboard. Modules:
   js/fx/*.js (the hero's room and its dive are in css/home.css). Everything here moves with transforms and
   clip-path only. */

/* ---- Masked headings (js/fx/reveal.js): each word rises into its own clipping box, line after line. */
.rv__w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0.14em 0.05em; margin: -0.14em -0.05em; }
.rv__w > span { display: inline-block; transform: translate3d(0, 115%, 0); transition: transform 0.18s linear; will-change: transform; }
.rv.is-in .rv__w > span, .stop.is-shown .rv .rv__w > span, .vil__beat.is-on .rv .rv__w > span { transform: none; transition: transform 0.95s var(--ease-out) calc(var(--l, 0) * 85ms + var(--rv-wait, 0ms)); }
.stop .rv, .vil__beat .rv { --rv-wait: 140ms; }
html[lang='fa'] .rv__w { padding-block: 0.32em; margin-block: -0.32em; }

/* ---- Signpost cards (js/fx/cards.js): a grid on paper; poster, tags line, title, one line. The poster is
   uncovered from its bottom edge while the picture settles (once, class is-in; --wait staggers the columns). Under
   a pointer or keyboard focus it shows a second real frame of the project (.card__alt, when the world has one),
   otherwise the picture eases in a little (.is-zoom). */
.cards { --fg: #16150f; --bg: #f2efe8; --mute: color-mix(in oklab, var(--fg) 66%, var(--bg)); position: relative; list-style: none; padding: 16svh var(--gutter) 16svh; color: var(--fg); }
.cards__title { margin: 0 0 clamp(30px, 7vh, 80px); font-family: var(--font-display); font-size: clamp(2.7rem, 13.5vw, 8.5rem); font-weight: 650; letter-spacing: -0.055em; line-height: 1; }
html[lang='tg'] .cards__title { font-family: var(--font); font-weight: 800; letter-spacing: -0.04em; }
html[lang='fa'] .cards__title { letter-spacing: 0; font-weight: 900; line-height: 1.25; }
.cards__grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 52px; }
.card a { display: grid; gap: 6px; padding-block-end: 6px; text-decoration: none; color: inherit; -webkit-tap-highlight-color: transparent; }
.card__pic { position: relative; display: block; aspect-ratio: 16 / 10; margin-block-end: 10px; overflow: hidden; border-radius: 18px; clip-path: inset(100% 0 0 0 round 18px); transition: clip-path 0.95s var(--ease-out) var(--wait, 0ms); }
.card__pic.is-in { clip-path: inset(0 0 0 0 round 18px); }
.card__img, .card__alt { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.card__img { transform: scale(1.06); transition: transform 1.25s var(--ease-out) var(--wait, 0ms); will-change: transform; }
.card__pic.is-in .card__img { transform: none; }
.card__alt { opacity: 0; transition: opacity 0.3s linear; }
.card a:focus-visible .card__pic.has-alt .card__alt { opacity: 1; }
.card a:focus-visible .card__pic.is-in.is-zoom .card__img { transform: scale(1.035); transition: transform 0.6s var(--ease-out); }
.card__tag { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; line-height: 1.3; color: var(--mute); }
html[lang='fa'] .card__tag { letter-spacing: 0; font-size: 0.8125rem; }
.card__title { display: flex; align-items: center; gap: 10px; font-size: clamp(1.6rem, 6.4vw, 2.3rem); font-weight: 720; letter-spacing: -0.03em; line-height: 1.1; }
html[lang='fa'] .card__title { letter-spacing: 0; line-height: 1.4; font-weight: 800; }
.card__title svg { flex: none; width: 22px; height: 22px; transition: transform 0.35s var(--ease-out); }
[dir='rtl'] .card__title svg { transform: scaleX(-1); }
.card__line { font-size: 0.9375rem; line-height: 1.45; color: var(--mute); max-width: 32em; text-wrap: pretty; }
html[lang='fa'] .card__line { line-height: 1.75; }
@media (hover: hover) {
  .card a:hover .card__pic.has-alt .card__alt { opacity: 1; }
  .card a:hover .card__pic.is-in.is-zoom .card__img { transform: scale(1.035); transition: transform 0.6s var(--ease-out); }
  .card a:hover .card__title svg { transform: translate3d(4px, 0, 0); }
  [dir='rtl'] .card a:hover .card__title svg { transform: scaleX(-1) translate3d(4px, 0, 0); }
}
@media (min-width: 900px) {
  .cards { padding-block: 20svh; }
  .cards__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 84px clamp(28px, 3.4vw, 56px); }
  .card__title { font-size: clamp(1.6rem, 2.2vw, 2.2rem); }
  .card__line { font-size: 1rem; }
}

/* ---- A dive's signboard: its name is set larger than a visit's. */
.stop--dive .stop__title { font-size: min(clamp(2.6rem, 13.4vw, 6.2rem), calc((100vw - 2 * var(--gutter)) / (var(--tl, 8) * 0.64))); }
html[lang='fa'] .stop--dive .stop__title { font-size: clamp(3rem, 15vw, 6.4rem); }
@media (min-width: 900px) {
  .stop--dive .stop__title { font-size: min(clamp(3rem, 6.4vw, 6.4rem), calc((50vw - var(--gutter)) / (var(--tl, 8) * 0.66))); }
  html[lang='fa'] .stop--dive .stop__title { font-size: clamp(3.2rem, 6.6vw, 6.6rem); }
}

@media (prefers-reduced-motion: reduce) {
  .rv__w > span { transform: none !important; transition: none !important; }
  .card__title svg, .card__alt { transition: none !important; }
  .card__pic { clip-path: inset(0 0 0 0 round 18px) !important; transition: none !important; }
  .card__img { transform: none !important; transition: none !important; }
}
