/* The pricing page: the plan cards and benefits table it always had, with the extension's night theme,
   spring motion and click accents. Sizes follow --screen so the title and the four plans fit on the first
   screen of a 1920x1080 display, and of smaller ones; */

:root {
    --blue: #22a7f0;
    --blue-dark: #0d8bd9;
    --check: #ffb919;
    --check-dark: #e6a300;
    --row: rgba(240, 242, 244, 0.58);
    --card-glass: rgba(255, 255, 255, 0.2);
    --card-solid: rgba(255, 255, 255, 0.97);
    --li-line: #f0f2f4;
    --no-ink: #b9c3ca;
    --no-mark: #dfe5e9;
    --dash-ink: #d0d8de;
}

[data-theme="dark"] {
    --row: rgba(255, 255, 255, 0.04);
    --card-glass: rgba(16, 30, 44, 0.78);
    --card-solid: rgba(20, 36, 52, 0.97);
    --li-line: rgba(255, 255, 255, 0.07);
    --no-ink: #5d6f7c;
    --no-mark: #3d4d59;
    --dash-ink: #3a4a57;
}

/*////////////////////////////////////////////////////////////////////////*/
/* The page scrolls by itself, under the toolbar teeth and into the footer shadow (shell.js places it); */

.site-page {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
    scroll-behavior: smooth;
    padding: calc(10.5vh + var(--screen) / 14) 0 calc(6vh + var(--screen) / 2.2);
    box-sizing: border-box;
    font-family: "Cabin Condensed";
    color: var(--ui-ink);
}

/* The footer layers above the page cover the whole screen; only their visible parts take the mouse; */
body:has(#site-page) #background-bottom-shadow,
body:has(#site-page) #background > .background-properties {
    pointer-events: none;
}

body:has(#site-page) #background > .background-properties > * {
    pointer-events: auto;
}

.site-page::-webkit-scrollbar {
    display: none;
}

.page-wrap {
    width: min(1500px, 84vw);
    margin: 0 auto;
}

/* Hovering a plan softly blurs everything around it; */
#overlay {
    position: fixed;
    inset: 0;
    z-index: 2;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(1.5px);
    -webkit-backdrop-filter: blur(1.5px);
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
}

[data-theme="dark"] #overlay {
    background: rgba(5, 12, 20, 0.25);
}

.site-page:has(.tier:hover) #overlay {
    opacity: 1;
}

.page-header {
    text-align: center;
    margin-bottom: calc(var(--screen) / 9);
}

.page-header h1 {
    margin: 0;
    color: var(--blue);
    font-size: calc(var(--screen) / 4.6);
    line-height: 1.15;
    letter-spacing: -0.5px;
}

.page-header p {
    margin: calc(var(--screen) / 40) 0 0;
    color: var(--ui-muted);
    font-size: calc(var(--screen) / 11);
}

.benefits-panel + .page-header {
    margin-top: calc(var(--screen) / 2.4);
}

/* The title and the four plans fill the first screen, centred between the toolbar and the footer; */
.plans-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: calc(100vh - 10.5vh - var(--screen) / 14 - 6vh - var(--screen) / 6);
    margin-bottom: calc(var(--screen) / 2.4);
}

/*////////////////////////////////////////////////////////////////////////*/
/* The four plans; */

.tier-selector {
    display: none;
}

.tiers {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: calc(var(--screen) / 8);
    align-items: stretch;
}

.tier {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: calc(var(--screen) / 9) calc(var(--screen) / 12) calc(var(--screen) / 11);
    text-align: center;
    cursor: pointer;

    border: 4px solid var(--blue);
    border-radius: 18px;
    background: var(--card-glass);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);

    transition: transform 0.45s var(--spring), background-color 0.3s ease, border-color 0.3s ease;
}

.tier:hover {
    z-index: 3;
    transform: translateY(-6px) scale(1.02);
    background: var(--card-solid);
}

.tier:active {
    transform: translateY(-3px) scale(0.99);
    transition-duration: 0.1s;
}

.tier.featured {
    border-color: var(--check);
}

.tier .badge {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -55%);
    padding: 4px 14px;
    border-radius: 999px;
    background: var(--check);
    color: white;
    font-size: calc(var(--screen) / 15);
    font-weight: bold;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.tier h2 {
    margin: 0 0 calc(var(--screen) / 30);
    color: var(--blue);
    font-size: calc(var(--screen) / 7.5);
    line-height: 1.1;
}

.tier h2.premium {
    color: var(--check);
}

.product-container {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 4px;
}

.tier .price {
    margin: 0;
    min-height: 1.1em;
    color: var(--ui-ink);
    font-size: calc(var(--screen) / 4.4);
    font-weight: bold;
    line-height: 1.1;
}

/* While Paddle hasn't answered yet; */
.tier .price:empty {
    width: 2.8em;
    margin: 0.05em 0;
    border-radius: 10px;
    background: var(--li-line);
}

.product-container span {
    color: var(--ui-muted);
    font-size: calc(var(--screen) / 14);
}

.tier ul {
    flex: 1;
    margin: calc(var(--screen) / 18) 0 calc(var(--screen) / 14);
    padding: 0;
    list-style: none;
    text-align: left;
}

.tier li {
    position: relative;
    padding: calc(var(--screen) / 32) 0 calc(var(--screen) / 32) 1.6em;
    border-bottom: 1px solid var(--li-line);
    color: var(--ui-ink);
    font-size: calc(var(--screen) / 12.5);
    font-weight: bold;
    line-height: 1.25;
}

.tier li:last-child {
    border-bottom: none;
}

.tier li::before {
    content: "\2714";
    position: absolute;
    left: 0.15em;
    color: var(--check);
}

.tier li.no {
    color: var(--no-ink);
    font-weight: normal;
}

.tier li.no::before {
    content: "\2716";
    color: var(--no-mark);
}

.btn,
.tier-included {
    display: block;
    padding: calc(var(--screen) / 22);
    border-radius: 999px;
    font-size: calc(var(--screen) / 10.5);
    font-weight: bold;
    text-align: center;
    text-decoration: none;
}

.btn {
    color: white;
    background: var(--blue);
    cursor: pointer;
    transition: background-color 0.25s ease, transform 0.45s var(--spring);
}

.btn:hover {
    background: var(--blue-dark);
    transform: scale(1.03);
}

.btn:active {
    transform: scale(0.95);
    transition-duration: 0.2s, 0.08s;
}

.featured .btn {
    background: var(--check);
}

.featured .btn:hover {
    background: var(--check-dark);
}

.tier-included {
    color: var(--ui-muted);
    border: 2px dashed var(--li-line);
}

.btn:focus-visible,
.tier:focus-visible,
.info-tile:focus-visible {
    outline: 3px solid #3ac7ff;
    outline-offset: 2px;
}

/*////////////////////////////////////////////////////////////////////////*/
/* Benefits table; */

.benefits-panel {
    padding: calc(var(--screen) / 9) calc(var(--screen) / 7);
    border: 6px solid var(--blue);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

[data-theme="dark"] .benefits-panel {
    background: rgba(16, 30, 44, 0.75);
}

.benefits {
    width: 100%;
    border-collapse: collapse;
}

.benefits th {
    width: 15%;
    padding: 0 6px calc(var(--screen) / 14);
    color: var(--ui-ink);
    font-size: calc(var(--screen) / 11);
    text-align: center;
}

.benefits th:first-child {
    width: 40%;
}

.benefits th.premium {
    color: var(--check);
}

.benefits td {
    padding: calc(var(--screen) / 24) calc(var(--screen) / 16);
    color: var(--ui-ink);
    font-size: calc(var(--screen) / 11);
    font-weight: bold;
    text-align: center;
}

.benefits td:first-child {
    text-align: left;
    transition: transform 0.4s var(--spring);
}

.benefits td:first-child b {
    color: var(--blue);
}

.benefits tbody tr:not(.group-row) {
    transition: background-color 0.2s ease;
    animation: rowScrollIn linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 60%;
}

.benefits tbody tr:nth-child(even of :not(.group-row)) {
    background: var(--row);
}

/* The row under the mouse lights up and its name nudges over, like a settings row; */
.benefits tbody tr:not(.group-row):hover {
    background: rgba(34, 167, 240, 0.1);
}

.benefits tbody tr:not(.group-row):hover td:first-child {
    transform: translateX(6px);
}

.benefits tr td:first-child {
    border-radius: 10px 0 0 10px;
}

.benefits tr td:last-child {
    border-radius: 0 10px 10px 0;
}

/* Where each group of features starts; */
.benefits .group-row td {
    padding: calc(var(--screen) / 9) calc(var(--screen) / 16) calc(var(--screen) / 40);
    color: var(--blue);
    font-size: calc(var(--screen) / 12.5);
    text-align: left;
    border-bottom: 2px solid rgba(34, 167, 240, 0.25);
    border-radius: 0;
}

.benefits tbody .group-row:first-child td {
    padding-top: 0;
}

.benefits .yes {
    color: var(--check);
    font-size: calc(var(--screen) / 9);
}

.benefits .dash {
    color: var(--dash-ink);
    font-weight: normal;
}

/*////////////////////////////////////////////////////////////////////////*/
/* Good to know; */

.info-tiles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: calc(var(--screen) / 8);
}

.info-tile {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: calc(var(--screen) / 10);
    align-items: start;
    padding: calc(var(--screen) / 9);
    border: 4px solid var(--blue);
    border-radius: 18px;
    background: var(--card-glass);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    color: var(--ui-ink);
    text-decoration: none;
    transition: transform 0.45s var(--spring), background-color 0.3s ease;
}

.info-tile:hover {
    transform: translateY(-4px);
    background: var(--card-solid);
}

.info-tile:active {
    transform: scale(0.98);
    transition-duration: 0.1s;
}

.info-tile-icon {
    grid-row: span 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(var(--screen) / 3.6);
    height: calc(var(--screen) / 3.6);
    border-radius: 14px;
    background: var(--blue);
    transition: transform 0.45s var(--spring);
}

.info-tile:hover .info-tile-icon {
    transform: rotate(-8deg) scale(1.06);
}

.info-tile-icon img {
    width: 58%;
    height: 58%;
}

.info-tile h2 {
    margin: 0;
    color: var(--blue);
    font-size: calc(var(--screen) / 9);
}

.info-tile p {
    margin: 4px 0 0;
    color: var(--ui-muted);
    font-size: calc(var(--screen) / 12.5);
    line-height: 1.3;
}

/* Bottom center, above the footer; */
.site-scroll-hint {
    position: fixed;
    left: 50%;
    bottom: calc(6vh + 14px);
}

/*////////////////////////////////////////////////////////////////////////*/
/* Narrow windows; */

@media (max-width: 1100px) and (min-aspect-ratio: 4001/5000) {
    .page-wrap {
        width: min(760px, 88vw);
    }

    .tiers {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        row-gap: calc(var(--screen) / 5);
    }

    .info-tiles {
        grid-template-columns: 1fr;
    }
}

/*////////////////////////////////////////////////////////////////////////*/
/* Phones: one plan at a time, picked from the tray above the card; */

@media (max-width: 768px) and (max-aspect-ratio: 4/5) {
    .site-page {
        padding: calc(11vh + 12px) 0 calc(9vh + 70px);
    }

    .page-wrap {
        width: auto;
        margin: 0 12px;
    }

    #overlay {
        display: none;
    }

    .page-header {
        margin-bottom: 14px;
    }

    .page-header h1 {
        font-size: 27px;
    }

    .page-header p {
        margin-top: 4px;
        font-size: 14px;
    }

    .benefits-panel + .page-header {
        margin-top: 34px;
    }

    .plans-screen {
        display: block;
        min-height: 0;
        margin-bottom: 34px;
    }

    .tier-selector {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
        max-width: 480px;
        margin: 0 auto 18px;
        padding: 6px;
        border-radius: 18px;
        background: var(--ui-sidebar-bg);
    }

    .tier-selector button {
        position: relative;
        padding: 10px 2px;
        border-radius: 13px;
        background: var(--ui-raised-bg);
        border: var(--ui-raised-border);
        color: var(--ui-raised-ink);
        font-family: "Cabin Condensed";
        font-size: 15px;
        font-weight: bold;
        cursor: pointer;
        transition: background-color 0.25s ease, color 0.25s ease, transform 0.45s var(--spring);
    }

    .tier-selector button:active {
        transform: scale(0.92);
        transition-duration: 0.2s, 0.2s, 0.08s;
    }

    .tier-selector button.selected-tier {
        color: white;
        background: var(--blue);
        border-color: #1d94c3;
    }

    .tier-selector button.premium::after {
        content: "\2605";
        position: absolute;
        top: -9px;
        right: -4px;
        width: 18px;
        height: 18px;
        border-radius: 50%;
        background: var(--check);
        color: white;
        font-size: 11px;
        line-height: 18px;
    }

    .tier-selector button.premium.selected-tier {
        background: var(--check);
        border-color: var(--check-dark);
    }

    .tiers {
        display: block;
    }

    .tiers .tier {
        display: none;
    }

    .tiers .tier.selected-tier {
        display: flex;
        padding: 22px 18px 18px;
        background: var(--card-solid);
        animation: planPop 0.4s var(--spring);
    }

    .tier:hover {
        z-index: auto;
        transform: none;
    }

    .tier .badge { font-size: 12px; }
    .tier h2 { font-size: 26px; margin-bottom: 4px; }
    .tier .price { font-size: 36px; }
    .product-container span { font-size: 14px; }
    .tier ul { margin: 10px 0 14px; }
    .tier li { font-size: 15px; padding: 6px 0 6px 22px; }

    /* The tray already shows what each plan adds; */
    .tier li.no {
        display: none;
    }

    .btn, .tier-included {
        font-size: 17px;
        padding: 13px;
    }

    .benefits-panel {
        padding: 10px 6px;
        border-width: 4px;
    }

    .benefits th, .benefits td {
        padding: 8px 4px;
        font-size: 12px;
    }

    .benefits th:first-child {
        width: 38%;
    }

    .benefits .yes {
        font-size: 15px;
    }

    .benefits .group-row td {
        padding: 18px 4px 4px;
        font-size: 12px;
    }

    .info-tiles {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .info-tile {
        padding: 14px;
        column-gap: 12px;
    }

    .info-tile-icon {
        width: 46px;
        height: 46px;
        border-radius: 12px;
    }

    .info-tile h2 { font-size: 18px; }
    .info-tile p { font-size: 14px; }

    .site-scroll-hint {
        display: none;
    }
}

@keyframes planPop {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .tier, .btn, .info-tile, .info-tile-icon, .benefits td:first-child, .tiers .tier.selected-tier, .benefits tbody tr {
        animation: none !important;
        transition: none !important;
    }

    .site-page {
        scroll-behavior: auto;
    }
}
