/* TTRP Update Server — public download page (lib/site.php).
 * Calm neutral base; colour comes from the brand gradient (violet → purple → pink), the category hues
 * and the plugin icons. No JavaScript: light + dark from prefers-color-scheme, motion only without
 * reduced motion. Same tokens as admin/admin.css. */

@font-face { font-family: "Commissioner"; font-style: normal; font-weight: 300 900; font-display: swap; src: url(../admin/fonts/commissioner-greek.woff2) format("woff2"); unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
@font-face { font-family: "Commissioner"; font-style: normal; font-weight: 300 900; font-display: swap; src: url(../admin/fonts/commissioner-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Commissioner"; font-style: normal; font-weight: 300 900; font-display: swap; src: url(../admin/fonts/commissioner-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(../admin/fonts/jetbrainsmono-greek.woff2) format("woff2"); unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(../admin/fonts/jetbrainsmono-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(../admin/fonts/jetbrainsmono-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
    color-scheme: light;
    --bg: #f6f6fa;
    --surface: #ffffff;
    --sunk: #f1f1f7;
    --line: #e5e5ef;
    --ink: #15151f;
    --ink-2: #4a4a5e;
    --muted: #6e6e84;
    --tint: rgba(124, 92, 255, 0.07);
    --link: #5b4be0;
    --brand: linear-gradient(120deg, #5b5bf6 0%, #9b3cf0 55%, #f0457a 100%);
    --pay: #6d5bf6;
    --ship: #12a89a;
    --chk: #f2685c;
    --prod: #c455e0;
    --orb: 0.35;
    --logo: #1f2a7c;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --font: "Commissioner", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --bg: #0e0e14;
        --surface: #16161f;
        --sunk: #12121a;
        --line: #26263a;
        --ink: #eeeef5;
        --ink-2: #b3b3c7;
        --muted: #8a8aa6;
        --tint: rgba(124, 92, 255, 0.10);
        --link: #b4a8ff;
        --orb: 0.22;
        --logo: #e6e8ff;
    }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font: 400 16px/1.6 var(--font);
    color: var(--ink);
    background: var(--bg);
    min-height: 100vh;
    overflow-x: hidden;
}
a { color: var(--link); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Slow colour light behind everything. */
.orbs { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.orbs span { position: absolute; width: 46vw; height: 46vw; max-width: 620px; max-height: 620px; border-radius: 50%; filter: blur(80px); opacity: var(--orb); }
.orbs span:nth-child(1) { background: #8b7bff; top: -18%; left: -12%; }
.orbs span:nth-child(2) { background: #5eead4; top: 30%; right: -16%; opacity: calc(var(--orb) * 0.7); }
.orbs span:nth-child(3) { background: #fda4af; bottom: -20%; left: 20%; opacity: calc(var(--orb) * 0.6); }
.top, main, .foot { position: relative; z-index: 1; }

/* ---------------------------------------------------------------- Header */
.top {
    max-width: 1040px;
    margin: 0 auto;
    padding: 20px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: -0.01em; }
.wm { display: block; height: 22px; width: auto; color: var(--logo); }
.sep { padding-left: 12px; border-left: 1px solid var(--line); color: var(--ink-2); font-weight: 600; }
.lang { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.lang a { padding: 4px 10px; border-radius: 6px; color: var(--muted); text-decoration: none; font: 500 12px var(--mono); }
.lang a:hover { color: var(--ink); }
.lang a[aria-current] { background: var(--tint); color: var(--ink); }

/* ---------------------------------------------------------------- Hero */
main { max-width: 1040px; margin: 0 auto; padding: 0 16px 48px; }
.hero { padding: 48px 0 32px; max-width: 720px; }
.hero h1 {
    margin: 0 0 14px;
    font-size: clamp(32px, 5.4vw, 54px);
    line-height: 1.06;
    font-weight: 800;
    letter-spacing: -0.035em;
    text-wrap: balance;
}
.grad { background: var(--brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { margin: 0 0 8px; font-size: 18px; color: var(--ink-2); max-width: 62ch; }
.hero .hero-meta { font: 400 13px var(--mono); color: var(--muted); }
.empty { padding: 32px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 16px; }

/* ---------------------------------------------------------------- Groups + rows */
.group {
    margin-top: 20px;
    padding: 20px 24px 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(20, 20, 40, 0.04), 0 24px 48px -32px rgba(60, 40, 160, 0.25);
}
.group h2, .how h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.group h2 i { width: 10px; height: 10px; border-radius: 3px; background: var(--muted); }
.c-payments h2 i { background: var(--pay); }
.c-shipping h2 i { background: var(--ship); }
.c-checkout h2 i { background: var(--chk); }
.c-products h2 i { background: var(--prod); }
.plist { list-style: none; margin: 0; padding: 0; }
.prow {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 18px;
    align-items: start;
    padding: 18px 12px;
    margin: 0 -12px;
    border-radius: 12px;
}
.prow + .prow { border-top: 1px solid var(--line); }
.icon { display: block; width: 56px; height: 56px; border-radius: 14px; filter: drop-shadow(0 8px 14px rgba(80, 60, 200, 0.2)); }
.pmain { min-width: 0; }
.prow h3 { margin: 0; font-size: 16px; line-height: 1.35; font-weight: 700; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.desc { margin: 2px 0 0; color: var(--ink-2); max-width: 64ch; }
.pmeta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 0; font: 400 12px var(--mono); color: var(--muted); }
.pmeta .ver { color: var(--ink); font-weight: 500; }

.changelog { margin-top: 10px; font-size: 14px; }
.changelog summary { cursor: pointer; width: fit-content; font-weight: 600; color: var(--link); }
.changelog-body { margin-top: 6px; padding: 10px 14px; border-radius: 10px; background: var(--sunk); color: var(--ink-2); overflow-wrap: anywhere; }
.changelog-body h4 { margin: 8px 0 4px; font-size: 13px; color: var(--ink); }
.changelog-body h4:first-child { margin-top: 0; }
.changelog-body p { margin: 6px 0; }
.changelog-body ul { margin: 4px 0; padding-left: 20px; }
.changelog-body code { font: 0.9em var(--mono); padding: 1px 5px; border-radius: 5px; background: var(--tint); }

.dl {
    position: relative;
    overflow: hidden;
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 10px;
    background: var(--brand);
    background-size: 140% 100%;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 8px 20px -10px rgba(110, 70, 240, 0.8);
}
.dl::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%); transform: translateX(-120%); }

/* ---------------------------------------------------------------- Install steps + footer */
.how { margin-top: 40px; padding: 22px 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.how h2 { margin-bottom: 10px; }
.how ol { margin: 0; padding-left: 22px; color: var(--ink-2); }
.how li + li { margin-top: 6px; }
.how li::marker { font-family: var(--mono); color: var(--muted); }
.foot { max-width: 1040px; margin: 0 auto; padding: 24px 16px 40px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.foot a { color: var(--muted); }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.foot-links a { text-decoration: none; }
.foot-links a:hover, .foot-links a[aria-current] { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.how-data { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--tint); color: var(--ink-2); font-size: 14px; }
.how-data svg { flex: none; margin-top: 2px; color: var(--pay); }

/* ---------------------------------------------------------------- Legal pages (lib/legal.php) */
.hero-kicker { margin: 0 0 10px !important; font: 500 13px var(--mono) !important; }
.hero-kicker a { color: var(--muted); text-decoration: none; }
.hero-kicker a::before { content: "← "; }
.hero-kicker a:hover { color: var(--ink); }
.hl { list-style: none; margin: 0 0 24px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.hl li {
    --c: var(--pay);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    color: var(--ink-2);
    font-size: 14px;
}
.hl li::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--c); }
.hl strong { color: var(--ink); font-size: 15px; }
.hl-icon { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 8px; border-radius: 12px; color: #fff; background: var(--c); box-shadow: 0 8px 18px -10px var(--c); }
.hl li.hl-shield, .hl li.hl-box { --c: var(--ship); }
.hl li.hl-clock { --c: var(--chk); }
.hl li.hl-cookie, .hl li.hl-gpl { --c: var(--prod); }
.doc { padding: 8px 28px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 1px 2px rgba(20, 20, 40, 0.04), 0 24px 48px -32px rgba(60, 40, 160, 0.25); }
.doc section { padding: 18px 0 4px; max-width: 72ch; }
.doc section + section { border-top: 1px solid var(--line); }
.doc h2 { display: flex; align-items: baseline; gap: 12px; margin: 0 0 8px; font-size: 18px; letter-spacing: -0.01em; }
.doc .num { font: 600 12px var(--mono); background: var(--brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.doc p, .doc ul { margin: 0 0 12px; color: var(--ink-2); }
.doc ul { padding-left: 20px; }
.doc li + li { margin-top: 4px; }
.doc li::marker { color: var(--prod); }
.foot-brand .wm { height: 18px; }

@media (max-width: 640px) {
    .group { padding: 16px 16px 4px; }
    .doc { padding: 4px 18px 14px; }
    .prow { grid-template-columns: 48px minmax(0, 1fr); gap: 14px; }
    .icon { width: 48px; height: 48px; }
    .dl { grid-column: 2; justify-self: start; }
}

@media (prefers-reduced-motion: no-preference) {
    .prow { transition: background-color 0.25s var(--ease); animation: rise 0.7s var(--ease) backwards; animation-delay: calc((var(--g, 0) * 3 + var(--i, 0)) * 50ms); }
    .prow:hover { background: var(--tint); }
    .hl li { animation: rise 0.7s var(--ease) backwards; transition: transform 0.3s var(--spring), box-shadow 0.3s var(--ease); }
    .hl li:nth-child(2) { animation-delay: 60ms; } .hl li:nth-child(3) { animation-delay: 120ms; } .hl li:nth-child(4) { animation-delay: 180ms; }
    .hl li:hover { transform: translateY(-3px); box-shadow: 0 18px 30px -22px var(--c); }
    .hl li:hover .hl-icon { transform: rotate(-6deg) scale(1.06); }
    .hl-icon { transition: transform 0.35s var(--spring); }
    .doc { animation: rise 0.8s var(--ease) 0.15s backwards; }
    /* Stagger without inline styles (the CSP blocks them): --g per group, --i per row. */
    .group:nth-of-type(2) { --g: 1; } .group:nth-of-type(3) { --g: 2; } .group:nth-of-type(4) { --g: 3; } .group:nth-of-type(n+5) { --g: 4; }
    .prow:nth-child(2) { --i: 1; } .prow:nth-child(3) { --i: 2; } .prow:nth-child(4) { --i: 3; } .prow:nth-child(n+5) { --i: 4; }
    .icon { transition: transform 0.35s var(--spring); }
    .prow:hover .icon { transform: translateY(-2px) rotate(-4deg) scale(1.04); }
    .hero { animation: rise 0.7s var(--ease) backwards; }
    .dl { transition: transform 0.2s var(--ease), background-position 0.4s var(--ease), box-shadow 0.2s var(--ease); }
    .dl:hover { transform: translateY(-1px); background-position: 100% 0; box-shadow: 0 12px 24px -10px rgba(110, 70, 240, 0.9); }
    .dl:hover::after { transform: translateX(120%); transition: transform 0.7s var(--ease); }
    .dl:active { transform: scale(0.97); }
    .orbs span { animation: drift 24s ease-in-out infinite alternate; }
    .orbs span:nth-child(2) { animation-duration: 30s; }
    .orbs span:nth-child(3) { animation-duration: 36s; }
    @keyframes rise { from { opacity: 0; transform: translateY(12px); } }
    @keyframes drift { to { transform: translate(6vw, 4vh) scale(1.08); } }
}
