:root {
    --color-primary: #ffc107;
    --color-secondary: #ffb300;
    --color-accent: #ff6f00;
    --color-bg: #fffef5;
    --color-text: #3a2a12;
    --color-text-light: #6b5428;
    --color-border: #f0e2b8;
    --color-ink: #6a3d00;
    --Eg-header-h: 72px;
    --Eg-page-w: 1120px;
    --space-lg: 1.5rem;
    --font-head: "Inconsolata", ui-monospace, monospace;
    --font-body: "Droid Serif", Georgia, serif;
}

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

[hidden] { display: none !important; }

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

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

html { scroll-padding-top: var(--Eg-header-h); }

body {
    margin: 0;
    padding-top: var(--Eg-header-h);
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.6;
}

body::before {
    content: "";
    position: fixed;
    inset: auto auto 8% -6rem;
    width: 18rem;
    height: 18rem;
    background: radial-gradient(circle at 40% 40%, rgba(255, 193, 7, 0.45), rgba(255, 111, 0, 0.05) 70%);
    filter: blur(8px);
    border-radius: 60% 40% 55% 45%;
    pointer-events: none;
    z-index: 0;
}

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

a { color: var(--color-ink); }
a:not(.EgBtn) { text-underline-offset: 0.15em; }

h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; font-weight: 700; }

p { margin: 0 0 0.9rem; }

.EgContainer {
    max-width: var(--Eg-page-w);
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

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

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

.EgHeader a,
.EgHeader a:visited { color: #6a3d00; }

.EgHeader-row {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: var(--Eg-header-h);
    flex-wrap: nowrap;
}

.EgHeader-logo { flex: 0 0 auto; line-height: 0; }
.EgHeader-logo img { width: 180px; height: auto; display: block; }

.EgNav {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-left: auto;
    flex-wrap: nowrap;
}

.EgNav-link { text-decoration: none; font-family: var(--font-head); font-weight: 700; }
.EgNav-link.is-active { box-shadow: inset 0 -2px 0 #ff6f00; }

.EgBurger {
    display: block;
    width: 44px;
    height: 44px;
    margin-left: 8px;
    border: 0;
    background: transparent;
    padding: 10px;
    cursor: pointer;
}

.EgBurger span {
    display: block;
    height: 2px;
    margin: 5px 0;
    background: #6a3d00;
    border-radius: 2px;
}

.EgBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.45rem 1rem;
    border-radius: 8px;
    border: 0;
    text-decoration: none;
    font-family: var(--font-head);
    font-weight: 700;
    color: #3a2200;
    background: linear-gradient(135deg, #ffc107, #ff6f00);
    cursor: pointer;
}

.EgBtn:visited { color: #3a2200; }

.EgBtn--quiet {
    background: transparent;
    border: 1px solid #e6c56a;
}

.EgOverlay,
.EgDrawer { display: none; }

.EgOverlay {
    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;
}

.EgDrawer {
    display: block;
    position: fixed;
    z-index: 210;
    background: #fffef5;
    overflow-y: auto;
    visibility: hidden;
    transition: transform .3s ease, opacity .3s ease, visibility .3s;
}

.EgDrawer a {
    display: block;
    padding: 10px 20px;
    font-size: .95rem;
    color: #6a3d00;
    text-decoration: none;
    font-family: var(--font-head);
}

.EgDrawer-close {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    font-size: 1.6rem;
    color: #6a3d00;
    cursor: pointer;
}

.EgDrawer--narrow {
    top: 0;
    right: 0;
    height: 100vh;
    height: 100dvh;
    width: min(75vw, 320px);
    padding: 64px 0 20px;
    transform: translateX(100%);
}

body.nav-open { overflow: hidden; }
body.nav-open .EgOverlay { opacity: 1; visibility: visible; }
body.nav-open .EgDrawer { visibility: visible; }
body.nav-open .EgDrawer--narrow { transform: translateX(0); }

@media (max-width: 768px) {
    .EgNav { display: none; }
    .EgHeader-logo img { width: 120px; }
    .EgHeader-row { justify-content: space-between; }
    .EgBurger { margin-left: auto; }
}

.EgHero {
    background: linear-gradient(160deg, #fff6d4 0%, #ffe0a8 48%, #fffef5 100%);
    padding: 2.5rem 0 3rem;
}

.EgHero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(20rem, 26rem);
    gap: 2rem;
    align-items: start;
}

.EgHero-card {
    background: rgba(255, 254, 245, 0.86);
    border-radius: 28px;
    padding: 1rem;
    animation: egFade .3s ease both;
}

.EgApp-preview {
    width: auto;
    height: auto;
    max-width: 200px;
    max-height: 240px;
    object-fit: contain;
    display: block;
    margin: 0 auto 0.8rem;
}

.EgReview .EgApp-preview {
    max-width: 280px;
    max-height: 280px;
}

.EgApp-icon {
    width: 96px;
    height: 96px;
    border-radius: 22%;
    object-fit: contain;
    display: block;
}

.EgHero-card .EgApp-icon { width: 22%; height: auto; aspect-ratio: 1; }

.EgFactGrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem 1rem;
    margin: 0.8rem 0 0;
    padding: 0;
    list-style: none;
    font-size: 0.92rem;
}

.EgBand {
    background: linear-gradient(180deg, #fff4cc, #fffef5 80%);
    padding: 3rem 0;
}

.EgSection { padding: 3rem 0; animation: egFade .3s ease both; }

.EgRank-item {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    grid-template-areas:
        "pos icon name still"
        "pos icon dev still"
        "pos icon desc still"
        "pos icon facts still"
        "pos icon acts still";
    gap: 0.2rem 1rem;
    align-items: center;
    padding: 1.2rem 0;
    border-bottom: 1px solid var(--color-border);
}

.EgRank-pos {
    grid-area: pos;
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ffc107, #ff6f00);
    font-family: var(--font-head);
    font-weight: 700;
    margin: 0;
}

.EgRank-item .EgApp-icon { grid-area: icon; }
.EgRank-name { grid-area: name; margin: 0; }
.EgRank-dev { grid-area: dev; margin: 0; color: var(--color-text-light); }
.EgRank-desc { grid-area: desc; margin: 0.3rem 0; }
.EgRank-facts { grid-area: facts; margin: 0; font-size: 0.92rem; }
.EgRank-item .EgApp-preview { grid-area: still; }
.EgRank-actions { grid-area: acts; display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.6rem; }

.EgTableWrap { overflow-x: auto; }
.EgTable { width: 100%; border-collapse: collapse; min-width: 640px; }
.EgTable th, .EgTable td { text-align: left; padding: 0.7rem 0.6rem; border-bottom: 1px solid var(--color-border); vertical-align: top; }
.EgTable th { font-family: var(--font-head); }

.EgPassed {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.EgPassed article, .EgNoteCard, .EgFaq-item, .EgForm {
    background: #fff;
    border-radius: 28px;
    padding: 1rem 1.1rem;
}

.EgNoteCard { overflow: hidden; }
.EgNoteCard-band {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffc107, #ff6f00);
    margin-bottom: 0.6rem;
}

.EgProse { max-width: 760px; }
.EgProse h1 { margin-top: 0; }

.EgCrumbs { font-family: var(--font-head); font-size: 0.9rem; margin-bottom: 1rem; }
.EgCrumbs a { text-decoration: none; }

.EgFaq-item {
    margin-bottom: 0.55rem;
    padding: 0 1rem;
    border-radius: 14px;
    border: 1px solid var(--color-border);
}
.EgFaq-item h2 {
    margin: 0;
    font-size: 1.02rem;
}
.EgFaq-item button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    min-height: 52px;
    padding: 0.7rem 0;
    text-align: left;
    background: transparent;
    border: 0;
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1.02rem;
    line-height: 1.3;
    color: var(--color-text);
    cursor: pointer;
}
.EgFaq-item button::after {
    content: "+";
    flex: 0 0 auto;
    width: 1.6rem;
    color: #ff6f00;
    font-size: 1.35rem;
    line-height: 1;
    text-align: center;
}
.EgFaq-item button[aria-expanded="true"]::after { content: "\2013"; }
.EgFaq-item p {
    margin: 0;
    padding: 0 1.8rem 0.85rem 0;
    color: var(--color-text-light);
}

.EgForm label { display: block; font-family: var(--font-head); margin-bottom: 0.7rem; }
.EgForm input, .EgForm textarea {
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.6rem 0.7rem;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    font: inherit;
    background: #fffef5;
}
.EgForm-error { color: #8a2b00; }

.EgFooter {
    background: #fff6d8;
    padding: 1.4rem 0 1.6rem;
    position: relative;
    z-index: 1;
}
.EgFooter-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}
.EgFooter-links { display: flex; gap: 1rem; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.EgFooter-link {
    background: none;
    border: 0;
    padding: 0;
    color: #6a3d00;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
    min-height: 44px;
}
.EgFooter-note { color: var(--color-text-light); font-size: 0.92rem; }

.EgCookie { display: none; }
.EgCookie:not([hidden]) {
    display: flex;
    position: fixed;
    z-index: 110;
    gap: 12px;
    align-items: center;
    background: #fff;
    box-shadow: 0 8px 24px rgba(58, 42, 18, 0.12);
    padding: 0.7rem 1rem;
}
.EgCookie--pill {
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 32px);
    border-radius: 999px;
}
.EgCookie p { margin: 0; }

@keyframes egFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .EgSection, .EgHero-card { animation: none; }
}

@media (max-width: 800px) {
    .EgHero-grid { grid-template-columns: 1fr; }
    .EgRank-item {
        grid-template-columns: auto 1fr;
        grid-template-areas:
            "pos name"
            "icon dev"
            "desc desc"
            "facts facts"
            "still still"
            "acts acts";
    }
    .EgRank-item .EgApp-preview {
        display: block;
        margin: 16px auto 0;
    }
    .EgPassed { grid-template-columns: 1fr; }
    .EgCookie:not([hidden]) {
        left: 12px;
        right: 12px;
        transform: none;
        border-radius: 20px;
        max-width: none;
        flex-direction: column;
        align-items: stretch;
    }
    .EgCookie .EgBtn { min-height: 44px; }
}

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

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