/* Phone practice cards and pager. */
.pp-ink-night {
  --pp-line: rgba(212, 182, 145, 0.64);
  --pp-line-f: rgba(212, 182, 145, 0.32);
  --pp-star: rgb(244, 234, 214);
  --pp-glint: rgb(217, 186, 128);
  --pp-alpha: rgb(236, 208, 152);
  --pp-halo-c: rgb(217, 186, 128);
  --pp-lit-line: rgba(236, 208, 152, 0.95);
}
.pp-ink-paper {
  --pp-line: rgba(32, 48, 57, 0.36);
  --pp-line-f: rgba(32, 48, 57, 0.18);
  --pp-star: rgb(38, 56, 66);
  --pp-glint: rgb(64, 84, 95);
  --pp-alpha: rgb(138, 61, 64);
  --pp-halo-c: rgb(138, 61, 64);
  --pp-lit-line: rgba(138, 61, 64, 0.9);
}

.pp-svg { display: block; overflow: visible; flex: none; pointer-events: none; }
.pp-svg .pp-ln {
  fill: none; stroke: var(--pp-line); stroke-width: var(--pp-hair, 1px); stroke-linecap: butt;
  transform-box: fill-box; transform-origin: 0 50%;
}
.pp-svg .pp-ln--f { stroke: var(--pp-line-f); }
.pp-svg .pp-core { fill: var(--pp-star); }
.pp-svg .pp-glint { fill: var(--pp-glint); opacity: 0.9; }
.pp-svg .pp-halo { fill: var(--pp-halo, none); color: var(--pp-halo-c); opacity: 0.6; }
.pp-svg .pp-st--alpha .pp-core, .pp-svg .pp-st--alpha .pp-glint { fill: var(--pp-alpha); opacity: 1; }
.pp-svg .pp-b { transform-box: fill-box; transform-origin: 50% 50%; }

/* the lit layer: gold lines and stars over the plate, faded in on press or keyboard focus */
.pp-svg .pp-fig--lit { opacity: 0; transition: opacity 0.28s ease; }
.pp-svg .pp-fig--lit .pp-ln, .pp-svg .pp-fig--lit .pp-ln--f { stroke: var(--pp-lit-line); }
.pp-svg .pp-fig--lit .pp-core, .pp-svg .pp-fig--lit .pp-glint { fill: var(--pp-alpha); opacity: 1; }
.pp-lit .pp-svg .pp-fig--lit { opacity: 1; transition-duration: 0.12s; }

/* drawing: before its turn a figure is not there; then stars open and hairlines grow from the brightest
   star outward. Only while motion is allowed (html.pp-motion); otherwise it is simply drawn. */
.pp-motion .pp-svg .pp-fig--rest .pp-ln { transform: scaleX(0); transition: transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) var(--d, 0ms); }
.pp-motion .pp-svg .pp-fig--rest .pp-b { opacity: 0; transform: scale(0.3); transition: opacity 0.45s ease var(--d, 0ms), transform 0.65s cubic-bezier(0.22, 0.61, 0.36, 1) var(--d, 0ms); }
.pp-motion .pp-drawn .pp-svg .pp-fig--rest .pp-ln,
.pp-motion .pp-svg.pp-drawn .pp-fig--rest .pp-ln { transform: none; }
.pp-motion .pp-drawn .pp-svg .pp-fig--rest .pp-b,
.pp-motion .pp-svg.pp-drawn .pp-fig--rest .pp-b { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .pp-svg *, .pp-on .pp-rv, .pp-on .pp-rv * { transition: none !important; }
}
/* Phone practice cards and pager. */
@media (width < 768px) {
  :is(html, #pp-w#pp-x#pp-y#pp-z).pp-c body.home #practices.pp-deck {
    overflow-x: clip;
    &::before { background-image: none !important; }

    /* ---------- the deck: native scrolling, one plate per snap, the next plate at the edge ---------- */
    .asy-practice-grid {
      display: flex !important; flex-wrap: nowrap !important; align-items: stretch !important; gap: 10px !important; grid-template-columns: none !important;
      overflow-x: auto !important; overflow-y: hidden !important; overscroll-behavior-x: contain;
      scroll-snap-type: x mandatory !important; scroll-padding-inline: 24px;
      margin: 0 -24px !important; padding: 0 24px 8px !important; border: 0 !important;
      scrollbar-width: none; -ms-overflow-style: none;
    }
    .asy-practice-grid.pp-scrub { scroll-snap-type: none !important; }
    .asy-practice-grid::-webkit-scrollbar { display: none; }
    :is(.asy-slider-dots, .am-index-more) { display: none !important; }

    /* ---------- one plate ---------- */
    .asy-practice-grid > .asy-practice-card.pp-card {
      display: grid !important; grid-template-columns: minmax(0, 1fr) auto;
      grid-template-rows: auto minmax(4px, 1fr) auto auto auto;
      grid-template-areas: "num fig" ". ." "name name" "desc desc" "foot foot";
      align-items: start; position: relative; box-sizing: border-box; isolation: isolate; gap: 0 12px !important;
      flex: 0 0 calc(100% - 46px) !important; width: calc(100% - 46px) !important; max-width: none !important; min-width: 0 !important;
      min-height: 0 !important; margin: 0 !important; padding: 14px 16px 12px 18px !important;
      scroll-snap-align: start !important; scroll-snap-stop: always;
      border: 0 !important; border-radius: 6px !important; color: #f4efe8 !important; text-decoration: none !important;
      background:
        radial-gradient(70% 46% at 88% 6%, rgba(217, 186, 128, 0.11), rgba(217, 186, 128, 0) 70%),
        linear-gradient(160deg, #131a1d 0%, #19252b 48%, #21323a 100%) !important;
      box-shadow: inset 0 0 0 var(--pp-hair, 1px) rgba(212, 182, 145, 0.22), 0 12px 20px -16px rgba(16, 22, 26, 0.65) !important;
      opacity: 1; transform: none;
      transition: transform 0.32s cubic-bezier(0.22, 0.61, 0.36, 1);
      -webkit-tap-highlight-color: transparent; outline: none;
    }
    /* the inner engraved frame */
    .asy-practice-card.pp-card::after {
      content: '' !important; display: block !important; position: absolute !important; inset: 4px !important; z-index: 0 !important;
      width: auto !important; height: auto !important; border-radius: 3px !important; background: none !important;
      border: var(--pp-hair, 1px) solid rgba(212, 182, 145, 0.13) !important; opacity: 1 !important; transform: none !important; pointer-events: none;
    }
    /* the frame warms to gold on press and on keyboard focus (an opacity change on its own layer) */
    .pp-card > .pp-glow {
      position: absolute; inset: 4px; z-index: 0; border-radius: 3px; pointer-events: none;
      border: var(--pp-hair, 1px) solid rgba(226, 196, 140, 0.62);
      box-shadow: inset 0 0 18px rgba(217, 186, 128, 0.07);
      opacity: 0; transition: opacity 0.3s ease;
    }
    .asy-practice-card.pp-card.pp-lit { transform: scale(0.985); transition-duration: 0.12s; }
    .pp-card.pp-lit > .pp-glow { opacity: 1; transition-duration: 0.1s; }
    .asy-practice-card.pp-card:focus-visible { outline: 2px solid #e2c48c !important; outline-offset: -7px !important; box-shadow: inset 0 0 0 var(--pp-hair, 1px) rgba(212, 182, 145, 0.22) !important; }
    /* the foot rule, leading to the arrow */
    .asy-practice-card.pp-card::before {
      content: '' !important; display: block !important; position: absolute !important; z-index: 1 !important;
      left: 18px !important; right: 54px !important; bottom: 25px !important; top: auto !important; width: auto !important; height: var(--pp-hair, 1px) !important;
      background: linear-gradient(90deg, rgba(212, 182, 145, 0.38), rgba(212, 182, 145, 0.2)) !important;
      border: 0 !important; border-radius: 0 !important; opacity: 1 !important; transform: none !important;
    }

    .pp-card > :is(.asy-practice-card__icon, .ow-cardfig, .ow-hit) { display: none !important; }
    .pp-card > :not(.pp-glow) { position: relative; z-index: 1; }

    /* numeral and a short engraved rule, like the eyebrow above the title */
    .pp-card > .pp-num {
      grid-area: num; align-self: start; display: inline-flex; align-items: center; gap: 8px; padding-top: 1px;
      font: 600 14px/1 'Cormorant Garamond', 'EB Garamond', Georgia, serif; font-variant-numeric: lining-nums tabular-nums;
      letter-spacing: 0.08em; color: #d4b47b;
    }
    .pp-card > .pp-num::after { content: ''; width: 22px; height: var(--pp-hair, 1px); background: rgba(212, 182, 145, 0.5); }
    .pp-card > .pp-plate { grid-area: fig; justify-self: end; width: 52px; height: 52px; margin: -3px -4px 0 0; }

    .pp-card > .asy-practice-card__name {
      grid-area: name; margin: 0 0 5px !important; padding: 0 !important; max-width: 100%;
      font: 600 23px/1.08 var(--fx-serif-display, 'Cormorant Garamond'), 'EB Garamond', Georgia, serif !important; letter-spacing: 0 !important; color: #f6f1ea !important;
      text-align: start !important; text-wrap: balance; overflow-wrap: break-word; -webkit-hyphens: manual; hyphens: manual;
    }
    .pp-card > .asy-practice-card__desc {
      grid-area: desc; display: block !important; margin: 0 0 12px !important; padding: 0 !important; max-width: 100% !important;
      font: 400 13px/1.5 var(--font-sans, Inter, sans-serif) !important; letter-spacing: 0 !important; color: rgba(244, 239, 232, 0.8) !important;
      text-align: start !important; text-wrap: pretty; -webkit-hyphens: manual; hyphens: manual;
      -webkit-line-clamp: unset !important; overflow: visible !important; opacity: 1 !important; transform: none !important;
    }
    .pp-card:lang(zh) > .asy-practice-card__desc { text-align: justify !important; font-size: 13.5px !important; line-height: 1.6 !important; letter-spacing: 0.02em !important; }
    .pp-card > .asy-practice-card__arrow {
      grid-area: foot; justify-self: end; align-self: end; display: grid !important; place-items: center; position: relative !important; inset: auto !important;
      width: 28px !important; height: 28px !important; margin: 0 !important; padding: 0 !important; border-radius: 50% !important;
      border: var(--pp-hair, 1px) solid rgba(212, 182, 145, 0.55) !important; background: transparent !important;
      color: #e2c48c !important; font: 400 14px/1 var(--font-sans, Inter, sans-serif) !important; opacity: 1 !important;
      transform: none !important; transition: none !important;
    }
    .pp-card > .asy-practice-card__arrow > .pp-arrow { display: block; transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1); }
    .pp-card.pp-lit > .asy-practice-card__arrow > .pp-arrow { transform: translateX(2px); transition-duration: 0.12s; }

    /* ---------- under the deck: count, engraved scale, step pill (one 40 px line) ---------- */
    .pp-pager {
      display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: 14px;
      height: 40px; margin: 4px 0 0;
    }
    .pp-count {
      font: 600 19px/1 'Cormorant Garamond', 'EB Garamond', Georgia, serif; font-variant-numeric: lining-nums tabular-nums;
      letter-spacing: 0.04em; color: #203039; white-space: nowrap;
    }
    .pp-count__of { color: #55636b; }
    /* the scale: a hairline with twelve steps; the burgundy mark follows the deck. Tap a step or drag along it. */
    .pp-scale {
      position: relative; display: block; height: 44px; margin: -2px 0; cursor: pointer; touch-action: none;
      -webkit-tap-highlight-color: transparent; outline: none; border-radius: 2px;
    }
    .pp-scale__rule, .pp-scale__ticks { position: absolute; left: 0; right: 0; top: 50%; pointer-events: none; transform-origin: 0 50%; }
    .pp-scale__rule { height: var(--pp-hair, 1px); background: rgba(32, 48, 57, 0.3); }
    .pp-scale__ticks {
      height: 4px; margin-top: -1.5px;
      background: repeating-linear-gradient(90deg, rgba(32, 48, 57, 0.26) 0 var(--pp-hair, 1px), transparent 0 calc(100% / var(--pp-n, 12)));
      border-right: var(--pp-hair, 1px) solid rgba(32, 48, 57, 0.26);
    }
    .pp-scale__mark {
      position: absolute; left: 0; top: 50%; height: 3px; margin-top: -1px; width: calc(100% / var(--pp-n, 12)); border-radius: 1.5px;
      background: #8a3d40; pointer-events: none; will-change: transform;
    }
    .pp-scale:focus-visible { outline: 2px solid #6b2b2d; outline-offset: -8px; }

    /* the step pill, the same hairline control as the menu's languages */
    .pp-steps {
      display: grid; grid-template-columns: 44px 44px; height: 40px; box-sizing: border-box; padding: 2px; margin: 0;
      border: 1px solid #d8cbbd; border-radius: 999px; background: transparent;
    }
    .pp-step {
      position: relative; display: block; width: 44px; height: 34px; margin: 0; padding: 0; border: 0; border-radius: 999px; cursor: pointer;
      background: transparent; color: #203039; -webkit-tap-highlight-color: transparent;
      transition: opacity 0.25s ease;
    }
    .pp-step + .pp-step::after { content: ''; position: absolute; left: 0; top: 9px; bottom: 9px; width: 1px; background: #e4d9cc; }
    .pp-step::before {
      content: ''; position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; border: solid currentColor; border-width: 0 0 1.25px 1.25px;
      transform: translate(-25%, -50%) rotate(45deg);
    }
    .pp-step--next::before { transform: translate(-75%, -50%) rotate(-135deg); }
    /* the hit area reaches 44 px tall without making the pill taller */
    .pp-step > .pp-hit { position: absolute; left: 0; right: 0; top: -5px; bottom: -5px; }
    .pp-step:active:not(:disabled) { background: rgba(32, 48, 57, 0.06); }
    .pp-step:disabled { opacity: 0.3; cursor: default; }
    .pp-step:focus-visible { outline: 2px solid #6b2b2d; outline-offset: 1px; box-shadow: none; }
  }

  /* The calm entrance (motion allowed only: the first plate rises, the next slides in at the edge, the scale is
     engraved from the left) is driven from the script with the Web Animations API; when it ends nothing runs.
     Reduced motion: the press only changes the frame and figure, without any movement or fade. */
  @media (prefers-reduced-motion: reduce) {
    :is(html, #pp-w#pp-x#pp-y#pp-z).pp-c body.home #practices.pp-deck {
      .asy-practice-grid { scroll-behavior: auto !important; }
      .asy-practice-grid > .asy-practice-card.pp-card, .pp-card > .pp-glow, .pp-card > .asy-practice-card__arrow > .pp-arrow, .pp-step { transition: none !important; }
      .asy-practice-grid > .asy-practice-card.pp-card.pp-lit, .pp-card.pp-lit > .asy-practice-card__arrow > .pp-arrow { transform: none !important; }
    }
  }

  /* ================= Practices page: compact rows, each led by a small night plate ================= */
  :is(html, #pp-w#pp-x#pp-y#pp-z).pp-c body.page-template-page-practices .pp-chips {
    .am-record > summary { display: grid !important; grid-template-columns: 36px minmax(0, 1fr) auto; column-gap: 14px; align-items: center; }
    .pp-chip {
      grid-column: 1; grid-row: 1; position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 6px;
      background:
        radial-gradient(80% 60% at 80% 0%, rgba(217, 186, 128, 0.13), rgba(217, 186, 128, 0) 72%),
        linear-gradient(160deg, #131a1d, #1f2f37);
      box-shadow: inset 0 0 0 var(--pp-hair, 1px) rgba(212, 182, 145, 0.24);
    }
    .pp-chip::after {
      content: ''; position: absolute; inset: 2.5px; border-radius: 4px; pointer-events: none;
      border: var(--pp-hair, 1px) solid rgba(212, 182, 145, 0.14);
    }
    .pp-chip > .pp-svg { width: 28px; height: 28px; position: relative; z-index: 1; }
    .am-record > summary > .asy-pd-card__title { grid-column: 2; grid-row: 1; }
    .am-record > summary::after { grid-column: 3; grid-row: 1; }
    /* the opened text keeps the live full column (justified, live hyphenation), so no extra indentation */
    :is(.asy-pd-card__icon, .ow-cardfig, .ow-hit) { display: none !important; }
  }
}

/* The base theme sets colours on text nested inside a practice name. */
@media (width < 768px) {
  :is(html,#pp-w#pp-x#pp-y#pp-z).pp-c body.home #practices .pp-card .asy-practice-card__name,
  :is(html,#pp-w#pp-x#pp-y#pp-z).pp-c body.home #practices .pp-card .asy-practice-card__name * { color:#f6f1ea !important; }
}

@media (width < 768px) {
  :is(html,#pp-w#pp-x#pp-y#pp-z).pp-c body.home #practices .pp-card .asy-practice-card__name { transition:none !important; }
  @media (scripting: none) { html body.home #practices .asy-practice-grid .asy-practice-card__desc { display:block !important; } }
}
