/* ============================================================
 * Fate Cycle — natal chart result (v2)
 * Shared by reading.html (the result appears in place after the cast) and
 * result.html (direct visits). Layered on loom.css + oriental.css.
 * ============================================================ */

:root { --serif-en: "Playfair Display", Georgia, "Times New Roman", serif; }

.result { padding-top: clamp(28px, 4vw, 52px); }
.result > * + * { margin-top: clamp(16px, 2.2vw, 28px); }

/* ---- verdict ---- */
.verdict { display: grid; grid-template-columns: 1fr; gap: clamp(20px, 3vw, 40px);
           align-items: center; justify-items: center; text-align: center; }
@media (min-width: 900px) {
  .verdict { grid-template-columns: 64px 268px 1fr; justify-items: stretch; text-align: left; }
}
/* 「命格」→ "Natal Chart" (Jade, 2026-09-17). English runs down the side
 * rotated rather than stacked letter by letter; below 900px it lies flat. */
.vtitle--en {
  text-orientation: mixed; justify-self: center;
  font-family: var(--serif-en); font-size: 15px; letter-spacing: .32em; text-transform: uppercase;
}
@media (max-width: 899px) {
  .vtitle--en { writing-mode: horizontal-tb; border-right: 0; padding: 0 0 10px;
                border-bottom: 1px solid var(--rule); }
}
.verdict__disc { position: relative; width: min(268px, 74vw); aspect-ratio: 1; display: grid; place-items: center; }
.verdict__disc .bagua { animation: turn 120s linear infinite; }
.verdict__word {
  position: relative; font-family: var(--serif-en); font-weight: 600;
  font-size: clamp(38px, 11vw, 50px); line-height: 1; letter-spacing: .02em;
}
@keyframes turn { to { transform: rotate(360deg); } }

.verdict .kicker {
  margin: 0 0 8px; font-family: var(--mono-d); font-size: 12px; letter-spacing: .24em;
  text-transform: uppercase; color: var(--ink-3);
}
.verdict h1 { margin: 0; font-family: var(--serif-en); font-size: clamp(26px, 3.6vw, 38px); line-height: 1.25; font-weight: 400; }
.verdict h1 b { font-weight: 600; }
.verdict .nature {
  margin: 16px 0 0; font-family: var(--serif-en); font-style: italic;
  font-size: clamp(18px, 1.9vw, 21px); line-height: 1.55; color: var(--ink-2);
}
.verdict .nature cite, .sutra--en cite {
  display: block; margin-top: 4px; font-family: var(--body); font-style: normal;
  font-size: 12px; letter-spacing: .06em; color: var(--ink-3);
}
.zh { font-family: var(--wen); letter-spacing: .04em; }
.verdict .read { margin: 12px 0 0; font-family: var(--body); font-size: 16px; line-height: 27px; color: var(--ink-2); }
.verdict .meta { margin: 10px 0 0; font-family: var(--body); font-size: 14px; line-height: 23px; color: var(--ink-3); }

/* evidence layer, scope.md §7 — shown in English on English pages */
.claim {
  display: inline-block; margin-right: 4px; padding: 0 6px;
  border: 1px solid var(--ink-4); border-radius: 3px;
  font-size: 10.5px; line-height: 17px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2);
}

/* ---- Save natal chart ---- */
.keepbar {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px;
  margin-top: clamp(18px, 2.2vw, 26px); padding-top: clamp(16px, 2vw, 22px);
  border-top: 1px solid var(--rule); text-align: left;
}
.keepbar__rel { flex: 1 1 220px; }
.keepbar__rel > span { display: block; margin-bottom: 6px; font-size: 13px; color: var(--ink-3); }
.keepbar__rel em { font-style: normal; }
.keepbar .btn { flex: 0 0 auto; }
.keepbar__done { font-family: var(--body); font-size: 15px; color: var(--el-wood); }
.keepbar__done.is-bad { color: var(--el-fire); }

.sel {
  width: 100%; height: 46px; padding: 0 36px 0 14px;
  background-color: var(--paper, var(--page)); border: 1px solid var(--ink-4); border-radius: var(--r-btn);
  font: 16px/46px var(--ui); color: var(--ink);
  -webkit-appearance: none; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%),
                    linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: right 18px center, right 12px center;
  background-size: 6px 6px, 6px 6px; background-repeat: no-repeat;
}
.sel:focus { outline: none; border-color: var(--gold); }

/* ---- sections ---- */
.two { display: grid; grid-template-columns: 1fr; gap: clamp(16px, 2.2vw, 28px); }
@media (min-width: 900px) { .two { grid-template-columns: 1fr 1fr; } }
.one { display: grid; grid-template-columns: 1fr; }
.two .panel, .one .panel { margin-top: 0; }
.panel h2 { font-family: var(--serif-en); font-weight: 400; }
.one .elembar__row { grid-template-columns: clamp(96px, 12vw, 130px) 1fr 48px; }
.elembar__k { display: flex; align-items: center; gap: 8px; font-family: var(--body); font-size: 15px; }
.plate__lab { font-size: 12px; }

.wheelbox { display: grid; grid-template-columns: 1fr; gap: clamp(20px, 3vw, 40px); align-items: center; justify-items: center; }
@media (min-width: 860px) { .wheelbox { grid-template-columns: 340px 1fr; justify-items: stretch; } }
.wheel { max-width: 100%; height: auto; }
.sutra--en { font-family: var(--serif-en); font-style: italic; font-size: clamp(18px, 1.9vw, 21px); line-height: 1.6; }
.legend { font-family: var(--body); font-size: 13px; line-height: 24px; color: var(--ink-3); }
.legend i { display: inline-block; width: 22px; height: 0; vertical-align: middle;
            margin-right: 8px; border-top: 2px solid var(--sheng); }
.legend i.ke { border-top: 2px dashed var(--ke); }

.cardbox { display: flex; flex-wrap: wrap; gap: clamp(20px, 3vw, 40px); align-items: flex-start; }
.cardbox canvas { width: min(270px, 62vw); height: auto; aspect-ratio: 1080 / 1920;
                  border-radius: 10px; box-shadow: 0 12px 36px rgba(0, 0, 0, .28); }
@media (max-width: 599px) { .cardbox { justify-content: center; } }
.cardlist { margin: 0; padding: 0; list-style: none; }
.cardlist li {
  position: relative; padding-left: 22px;
  font-family: var(--body); font-size: 14px; line-height: 30px; color: var(--ink-2);
}
.cardlist li::before {
  content: ""; position: absolute; left: 4px; top: 14px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--gold);
}
/* Picked for Your Chart — the two strands chosen for this reading */
.recs__intro { margin: 10px 0 0; font-family: var(--body); font-size: 16px; line-height: 27px; color: var(--ink-2); }
.recs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 2.4vw, 28px); margin-top: 24px; }
.recs--one { grid-template-columns: minmax(0, 560px); }
@media (max-width: 719px) { .recs { grid-template-columns: minmax(0, 1fr); } }
.rec {
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--rule); border-radius: var(--r-card); background: var(--card); color: inherit;
  transition: box-shadow .18s ease, transform .18s ease;
}
.rec:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0, 0, 0, .1); }
.rec__art svg { display: block; width: 100%; height: auto; }
.rec__body { padding: clamp(16px, 2vw, 24px); }
.rec__series { margin: 0; font-family: var(--body); font-size: 13px; line-height: 20px; color: var(--clay); }
.rec h3 { margin: 4px 0 0; font-family: var(--serif-en); font-weight: 400; font-size: clamp(20px, 2.2vw, 24px); line-height: 1.25; color: var(--ink); }
.rec__line { margin: 6px 0 0; font-family: var(--body); font-size: 15px; line-height: 23px; font-style: italic; color: var(--ink-2); }
.rec__why { margin: 10px 0 0; font-family: var(--body); font-size: 15px; line-height: 24px; color: var(--ink-2); }
.rec__tags { justify-content: flex-start; margin: 14px 0 0; }
.rec__price { justify-content: flex-start; margin: 12px 0 0; }
.recs__all { margin: 28px 0 0; text-align: center; }

.section-h { margin: clamp(40px, 5vw, 56px) 0 24px; font-family: var(--serif-en); font-size: clamp(22px, 2.4vw, 26px); font-weight: 400; }
.empty { text-align: center; padding: 90px 0; }

/* Everything below the first screen is laid out when it is needed, not while
 * the casting animation is still running: on a slow phone building this page
 * in one go costs the better part of a second, and that shows up as a stutter
 * in the hand-over (Jade, 2026-10-16). */
.rv-defer { content-visibility: auto; contain-intrinsic-size: auto 560px; }

/* ---- arrival: sections rise in as the casting veil lifts ---- */
.result.is-waiting > * { opacity: 0; }
.result.is-entering > * { animation: rise .9s cubic-bezier(.22, .68, .3, 1) both; }
.result.is-entering > :nth-child(2) { animation-delay: .18s; }
.result.is-entering > :nth-child(3) { animation-delay: .32s; }
.result.is-entering > :nth-child(n+4) { animation-delay: .44s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ============================================================
 * Info dot — the explanation stays out of the way until it is asked for
 * (Jade, 2026-10-16). Mouse: hover. Touch: tap, since a hover that sticks
 * is worse than no hover at all.
 * ============================================================ */
.info { position: relative; display: inline-block; vertical-align: middle; margin-left: 7px; }
.info__dot {
  display: grid; place-items: center; width: 17px; height: 17px; padding: 0;
  background: none; border: 1px solid var(--ink-4); border-radius: 50%;
  font-family: var(--serif-en); font-style: italic; font-size: 11px; line-height: 1;
  color: var(--ink-3); cursor: pointer; transition: border-color .2s ease, color .2s ease;
}
.info__dot:hover, .info.is-open .info__dot { border-color: var(--gold); color: var(--gold); }
.info__dot:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.info__pop {
  position: absolute; z-index: 20; top: calc(100% + 9px); left: 50%;
  width: max-content; max-width: min(300px, calc(100vw - 40px));
  padding: 12px 14px;
  background: var(--card, #fff); border: 1px solid var(--rule); border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .14);
  font-family: var(--body); font-size: 13px; font-style: normal; font-weight: 400;
  line-height: 21px; letter-spacing: 0; text-align: left; text-transform: none; color: var(--ink-2);
  opacity: 0; visibility: hidden;
  /* --nudge is set in JS when the popup would otherwise run off a narrow
   * screen; without it the popup is simply centred under its dot */
  transform: translate(calc(-50% + var(--nudge, 0px)), -4px);
  transition: opacity .22s ease, transform .22s ease, visibility 0s linear .22s;
}
.info__pop b { font-weight: 500; color: var(--ink); }
.info__pop .claim { margin: 6px 4px 0 0; }
.info.is-open .info__pop, .info__dot:focus-visible + .info__pop {
  opacity: 1; visibility: visible; transition-delay: 0s;
  transform: translate(calc(-50% + var(--nudge, 0px)), 0);
}
@media (hover: hover) {
  .info:hover .info__pop {
    opacity: 1; visibility: visible; transition-delay: 0s;
    transform: translate(calc(-50% + var(--nudge, 0px)), 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .verdict__disc .bagua { animation: none; }
  .result.is-entering > * { animation-duration: .01s; animation-delay: 0s !important; }
  .info__pop { transition-duration: .01s; }
}
