:root {
    --fmx-color-primary: #2c3e50;
    --fmx-color-secondary: #3498db;
    --fmx-color-accent: #e74c3c;
    --fmx-color-bg: #ecf0f1;
    --fmx-color-surface: #f7f9fa;
    --fmx-color-text: #2c3e50;
    --fmx-color-muted: #5d6d7e;
    --fmx-color-border: #d5dde3;
    --fmx-shadow-out: 8px 8px 16px #c8d0d8, -8px -8px 16px #ffffff;
    --fmx-shadow-in: inset 4px 4px 8px #c8d0d8, inset -4px -4px 8px #ffffff;
    --fmx-font-display: "Montserrat", sans-serif;
    --fmx-font-body: "Open Sans", sans-serif;
    --fmx-space-xs: 0.5rem;
    --fmx-space-sm: 0.75rem;
    --fmx-space-md: 1.25rem;
    --fmx-space-lg: 2rem;
    --fmx-space-xl: 3rem;
    --fmx-radius: 10px;
    --fmx-header-h: 72px;
    --fmx-page-w: 1120px;
}

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

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

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

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

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

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
        radial-gradient(circle at 12% 18%, rgba(52, 152, 219, 0.08), transparent 42%),
        radial-gradient(circle at 88% 8%, rgba(231, 76, 60, 0.06), transparent 36%),
        linear-gradient(180deg, #e8eef2 0%, var(--fmx-color-bg) 48%, #e4ebf0 100%);
}

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

[hidden] { display: none !important; }

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

h1, h2, h3, h4 {
    font-family: var(--fmx-font-display);
    line-height: 1.25;
    margin: 0 0 var(--fmx-space-sm);
}

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

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

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

.fmxHeader a,
.fmxHeader a:visited { color: var(--fmx-color-primary); }

.fmxHeader-row {
    display: flex;
    align-items: center;
    gap: var(--fmx-space-md);
    min-height: var(--fmx-header-h);
}

.fmxHeader-start {
    display: flex;
    align-items: center;
    gap: var(--fmx-space-md);
    flex-shrink: 0;
}

.fmxHeader-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.fmxHeader-logo img {
    width: 170px;
    height: auto;
    display: block;
}

.fmxHeader-cta {
    flex-shrink: 0;
    white-space: nowrap;
    min-height: 40px;
    padding: 0.45rem 0.95rem;
    font-size: 0.82rem;
    line-height: 1.2;
}

.fmxNav {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    flex-wrap: nowrap;
    min-width: 0;
}

.fmxNav a {
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 600;
    white-space: nowrap;
    padding: 0.35rem 0.08rem;
}

.fmxNav a.is-active,
.fmxNav a:hover { color: var(--fmx-color-secondary); }

.fmxBurger,
.fmxOverlay,
.fmxDrawer { display: none; }

.fmxBurger {
    margin-left: auto;
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    padding: 10px;
    cursor: pointer;
}

.fmxBurger span {
    display: block;
    height: 2px;
    margin: 5px 0;
    background: var(--fmx-color-primary);
    border-radius: 2px;
}

.fmxBtn {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 44px;
    padding: 0.65rem 1.2rem;
    border: 0;
    border-radius: 8px;
    font-family: var(--fmx-font-display);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    background: var(--fmx-color-surface);
    color: var(--fmx-color-primary);
    box-shadow: var(--fmx-shadow-out);
    transition: transform 0.15s ease;
}

.fmxBtn:hover { transform: translateY(-1px); }
.fmxBtn:active { box-shadow: var(--fmx-shadow-in); }

.fmxBtn-primary,
a.fmxBtn-primary,
a.fmxBtn-primary:visited {
    background: var(--fmx-color-secondary);
    color: #fff;
}

.fmxBtn-ghost,
a.fmxBtn-ghost,
a.fmxBtn-ghost:visited {
    background: transparent;
    color: var(--fmx-color-primary);
    border: 2px solid var(--fmx-color-primary);
    box-shadow: none;
}

.fmxHeader a.fmxBtn-primary,
.fmxHeader a.fmxBtn-primary:visited {
    color: #fff;
    background: var(--fmx-color-secondary);
}

.fmxBtn-ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: fmx-ripple 0.55s linear;
    background: rgba(255, 255, 255, 0.45);
    pointer-events: none;
}

@keyframes fmx-ripple {
    to { transform: scale(4); opacity: 0; }
}

.fmxHero {
    padding: var(--fmx-space-xl) 0 var(--fmx-space-lg);
    background:
        linear-gradient(135deg, rgba(52, 152, 219, 0.12), transparent 55%),
        linear-gradient(180deg, #dfe8ee, var(--fmx-color-bg));
}

.fmxHero-title {
    font-size: clamp(1.6rem, 3.4vw, 2.45rem);
    max-width: 18ch;
}

.fmxHero-numbers {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--fmx-space-md);
    margin: var(--fmx-space-lg) 0;
}

.fmxHero-figure {
    min-width: 0;
    padding: var(--fmx-space-md);
    border-radius: var(--fmx-radius);
    background: var(--fmx-color-surface);
    box-shadow: var(--fmx-shadow-out);
    text-align: center;
}

.fmxHero-num {
    display: block;
    font-family: var(--fmx-font-display);
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 700;
    color: var(--fmx-color-secondary);
    line-height: 1;
}

.fmxHero-cap {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.78rem;
    color: var(--fmx-color-muted);
}

.fmxHero-text { max-width: 62ch; color: var(--fmx-color-muted); }

.fmxHero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: var(--fmx-space-lg);
}

.fmxHero a.fmxBtn-primary,
.fmxHero a.fmxBtn-primary:visited { color: #fff; }
.fmxHero a.fmxBtn-ghost,
.fmxHero a.fmxBtn-ghost:visited {
    color: var(--fmx-color-primary);
    border-color: var(--fmx-color-primary);
}

.fmxHero-stills {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 220px));
    justify-content: start;
    gap: 1rem;
}

.fmxApp-icon {
    width: 96px;
    height: 96px;
    border-radius: 22%;
    object-fit: contain;
    flex-shrink: 0;
    box-shadow: var(--fmx-shadow-out);
}

.fmxApp-preview {
    width: auto;
    height: auto;
    max-width: 200px;
    max-height: 240px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: var(--fmx-shadow-out);
}

.fmxReview .fmxApp-preview {
    max-width: 280px;
    max-height: 280px;
}

.fmxTabs { padding-bottom: var(--fmx-space-xl); }

.fmxTabs-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: var(--fmx-space-lg) 0;
    padding: 0.5rem;
    border-radius: 12px;
    background: var(--fmx-color-surface);
    box-shadow: var(--fmx-shadow-in);
}

.fmxTabs-tab {
    min-height: 44px;
    padding: 0.55rem 1rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--fmx-color-muted);
    font-family: var(--fmx-font-display);
    font-weight: 600;
    cursor: pointer;
}

.fmxTabs-tab.is-active,
.fmxTabs-tab[aria-selected="true"] {
    background: var(--fmx-color-bg);
    color: var(--fmx-color-primary);
    box-shadow: var(--fmx-shadow-out);
}

.fmxSection { padding: var(--fmx-space-lg) 0; }
.fmxSection-title { font-size: clamp(1.35rem, 2.4vw, 1.85rem); }
.fmxSection-title-spaced { margin-top: var(--fmx-space-xl); }
.fmxSection-lead { color: var(--fmx-color-muted); max-width: 60ch; }
.fmxSection-more { margin-top: var(--fmx-space-md); }

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

.fmxCard {
    position: relative;
    margin-top: 22px;
    padding: var(--fmx-space-md) var(--fmx-space-md) var(--fmx-space-lg);
    border-radius: 0 10px 10px 10px;
    background: var(--fmx-color-surface);
    box-shadow: var(--fmx-shadow-out);
    min-width: 0;
}

.fmxCard-tab {
    position: absolute;
    top: -22px;
    left: 0;
    height: 22px;
    padding: 0 12px;
    border-radius: 8px 8px 0 0;
    font-size: 0.75rem;
    line-height: 22px;
    font-weight: 600;
    background: var(--fmx-color-secondary);
    color: #fff;
}

.fmxCard-title { font-size: 1.1rem; }
.fmxCard-text { color: var(--fmx-color-muted); margin: 0; }

.fmxRank-item { margin-bottom: var(--fmx-space-lg); }
.fmxRank-pos {
    font-family: var(--fmx-font-display);
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--fmx-color-accent);
    margin: 0 0 0.5rem;
}

.fmxRank-head {
    display: flex;
    gap: var(--fmx-space-md);
    align-items: flex-start;
    margin-bottom: var(--fmx-space-sm);
}

.fmxRank-meta { min-width: 0; }
.fmxRank-name { font-size: 1.25rem; }
.fmxRank-dev { color: var(--fmx-color-muted); margin: 0 0 0.4rem; }
.fmxRank-desc { margin-bottom: 0.5rem; }
.fmxRank-facts {
    color: var(--fmx-color-muted);
    font-size: 0.92rem;
    overflow-wrap: anywhere;
}
.fmxRank-note {
    font-size: 0.88rem;
    color: var(--fmx-color-muted);
    font-style: italic;
}
.fmxRank-tags { margin: 0 0 0.4rem; }
.fmxTag {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(52, 152, 219, 0.15);
    color: var(--fmx-color-primary);
    font-size: 0.78rem;
    font-weight: 600;
}
.fmxRank-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: var(--fmx-space-md);
}
.fmxRank-item .fmxApp-preview { margin-top: var(--fmx-space-md); }

.fmxTableWrap { overflow-x: auto; margin: var(--fmx-space-md) 0; }
.fmxTable {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
    background: var(--fmx-color-surface);
    box-shadow: var(--fmx-shadow-out);
}
.fmxTable th,
.fmxTable td {
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--fmx-color-border);
    text-align: left;
    vertical-align: top;
    font-size: 0.92rem;
}
.fmxTable thead th {
    background: var(--fmx-color-primary);
    color: #fff;
    font-family: var(--fmx-font-display);
}

.fmxLog { list-style: none; padding: 0; margin: 0; }
.fmxLog-item {
    padding: var(--fmx-space-md);
    margin-bottom: var(--fmx-space-sm);
    border-radius: var(--fmx-radius);
    background: var(--fmx-color-surface);
    box-shadow: var(--fmx-shadow-out);
}
.fmxLog-item time {
    display: block;
    font-weight: 700;
    font-family: var(--fmx-font-display);
    color: var(--fmx-color-secondary);
    margin-bottom: 0.35rem;
}
.fmxLog-item p { margin: 0; color: var(--fmx-color-muted); }

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

.fmxBlogCard {
    display: block;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
}
.fmxBlogCard-band {
    display: block;
    height: 72px;
    margin: 0.25rem 0 0.85rem;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--fmx-color-secondary), var(--fmx-color-primary));
}
.fmxBlogCard-band-alt {
    background: linear-gradient(135deg, var(--fmx-color-accent), var(--fmx-color-primary));
}
.fmxBlogCard-band-warm {
    background: linear-gradient(135deg, #5dade2, #2c3e50);
}
.fmxBlogCard-title { font-size: 1.05rem; }
.fmxBlogCard-excerpt { color: var(--fmx-color-muted); margin: 0; font-size: 0.92rem; }

.fmxCta {
    padding: var(--fmx-space-xl) 0;
    background: linear-gradient(135deg, var(--fmx-color-primary), #1a252f);
    color: #fff;
    text-align: center;
}
.fmxCta-title { color: #fff; }
.fmxCta-text { color: rgba(255, 255, 255, 0.85); max-width: 48ch; margin-inline: auto; }
.fmxCta a.fmxBtn-primary,
.fmxCta a.fmxBtn-primary:visited {
    color: var(--fmx-color-primary);
    background: #fff;
}

.fmxFooter {
    padding: var(--fmx-space-xl) 0 var(--fmx-space-lg);
    background: var(--fmx-color-surface);
    box-shadow: var(--fmx-shadow-in);
}
.fmxFooter-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--fmx-space-sm);
}
.fmxFooter-logo img { width: 140px; height: auto; }
.fmxFooter-lead { max-width: 48ch; color: var(--fmx-color-muted); }
.fmxFooter-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    list-style: none;
    padding: 0;
    margin: 0.5rem 0;
}
.fmxFooter-links a,
.fmxFooter-cookieBtn {
    color: var(--fmx-color-primary);
    font-weight: 600;
    text-decoration: none;
    background: none;
    border: 0;
    cursor: pointer;
    font: inherit;
    padding: 0;
}
.fmxFooter-legal,
.fmxFooter-copy {
    max-width: 70ch;
    font-size: 0.88rem;
    color: var(--fmx-color-muted);
}

.fmxCookie { display: none; }
.fmxCookie:not([hidden]) {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 110;
    gap: 12px;
    align-items: center;
    padding: 1rem 0;
    background: var(--fmx-color-primary);
    color: #fff;
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.18);
}
.fmxCookie-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: min(100% - 2rem, var(--fmx-page-w));
}
.fmxCookie p { margin: 0; max-width: 60ch; }
.fmxCookie a { color: #fff; text-decoration: underline; }
.fmxCookie-actions { display: flex; gap: 0.5rem; }
.fmxCookie .fmxBtn {
    box-shadow: none;
    min-height: 44px;
}
.fmxCookie .fmxBtn-primary {
    background: #fff;
    color: var(--fmx-color-primary);
}

body.fmx-cookie-open { padding-bottom: 96px; }

.fmxCrumbs { margin-bottom: var(--fmx-space-md); }
.fmxCrumbs-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.88rem;
}
.fmxCrumbs-item:not(:last-child)::after {
    content: "/";
    margin-left: 0.35rem;
    color: var(--fmx-color-muted);
}
.fmxCrumbs a { text-decoration: none; }

.fmxPage {
    padding: var(--fmx-space-xl) 0;
}
.fmxPage-narrow {
    max-width: 760px;
}
.fmxPage-title { font-size: clamp(1.6rem, 3vw, 2.2rem); }

.fmxArticle-steps {
    list-style: none;
    counter-reset: fmx-step;
    padding: 0;
    margin: var(--fmx-space-lg) 0;
}
.fmxArticle-steps > li {
    counter-increment: fmx-step;
    margin-bottom: var(--fmx-space-lg);
    padding: var(--fmx-space-md);
    border-radius: var(--fmx-radius);
    background: var(--fmx-color-surface);
    box-shadow: var(--fmx-shadow-out);
}
.fmxArticle-steps h2 {
    display: flex;
    gap: 0.6rem;
    align-items: baseline;
}
.fmxArticle-steps h2::before {
    content: counter(fmx-step);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 50%;
    background: var(--fmx-color-secondary);
    color: #fff;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.fmxFacts {
    list-style: none;
    padding: 0;
    margin: var(--fmx-space-md) 0;
}
.fmxFacts li {
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--fmx-color-border);
    overflow-wrap: anywhere;
}

.fmxForm {
    display: grid;
    gap: var(--fmx-space-md);
    max-width: 560px;
}
.fmxForm-label {
    display: grid;
    gap: 0.35rem;
    font-weight: 600;
}
.fmxForm-input,
.fmxForm-area {
    width: 100%;
    min-height: 44px;
    padding: 0.65rem 0.8rem;
    border: 0;
    border-radius: 8px;
    background: var(--fmx-color-bg);
    box-shadow: var(--fmx-shadow-in);
    font: inherit;
    color: var(--fmx-color-text);
}
.fmxForm-area { min-height: 140px; resize: vertical; }
.fmxForm-status { font-size: 0.92rem; color: var(--fmx-color-secondary); }
.fmxForm-status.is-error { color: var(--fmx-color-accent); }

.fmxFaq { margin-bottom: var(--fmx-space-lg); }
.fmxFaq-item {
    margin-bottom: 0.5rem;
    border: 1px solid var(--fmx-color-border);
    border-radius: 8px;
    background: var(--fmx-color-surface);
}
.fmxFaq-q {
    width: 100%;
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border: 0;
    background: transparent;
    font: inherit;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    color: var(--fmx-color-primary);
}
.fmxFaq-q::after { content: "+"; font-size: 1.2rem; }
.fmxFaq-item.is-open .fmxFaq-q::after { content: "–"; }
.fmxFaq-a {
    padding: 0 1rem 1rem;
    color: var(--fmx-color-muted);
    margin: 0;
}

.fmxMagazine-lead {
    margin-bottom: var(--fmx-space-lg);
}
.fmxMagazine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--fmx-space-lg);
}

.fmxTips-list,
.fmxArchive-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.fmxTips-list li,
.fmxArchive-list li {
    padding: var(--fmx-space-md);
    margin-bottom: var(--fmx-space-sm);
    border-radius: var(--fmx-radius);
    background: var(--fmx-color-surface);
    box-shadow: var(--fmx-shadow-out);
}

.is-in { animation: fmx-k-tilt 0.5s ease both; }
@keyframes fmx-k-tilt {
    from { opacity: 0; transform: rotate(-1.2deg) translateY(10px); }
}

@media (prefers-reduced-motion: reduce) {
    .is-in { animation: none; }
    .fmxBtn-ripple { animation: none; display: none; }
}

@media (max-width: 1100px) {
    .fmxHeader-cta { display: none; }
    .fmxNav { gap: 0.45rem; }
    .fmxNav a { font-size: 0.8rem; }
}

@media (max-width: 900px) {
    .fmxHeader-cta { display: none; }
    .fmxNav { display: none; }
    .fmxBurger { display: block; }
}

@media (max-width: 768px) {
    .fmxHeader-logo img { width: 120px; }
    .fmxHeader-cta { display: none; }
    .fmxNav { display: none; }
    .fmxBurger { display: block; }

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

    .fmxDrawer {
        display: block;
        position: fixed;
        z-index: 210;
        background: var(--fmx-color-bg);
        overflow-y: auto;
        visibility: hidden;
        transition: transform .3s ease, opacity .3s ease, visibility .3s;
    }

    .fmxDrawer-sheet {
        inset: 0;
        height: 100vh;
        height: 100dvh;
        padding: 72px 24px 32px;
        opacity: 0;
    }

    .fmxDrawer-sheet a {
        display: block;
        padding: 14px 8px;
        font-size: 1.4rem;
        font-family: var(--fmx-font-display);
        font-weight: 600;
        text-decoration: none;
        color: var(--fmx-color-primary);
    }

    .fmxDrawer-close {
        position: absolute;
        top: 12px;
        right: 16px;
        width: 44px;
        height: 44px;
        border: 0;
        background: transparent;
        font-size: 2rem;
        line-height: 1;
        cursor: pointer;
        color: var(--fmx-color-primary);
    }

    body.nav-open { overflow: hidden; }
    body.nav-open .fmxOverlay { opacity: 1; visibility: visible; display: none; }
    body.nav-open .fmxDrawer-sheet { opacity: 1; visibility: visible; }

    .fmxHero-numbers { grid-template-columns: 1fr; }
    .fmxHero-actions .fmxBtn { width: 100%; }
    .fmxRank-head { flex-direction: column; }
    .fmxRank-item .fmxApp-preview {
        display: block;
        margin: 16px auto 0;
    }
    .fmxCookie-inner { flex-direction: column; align-items: stretch; }
    .fmxCookie .fmxBtn { width: 100%; }
    .fmxGrid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
    .fmxApp-icon { width: 72px; height: 72px; }
}

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