:root {
    --color-primary: #2c3e50;
    --color-secondary: #34495e;
    --color-accent: #3498db;
    --color-bg: #ecf0f1;
    --color-surface: #ffffff;
    --color-text: #1a252f;
    --color-muted: #5d6d7e;
    --color-border: #bdc3c7;
    --font-display: "Outfit", sans-serif;
    --font-body: "Plus Jakarta Sans", sans-serif;
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1.25rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --radius-card: 24px 4px 24px 4px;
    --shadow-soft: 0 12px 40px rgba(44, 62, 80, 0.12);
    --shadow-soft-sm: 0 6px 24px rgba(44, 62, 80, 0.1);
    --pgh-header-h: 72px;
    --pgh-page-w: 1120px;
}

@media (max-width: 1100px) {
    :root { --pgh-header-h: 64px; }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

[hidden] { display: none !important; }

html {
    scroll-padding-top: var(--pgh-header-h);
    max-width: 100%;
    overflow-x: clip;
}

body {
    margin: 0;
    padding-top: var(--pgh-header-h);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    max-width: 100%;
    overflow-x: clip;
}

body.pgh-cookie-open {
    padding-bottom: 5.5rem;
}

img, video, iframe {
    max-width: 100%;
    height: auto;
}

a { color: var(--color-accent); }
a:hover { color: var(--color-primary); }

h1, h2, h3, h4 {
    font-family: var(--font-display);
    line-height: 1.2;
    color: var(--color-primary);
    margin: 0 0 var(--space-md);
}

p { margin: 0 0 var(--space-md); }

.pgh-container {
    width: min(100% - 2rem, var(--pgh-page-w));
    margin-inline: auto;
}

.pgh-measure {
    width: min(100% - 2rem, 760px);
    margin-inline: auto;
}

.pgh-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
}

.pgh-grid > * { min-width: 0; }

@media (max-width: 768px) {
    .pgh-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .pgh-grid { grid-template-columns: 1fr; }
}

.pgh-card {
    background: var(--color-surface);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft);
    padding: var(--space-lg);
}

.pgh-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    min-height: var(--pgh-header-h);
    background: var(--color-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.pgh-header a,
.pgh-header a:visited {
    color: var(--color-primary);
}

.pgh-header--row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: var(--space-md);
    min-height: var(--pgh-header-h);
    position: relative;
}

.pgh-header--logo {
    flex-shrink: 0;
    z-index: 1;
}

.pgh-header--logo img {
    width: 180px;
    height: auto;
    display: block;
    min-height: 36px;
}

.pgh-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem 1rem;
    flex: 1;
    min-width: 0;
    flex-wrap: nowrap;
}

.pgh-nav--link {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    white-space: nowrap;
    padding: 0.35rem 0.2rem;
    border-bottom: 2px solid transparent;
}

.pgh-nav--link.is-active,
.pgh-nav--link:hover {
    border-bottom-color: var(--color-accent);
    color: var(--color-accent);
}

.pgh-header--cta {
    margin-left: auto;
    flex-shrink: 0;
}

.pgh-header a.pgh-btn--primary,
.pgh-header a.pgh-btn--primary:visited {
    color: #fff;
}

.pgh-burger,
.pgh-overlay,
.pgh-drawer {
    display: none;
}

.pgh-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 44px;
    padding: 0.65rem 1.25rem;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border: 2px solid var(--color-primary);
    background: transparent;
    color: var(--color-primary);
    cursor: pointer;
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.pgh-btn::before,
.pgh-btn::after {
    content: "";
    position: absolute;
    width: 10px;
    height: 10px;
    border-color: var(--color-accent);
    border-style: solid;
    opacity: 0;
    transition: opacity 0.2s;
}

.pgh-btn::before {
    top: 4px;
    left: 4px;
    border-width: 2px 0 0 2px;
}

.pgh-btn::after {
    bottom: 4px;
    right: 4px;
    border-width: 0 2px 2px 0;
}

.pgh-btn:hover::before,
.pgh-btn:hover::after {
    opacity: 1;
}

.pgh-btn--primary {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
    box-shadow: var(--shadow-soft-sm);
}

.pgh-btn--primary:hover {
    background: var(--color-secondary);
    color: #fff;
}

a.pgh-btn--primary,
a.pgh-btn--primary:visited {
    color: #fff;
}

a.pgh-btn:not(.pgh-btn--primary),
a.pgh-btn:not(.pgh-btn--primary):visited {
    color: var(--color-primary);
}

.pgh-hero {
    width: 100%;
    background:
        linear-gradient(135deg, #2c3e50 0%, #34495e 48%, #1a252f 100%);
    color: #ecf0f1;
    padding: var(--space-xl) 0;
}

.pgh-hero--grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(10rem, 14rem);
    gap: var(--space-lg);
    align-items: center;
}

.pgh-hero--title {
    color: #fff;
    font-size: clamp(1.75rem, 4vw, 2.6rem);
    margin-bottom: var(--space-md);
}

.pgh-hero--note {
    margin: 0 0 var(--space-lg);
    padding: 0;
    border: none;
    font-family: var(--font-display);
    font-size: clamp(1.15rem, 2.4vw, 1.45rem);
    font-weight: 500;
    line-height: 1.45;
    color: #ecf0f1;
}

.pgh-hero--note p {
    margin: 0;
}

.pgh-hero--actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.pgh-hero a.pgh-btn--primary,
.pgh-hero a.pgh-btn--primary:visited {
    color: #fff;
    background: var(--color-accent);
    border-color: var(--color-accent);
}

.pgh-hero a.pgh-btn:not(.pgh-btn--primary),
.pgh-hero a.pgh-btn:not(.pgh-btn--primary):visited {
    color: #ecf0f1;
    border-color: #ecf0f1;
}

.pgh-hero--still {
    margin: 0;
    justify-self: end;
}

.pgh-hero--still .pgh-app--preview {
    max-width: 200px;
    max-height: 240px;
    box-shadow: var(--shadow-soft);
    background: var(--color-surface);
    border-radius: 12px;
}

.pgh-bento {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--space-lg);
    padding-block: var(--space-xl);
}

.pgh-bento--tile {
    min-width: 0;
    background: var(--color-surface);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft);
    padding: var(--space-lg);
}

.pgh-bento--tile__span6 { grid-column: span 6; }
.pgh-bento--tile__span4 { grid-column: span 4; }
.pgh-bento--tile__span3 { grid-column: span 3; }
.pgh-bento--tile__span2 { grid-column: span 2; }

.pgh-section--title {
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    position: relative;
}

.pgh-section--lead,
.pgh-section--note {
    color: var(--color-muted);
}

.is-in h2.pgh-section--title::after {
    content: "";
    display: block;
    height: 2px;
    width: 0;
    margin-top: 0.5rem;
    background: currentColor;
}

.is-in.is-visible h2.pgh-section--title::after {
    animation: pgh-k-line 0.6s ease both;
}

@keyframes pgh-k-line {
    from { width: 0; }
    to { width: 3rem; }
}

@media (prefers-reduced-motion: reduce) {
    .is-in.is-visible h2.pgh-section--title::after {
        animation: none;
        width: 3rem;
    }
}

.pgh-rank--item {
    display: grid;
    grid-template-columns: auto 96px minmax(0, 1fr) auto;
    grid-template-areas:
        "pos icon name still"
        "pos icon dev still"
        "pos icon desc still"
        "pos icon facts still"
        "pos icon actions still";
    gap: 0.35rem 1rem;
    align-items: start;
    margin-top: var(--space-lg);
    padding: var(--space-lg);
    background: var(--color-bg);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft-sm);
}

.pgh-rank--item .pgh-rank--pos { grid-area: pos; font-family: var(--font-display); font-weight: 700; color: var(--color-accent); margin: 0; writing-mode: vertical-rl; transform: rotate(180deg); letter-spacing: 0.08em; }
.pgh-rank--item .pgh-app--icon { grid-area: icon; }
.pgh-rank--item .pgh-rank--name { grid-area: name; margin: 0; font-size: 1.25rem; min-width: 0; }
.pgh-rank--item .pgh-rank--dev { grid-area: dev; margin: 0; color: var(--color-muted); font-size: 0.9rem; min-width: 0; }
.pgh-rank--item .pgh-rank--desc { grid-area: desc; margin: 0; min-width: 0; }
.pgh-rank--item .pgh-rank--facts { grid-area: facts; margin: 0; font-size: 0.9rem; color: var(--color-secondary); min-width: 0; overflow-wrap: anywhere; }
.pgh-rank--item .pgh-app--preview { grid-area: still; }
.pgh-rank--item .pgh-rank--actions { grid-area: actions; display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-top: var(--space-sm); min-width: 0; }

.pgh-app--icon {
    width: 96px;
    height: 96px;
    border-radius: 22%;
    object-fit: contain;
    flex-shrink: 0;
    background: var(--color-surface);
    box-shadow: var(--shadow-soft-sm);
}

.pgh-app--preview {
    width: auto;
    height: auto;
    max-width: 200px;
    max-height: 240px;
    object-fit: contain;
    display: block;
}

.pgh-review .pgh-app--preview {
    max-width: 280px;
    max-height: 280px;
}

.pgh-table-wrap {
    overflow-x: auto;
    margin: var(--space-md) 0;
    -webkit-overflow-scrolling: touch;
}

.pgh-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    min-width: 520px;
}

.pgh-table th,
.pgh-table td {
    border: 1px solid var(--color-border);
    padding: 0.65rem 0.75rem;
    text-align: left;
    vertical-align: top;
}

.pgh-table thead th {
    background: var(--color-primary);
    color: #fff;
    font-family: var(--font-display);
}

.pgh-table tbody th {
    background: #f7f9fa;
    font-weight: 600;
}

.pgh-criteria--list {
    display: grid;
    gap: var(--space-md);
}

.pgh-criteria--card {
    padding: var(--space-md);
    box-shadow: var(--shadow-soft-sm);
}

.pgh-criteria--name {
    margin: 0 0 var(--space-xs);
    font-size: 1.05rem;
}

.pgh-cta--text { color: var(--color-muted); }
.pgh-cta--actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.pgh-cta a.pgh-btn--primary,
.pgh-cta a.pgh-btn--primary:visited {
    color: #fff;
}

.pgh-footer {
    background: var(--color-primary);
    color: #ecf0f1;
    padding: var(--space-xl) 0 var(--space-lg);
    margin-top: var(--space-xl);
}

.pgh-footer a,
.pgh-footer a:visited {
    color: #aed6f1;
}

.pgh-footer--grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: var(--space-xl);
    margin-bottom: var(--space-lg);
}

.pgh-footer--title {
    color: #fff;
    font-size: 1.15rem;
}

.pgh-footer--dl dt {
    font-family: var(--font-display);
    font-weight: 600;
    margin-top: var(--space-sm);
}

.pgh-footer--dl dd {
    margin: 0.25rem 0 0;
    color: #d5dbdb;
}

.pgh-footer--list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.45rem;
}

.pgh-footer--link {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: #aed6f1;
    cursor: pointer;
    text-decoration: underline;
}

.pgh-footer--legal,
.pgh-footer--copy {
    font-size: 0.88rem;
    color: #bdc3c7;
    margin: 0 0 var(--space-sm);
}

.pgh-cookie {
    display: none;
}

.pgh-cookie:not([hidden]) {
    display: flex;
    position: fixed;
    z-index: 110;
    gap: 12px;
    align-items: center;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: calc(100% - 32px);
    border-radius: 999px;
    background: var(--color-primary);
    color: #fff;
    padding: 0.65rem 0.85rem 0.65rem 1.1rem;
    box-shadow: var(--shadow-soft);
}

.pgh-cookie p {
    margin: 0;
    font-size: 0.9rem;
    white-space: nowrap;
}

.pgh-cookie a,
.pgh-cookie a:visited {
    color: #aed6f1;
}

.pgh-cookie--actions {
    display: flex;
    gap: 8px;
}

.pgh-cookie .pgh-btn {
    min-height: 40px;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    clip-path: none;
    box-shadow: none;
    border: none;
    background: var(--color-accent);
    color: #fff;
}

.pgh-cookie .pgh-btn::before,
.pgh-cookie .pgh-btn::after {
    display: none;
}

.pgh-page {
    padding: var(--space-xl) 0;
}

.pgh-page--title {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.pgh-back {
    display: inline-block;
    margin-bottom: var(--space-md);
    font-weight: 600;
    text-decoration: none;
    color: var(--color-secondary);
}

.pgh-feed--month {
    margin-top: var(--space-xl);
}

.pgh-feed--month-title {
    font-size: 1.1rem;
    color: var(--color-accent);
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 0.35rem;
}

.pgh-feed--item {
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--color-border);
}

.pgh-feed--item h3 {
    margin: 0 0 0.35rem;
    font-size: 1.15rem;
}

.pgh-feed--meta {
    font-size: 0.85rem;
    color: var(--color-muted);
    margin: 0 0 0.35rem;
}

.pgh-review--head {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) auto;
    gap: var(--space-md);
    align-items: start;
    margin-bottom: var(--space-lg);
}

.pgh-review--facts {
    list-style: none;
    margin: 0 0 var(--space-md);
    padding: var(--space-md);
    background: var(--color-bg);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft-sm);
}

.pgh-review--facts li {
    margin: 0.35rem 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.pgh-review--bundle {
    overflow-wrap: anywhere;
    font-family: ui-monospace, monospace;
    font-size: 0.88rem;
}

.pgh-steps {
    counter-reset: pgh-step;
    list-style: none;
    margin: 0;
    padding: 0;
}

.pgh-steps li {
    counter-increment: pgh-step;
    position: relative;
    padding: var(--space-md) var(--space-md) var(--space-md) 3.5rem;
    margin-bottom: var(--space-md);
    background: var(--color-surface);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft-sm);
}

.pgh-steps li::before {
    content: counter(pgh-step);
    position: absolute;
    left: 1rem;
    top: 1.1rem;
    width: 2rem;
    height: 2rem;
    border-radius: 4px;
    background: var(--color-primary);
    color: #fff;
    display: grid;
    place-items: center;
    font-family: var(--font-display);
    font-weight: 700;
}

.pgh-form {
    display: grid;
    gap: var(--space-md);
    max-width: 100%;
}

.pgh-form--label {
    display: grid;
    gap: 0.35rem;
    font-weight: 600;
}

.pgh-form--input,
.pgh-form--textarea {
    width: 100%;
    min-height: 44px;
    padding: 0.65rem 0.85rem;
    border: 2px solid var(--color-border);
    border-radius: 4px;
    font: inherit;
    background: var(--color-surface);
}

.pgh-form--textarea {
    min-height: 140px;
    resize: vertical;
}

.pgh-form--error {
    color: #c0392b;
    font-size: 0.9rem;
    margin: 0;
}

.pgh-tips--list {
    display: grid;
    gap: var(--space-md);
    padding: 0;
    margin: 0;
    list-style: none;
}

.pgh-tips--list li {
    padding: var(--space-md);
    background: var(--color-surface);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft-sm);
    min-width: 0;
}

.pgh-hub--list {
    display: grid;
    gap: var(--space-md);
}

.pgh-hub--card {
    display: grid;
    grid-template-columns: auto 72px minmax(0, 1fr);
    gap: var(--space-md);
    align-items: center;
    padding: var(--space-md);
    background: var(--color-surface);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft);
    text-decoration: none;
    color: inherit;
}

.pgh-hub--card .pgh-app--icon {
    width: 72px;
    height: 72px;
}

.pgh-hub--pos {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--color-accent);
    margin: 0;
}

.pgh-hub--body { min-width: 0; }
.pgh-hub--body h2 { margin: 0 0 0.25rem; font-size: 1.15rem; }
.pgh-hub--body p { margin: 0; color: var(--color-muted); font-size: 0.92rem; }

.pgh-legal h2 { margin-top: var(--space-xl); }
.pgh-legal ul { padding-left: 1.2rem; }

@media (max-width: 1100px) {
    .pgh-nav { display: none; }
    .pgh-header--cta { display: none; }

    .pgh-header--row {
        justify-content: space-between;
    }

    .pgh-burger {
        display: block;
        width: 44px;
        height: 44px;
        margin-left: auto;
        order: 4;
        border: none;
        background: transparent;
        cursor: pointer;
        padding: 10px;
        position: relative;
    }

    .pgh-burger span {
        display: block;
        height: 2px;
        background: var(--color-primary);
        margin: 5px 0;
    }

    .pgh-overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 200;
        background: rgba(0, 0, 0, 0.45);
        opacity: 0;
        visibility: hidden;
        transition: opacity .25s, visibility .25s;
    }

    .pgh-drawer {
        display: block;
        position: fixed;
        z-index: 210;
        background: var(--color-bg);
        overflow-y: auto;
        visibility: hidden;
        transition: transform .3s ease, opacity .3s ease, visibility .3s;
        top: 0;
        right: 0;
        height: 100vh;
        height: 100dvh;
        width: min(85vw, 400px);
        padding: 72px 0 24px;
        transform: translateX(100%);
    }

    .pgh-drawer a {
        display: block;
        padding: 14px 20px;
        color: var(--color-primary);
        text-decoration: none;
        font-family: var(--font-display);
        font-weight: 600;
    }

    .pgh-drawer a.pgh-btn {
        margin: 12px 20px;
        width: calc(100% - 40px);
        color: #fff;
    }

    .pgh-drawer--close {
        position: absolute;
        top: 12px;
        right: 16px;
        width: 44px;
        height: 44px;
        border: none;
        background: transparent;
        font-size: 1.75rem;
        cursor: pointer;
        color: var(--color-primary);
    }

    body.nav-open { overflow: hidden; }
    body.nav-open .pgh-overlay { opacity: 1; visibility: visible; }
    body.nav-open .pgh-drawer {
        visibility: visible;
        transform: translateX(0);
    }

    .pgh-header--logo img {
        width: 120px;
        min-height: 28px;
    }

    .pgh-bento {
        grid-template-columns: 1fr;
    }

    .pgh-bento--tile__span6,
    .pgh-bento--tile__span4,
    .pgh-bento--tile__span3,
    .pgh-bento--tile__span2 {
        grid-column: span 1;
    }

    .pgh-hero--grid {
        grid-template-columns: 1fr;
    }

    .pgh-hero--still {
        justify-self: center;
    }

    .pgh-hero--actions {
        flex-direction: column;
    }

    .pgh-hero--actions .pgh-btn {
        width: 100%;
    }

    .pgh-footer--grid {
        grid-template-columns: 1fr;
    }

    .pgh-rank--item {
        grid-template-columns: auto 72px minmax(0, 1fr);
        grid-template-areas:
            "pos icon name"
            "pos icon dev"
            "pos icon desc"
            "pos icon facts"
            "pos icon actions"
            "still still still";
    }

    .pgh-rank--item .pgh-app--preview {
        display: block;
        margin: 16px auto 0;
    }

    .pgh-review--head {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .pgh-review--head .pgh-app--preview {
        grid-column: 1 / -1;
        margin: 0 auto;
    }

    .pgh-hub--card {
        grid-template-columns: auto 64px minmax(0, 1fr);
    }

    .pgh-cookie:not([hidden]) {
        left: 12px;
        right: 12px;
        transform: none;
        width: auto;
        max-width: none;
        border-radius: 16px;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .pgh-cookie p {
        white-space: normal;
        flex: 1 1 auto;
    }

    .pgh-cookie .pgh-btn {
        min-height: 44px;
    }
}

@media (max-width: 520px) {
    .pgh-rank--item {
        grid-template-columns: 1fr;
        grid-template-areas:
            "pos"
            "icon"
            "name"
            "dev"
            "desc"
            "facts"
            "actions"
            "still";
    }

    .pgh-rank--item .pgh-rank--pos {
        writing-mode: horizontal-tb;
        transform: none;
    }

    .pgh-rank--item .pgh-app--icon {
        margin: 0 auto;
    }

    .pgh-hub--card {
        grid-template-columns: 1fr;
        justify-items: start;
    }
}
