/* ============================================================
   Plan cards. Shared by the Pricing section of the home page and the
   dedicated /pricing page, so the tokens hang off the .pricing-v2 class
   rather than the #Pricing id.

   Deliberately flat: no gradient fills anywhere, only solid surfaces and
   hairline rules. The card keeps the chamfered corner used by the Technology
   and Company sections so the page still reads as one design, but drops the
   gradient edge and corner ticks those sections use, because at this density
   they turned into noise.

   All three cards are styled identically. Nothing is highlighted, so the
   comparison is left to the reader, and the carry-over line on the paid plans
   is an ordinary first item rather than a separate heading.
   ============================================================ */

.pricing-v2 {
    /* Local, solid tokens. Kept separate from the --tk-* set because those
       carry gradients for the other sections. */
    --pr-surface: #0d0e1f;
    --pr-line: rgba(150, 170, 255, 0.16);
    --pr-line-strong: rgba(150, 170, 255, 0.34);
    --pr-edge: rgba(150, 170, 255, 0.20);
    --pr-ink: #eef1fb;
    --pr-muted: #99a1c4;
    --pr-faint: #6c749a;
    --pr-accent: #7dd3fc;
    --pr-btn-border: rgba(210, 220, 255, 0.26);
    --pr-solid: #ffffff;
    --pr-solid-ink: #0d0e1f;
    --pr-current-bg: rgba(150, 170, 255, 0.08);
    --pr-error: #f6828b;

    /* Marker glyph. A mask, not an image, so it takes the accent colour and
       follows the theme. */
    --pr-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M1.6 6.4l2.9 2.9 5.9-5.9' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

html[data-theme="light"] .pricing-v2 {
    --pr-surface: #ffffff;
    --pr-line: rgba(40, 50, 120, 0.12);
    --pr-line-strong: rgba(40, 50, 120, 0.22);
    --pr-edge: rgba(40, 50, 120, 0.16);
    --pr-ink: #151932;
    --pr-muted: #5b6285;
    --pr-faint: #8189a8;
    --pr-accent: #2563eb;
    --pr-btn-border: rgba(40, 50, 120, 0.28);
    --pr-solid: #1b2444;
    --pr-solid-ink: #ffffff;
    --pr-current-bg: rgba(40, 50, 120, 0.06);
    --pr-error: #c0342c;
}

.pr-layout {
    text-align: left;
}

/* ── Interval toggle ─────────────────────────────────────────────────── */

.pr-switch {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    margin: 0 auto 24px;
    padding: 3px;
    width: fit-content;
    border: 1px solid var(--pr-line-strong);
    border-radius: 8px;
}

.pr-switch-btn {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--pr-muted);
    font-family: var(--font-body);
    font-size: 0.86rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 8px 26px;
    border-radius: 6px;
    cursor: pointer;
    transition: color var(--transition-fast), background var(--transition-fast);
}

.pr-switch-btn:hover {
    color: var(--pr-ink);
}

.pr-switch-btn[aria-selected="true"] {
    background: var(--pr-solid);
    color: var(--pr-solid-ink);
}

/* ── Card grid ───────────────────────────────────────────────────────── */

.pr-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    align-items: stretch;
}

/* The 1px outer layer is the border. clip-path cannot take a real border, so
   the chamfer is drawn twice: once here and once on the inner surface. */
.pr-card {
    --pcut: 20px;
    position: relative;
    padding: 1px;
    background: var(--pr-edge);
    clip-path: polygon(var(--pcut) 0, 100% 0, 100% calc(100% - var(--pcut)), calc(100% - var(--pcut)) 100%, 0 100%, 0 var(--pcut));
    transition: background var(--transition-fast);
}

.pr-card:hover {
    background: var(--pr-line-strong);
}

.pr-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--pr-surface);
    clip-path: polygon(var(--pcut) 0, 100% 0, 100% calc(100% - var(--pcut)), calc(100% - var(--pcut)) 100%, 0 100%, 0 var(--pcut));
}

/* ── Header band ─────────────────────────────────────────────────────── */

.pr-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    /* Left padding clears the chamfer, which eats the top left corner. */
    padding: 13px 26px 12px 30px;
    border-bottom: 1px solid var(--pr-line);
}

.pr-kicker {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.17em;
    text-transform: uppercase;
    color: var(--pr-muted);
}

.pr-index {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    color: var(--pr-faint);
    font-variant-numeric: tabular-nums;
}

/* ── Body ────────────────────────────────────────────────────────────── */

.pr-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    padding: 22px 26px 0;
}

.pr-name {
    font-family: var(--font-display);
    font-size: 1.95rem;
    font-weight: 600;
    line-height: 1.05;
    color: var(--pr-ink);
    margin: 0 0 10px;
}

.pr-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 0 0 6px;
}

.pr-amount {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.005em;
    color: var(--pr-ink);
    font-variant-numeric: tabular-nums;
}

/* Body face here, not the condensed display face. Khand at this size reads as
   cramped next to the numeral. */
.pr-cadence {
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--pr-muted);
}

.pr-meta {
    font-family: var(--font-body);
    font-size: 0.82rem;
    color: var(--pr-faint);
    margin: 0 0 18px;
}

/* ── Feature list ────────────────────────────────────────────────────── */

.pr-features {
    list-style: none;
    margin: 0 0 20px;
    padding: 18px 0 0;
    border-top: 1px solid var(--pr-line);
    flex: 1 1 auto;
}

/* Two columns rather than absolute positioning. The marker column is a real
   grid track, so the glyph cannot drift out of line with the text, and a
   feature that wraps to three lines keeps its marker on the first one. */
.pr-features li {
    display: grid;
    grid-template-columns: 13px minmax(0, 1fr);
    column-gap: 12px;
    font-family: var(--font-body);
    font-size: 0.91rem;
    line-height: 1.55;
    color: var(--pr-ink);
}

.pr-features li + li {
    margin-top: 10px;
}

/* Height equals exactly one line box, so `center` lands the check on the
   optical middle of the first line at any text length. */
.pr-features li::before {
    content: '';
    width: 13px;
    height: 1.55em;
    background: var(--pr-accent);
    -webkit-mask: var(--pr-check) center / 12px 12px no-repeat;
    mask: var(--pr-check) center / 12px 12px no-repeat;
}

/* ── Action ──────────────────────────────────────────────────────────── */

.pr-action {
    padding: 0 26px 22px;
}

.pr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 22px;
    border: 1px solid var(--pr-btn-border);
    border-radius: 7px;
    background: transparent;
    color: var(--pr-ink);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: border-color var(--transition-fast), background var(--transition-fast),
        color var(--transition-fast);
}

.pr-action .pr-btn {
    display: flex;
    width: 100%;
}

.pr-btn:hover,
.pr-btn:focus-visible {
    border-color: var(--pr-ink);
    color: var(--pr-ink);
    text-decoration: none;
}

/* The plan the reader is already on. Not a button: there is nothing to do. */
.pr-btn--current,
.pr-btn--current:hover,
.pr-btn--current:focus-visible {
    background: var(--pr-current-bg);
    border-color: transparent;
    color: var(--pr-muted);
    cursor: default;
    font-weight: 500;
}

.pr-btn--current::before {
    content: '';
    width: 12px;
    height: 12px;
    margin-right: 9px;
    background: var(--pr-muted);
    -webkit-mask: var(--pr-check) center / 12px 12px no-repeat;
    mask: var(--pr-check) center / 12px 12px no-repeat;
}

.pr-btn[disabled] {
    opacity: 0.55;
    cursor: default;
}

.pr-status {
    font-family: var(--font-body);
    font-size: 0.86rem;
    line-height: 1.5;
    color: var(--pr-muted);
    text-align: center;
    margin: 14px 0 0;
}

.pr-status--error {
    color: var(--pr-error);
}

/* Link out to the full pricing page. */
.pr-more {
    text-align: center;
    margin-top: 20px;
}

/* ── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 1399.98px) {
    .pr-amount {
        font-size: 2.8rem;
    }
}

@media (max-width: 1199.98px) {
    .pr-grid {
        gap: 14px;
    }

    .pr-name {
        font-size: 1.75rem;
    }

    .pr-amount {
        font-size: 2.5rem;
    }

    .pr-head {
        padding: 13px 20px 12px 26px;
    }

    .pr-body {
        padding: 18px 20px 0;
    }

    .pr-action {
        padding: 0 20px 18px;
    }
}

@media (max-width: 991.98px) {
    .pr-grid {
        grid-template-columns: 1fr;
        max-width: 520px;
        margin: 0 auto;
    }

    .pr-features {
        flex: 0 0 auto;
    }
}

@media (max-width: 767.98px) {
    .pr-card {
        --pcut: 16px;
    }

    .pr-switch {
        width: 100%;
        justify-content: stretch;
    }

    .pr-switch-btn {
        flex: 1 1 0;
        padding: 9px 12px;
    }
}

/* ── Changing plan: the confirmation ─────────────────────────────────────── */

/*
 * Shown before any change to an existing membership, with the amounts Stripe
 * will actually charge. Built like the site's cards: two clipped layers so the
 * border follows the cut corners.
 */
.pr-change {
    position: fixed;
    inset: 0;
    z-index: 2400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(4, 5, 14, 0.62);
    animation: pr-change-fade .16s ease both;
}

.pr-change[hidden] { display: none; }

.pr-change-box {
    --pcut: 18px;
    width: min(460px, 100%);
    filter: drop-shadow(0 22px 40px rgba(0, 0, 0, 0.45));
    animation: pr-change-rise .2s cubic-bezier(.2, .8, .2, 1) both;
    text-align: left;
}

.pr-change-box:focus { outline: none; }

.pr-change-frame,
.pr-change-in {
    clip-path: polygon(var(--pcut) 0, 100% 0, 100% calc(100% - var(--pcut)),
        calc(100% - var(--pcut)) 100%, 0 100%, 0 var(--pcut));
}

.pr-change-frame {
    padding: 1px;
    background: var(--pr-line-strong);
}

.pr-change-in {
    background: var(--pr-surface);
    padding: 26px 28px 24px;
}

.pr-change-kicker {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.17em;
    text-transform: uppercase;
    color: var(--pr-accent);
    margin: 0 0 8px;
}

.pr-change-title {
    font-family: 'Khand', 'Inter', sans-serif;
    font-size: 1.9rem;
    font-weight: 600;
    line-height: 1.05;
    color: var(--pr-ink);
    margin: 0 0 12px;
}

.pr-change-text {
    font-size: 0.93rem;
    line-height: 1.55;
    color: var(--pr-muted);
    margin: 0 0 16px;
}

.pr-change-rows {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
    border-top: 1px solid var(--pr-line);
}

.pr-change-rows li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--pr-line);
    font-size: 0.9rem;
}

.pr-change-rows .k { color: var(--pr-muted); }
.pr-change-rows .v { color: var(--pr-ink); font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.pr-change-rows li.is-total .v { font-size: 1.05rem; }

.pr-change-error {
    font-size: 0.86rem;
    line-height: 1.5;
    color: var(--pr-error);
    margin: 0 0 14px;
}

.pr-change-error:empty { display: none; }

.pr-change-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

@keyframes pr-change-fade { from { opacity: 0; } }
@keyframes pr-change-rise { from { opacity: 0; transform: translateY(8px) scale(0.985); } }

@media (prefers-reduced-motion: reduce) {
    .pr-change, .pr-change-box { animation: none; }
}

.pr-change .pr-btn--solid,
.pr-change .pr-btn--solid:hover,
.pr-change .pr-btn--solid:focus-visible {
    border-color: var(--pr-accent);
    background: var(--pr-accent);
    color: var(--pr-on-accent, #06070f);
}

.pr-change .pr-btn--solid:hover,
.pr-change .pr-btn--solid:focus-visible { filter: brightness(1.08); }

.pr-change .pr-btn:disabled { opacity: 0.6; cursor: default; filter: none; }
