/* "Метод Дмитрия Петрова" — scroll onboarding for /methods/.
   Ported from a React artifact. Self-contained and namespaced under .pm- so it
   cannot leak into the light-themed site template it sits inside. */

.pm {
    position: relative;
    background: #100E1A;
    color: #F2EDF8;
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Full-bleed inside the template's centred container. Deliberately no
       overflow property here: any value other than visible would turn this into
       a scroll container, and the hexagon's position:sticky would then stick to
       it — which does not scroll — instead of to the window. */
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.pm * { box-sizing: border-box; }

.pm-progress {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 3px;
    background: rgba(255, 255, 255, 0.06);
    z-index: 50;
}
.pm-progress__bar { height: 100%; width: 0; background: #8E6FC4; }

.pm-scroller { position: relative; }

/* ── hexagon ─────────────────────────────────────────────────────────────── */

.pm-hex {
    position: sticky;
    top: 0;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.pm-hex__inner {
    position: absolute;
    top: 50%;
    left: calc(50% - 240px);
    width: 480px;
    height: 480px;
    transform: translateY(-50%);
}

.pm-hex__svg { position: absolute; top: 0; left: 0; }

.pm-hex__rotate {
    transform-origin: 200px 200px;
    transform-box: view-box;
    transition: transform 0.55s cubic-bezier(0.65, 0, 0.35, 1);
}

.pm-hex__wedges path { transition: opacity 0.6s ease; }
.pm-hex__labels text { transition: all 0.4s ease; }
.pm-icon { transform-box: view-box; transition: opacity 0.4s ease; }

@keyframes pmSpinGear { to { transform: rotate(360deg); } }
.pm-gear {
    transform-box: fill-box;
    transform-origin: center;
    animation: pmSpinGear 20s linear infinite;
}

/* Менталитет: the photo the jigsaw uncovers. Swap the image in when there is
   one — until then the gradient reads as an abstract cityscape rather than a
   broken image. */
.pm-mosaic {
    position: relative;
    width: 150px; height: 150px;
    border-radius: 8px;
    overflow: hidden;
    background: linear-gradient(150deg, #4A3F63 0%, #A896C8 45%, #6B5A8E 100%);
    background-size: cover;
    background-position: center;
}
.pm-mosaic__tile {
    position: absolute;
    inset: 0;
    background: #100E1A;
    transition: opacity 0.7s ease;
}

/* ── dots ────────────────────────────────────────────────────────────────── */

.pm-dots {
    position: absolute;
    bottom: 56px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 9px;
    z-index: 3;
}
.pm-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    transition: background 0.4s ease;
}

/* ── content layer ───────────────────────────────────────────────────────── */

.pm-content {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 2;
}

.pm-intro, .pm-outro {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 24px;
}

.pm-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #B99AE6;
    margin-bottom: 18px;
}

.pm-title {
    font-family: 'Geologica', sans-serif;
    font-size: clamp(28px, 5vw, 48px);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.12;
    max-width: 680px;
    margin-bottom: 18px;
}
.pm-title em {
    font-family: 'Lora', serif;
    font-style: italic;
    font-weight: 400;
    color: #B99AE6;
}

.pm-lede {
    font-size: 16px;
    color: #A896C8;
    max-width: 480px;
    line-height: 1.7;
}

@keyframes pmBounce {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(10px); }
}
.pm-arrow {
    margin-top: 56px;
    font-size: 22px;
    color: #6B5A8E;
    animation: pmBounce 1.6s ease-in-out infinite;
}

.pm-quote {
    font-family: 'Lora', serif;
    font-size: 22px;
    font-style: italic;
    color: #F2EDF8;
    max-width: 520px;
    line-height: 1.6;
    margin-bottom: 34px;
}

/* ── cards ───────────────────────────────────────────────────────────────── */

.pm-block { position: relative; }

.pm-card {
    position: sticky;
    top: 5vh;
    padding: 16px 20px;
    max-width: min(480px, 74vw);
    margin: 0 auto;
    background: rgba(10, 8, 18, 0.8);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border-radius: 18px;
}

.pm-card-layer { position: relative; }

.pm-card__num {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.pm-card__name {
    font-family: 'Geologica', sans-serif;
    font-size: clamp(20px, 3.4vw, 28px);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
}

.pm-card__pips {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.pm-card__pips i {
    width: 26px; height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.15);
    transition: background 0.4s ease;
}
.pm-card__deg {
    font-size: 12px;
    font-weight: 600;
    color: #A896C8;
    margin-left: 6px;
}

.pm-card__blurb {
    font-family: 'Lora', serif;
    font-size: 14.5px;
    font-style: italic;
    line-height: 1.5;
    color: #D8CFEA;
}

.pm-card__btn,
.pm-cta {
    pointer-events: auto;
    font-family: 'Manrope', sans-serif;
    cursor: pointer;
}

.pm-card__btn {
    margin-top: 14px;
    font-size: 13px;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 99px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: #F2EDF8;
    transition: background 0.2s ease;
}
.pm-card__btn:hover,
.pm-card__btn:focus-visible { background: rgba(255, 255, 255, 0.16); }

.pm-cta {
    display: inline-block;
    font-size: 15px;
    font-weight: 700;
    padding: 16px 36px;
    border-radius: 99px;
    border: none;
    background: #7E5FB0;
    color: #fff;
    text-decoration: none;
    transition: background 0.2s ease;
}
.pm-cta:hover,
.pm-cta:focus-visible { background: #8E6FC4; color: #fff; text-decoration: none; }

/* ── small screens ───────────────────────────────────────────────────────── */

/* On a phone the card and the hexagon were fighting for the same middle of the
   screen and the card won, hiding the thing it describes. Split the viewport
   instead: card at the top, illustration below it and smaller. Anchoring the
   scale to the bottom edge keeps the hexagon's footprint predictable, so the
   dots can sit under it without overlapping. */
@media (max-width: 720px) {
    .pm-hex__inner {
        top: auto;
        bottom: 9vh;
        left: 50%;
        margin-left: -240px;
        transform: scale(0.56);
        transform-origin: bottom center;
    }
    .pm-dots { bottom: 22px; }

    .pm-card {
        max-width: 92vw;
        padding: 13px 15px;
        top: 3vh;
    }
    .pm-card__name { margin-bottom: 8px; }
    .pm-card__blurb { font-size: 13.5px; line-height: 1.45; }
    .pm-card__pips { margin-bottom: 10px; }
    .pm-card__btn { margin-top: 12px; }

    .pm-title { font-size: clamp(24px, 7vw, 34px); }
    .pm-lede { font-size: 15px; }
    .pm-arrow { margin-top: 36px; }
}

/* Short landscape phones: the hexagon has nowhere to go, so lean on it less. */
@media (max-width: 720px) and (max-height: 520px) {
    .pm-hex__inner { transform: scale(0.4); bottom: 4vh; }
    .pm-card__blurb { font-size: 12.5px; }
}

/* Readers who ask for less motion get the content without the spinning gears
   or the crossfades. Scroll is never hijacked for anyone since the snapping was
   removed; the button's scroll is a direct response to a click, so it stays. */
@media (prefers-reduced-motion: reduce) {
    .pm-gear { animation: none; }
    .pm-arrow { animation: none; }
    .pm-hex__rotate,
    .pm-hex__wedges path,
    .pm-icon,
    .pm-mosaic__tile { transition: none; }
}
