:root {
    /* barvy */
    --color-text: #1d1d1f;
    --color-text-soft: rgba(0, 0, 0, .8);
    --color-muted: #525252;
    --color-bg: #fff;
    --color-surface: #F5F5F7;
    --color-surface-hover: #ebebef;
    --color-border: rgba(0, 0, 0, .06);
    --color-footer-bg: #111113;
    --color-footer-text: #a1a1aa;

    /* zpětná kompatibilita (admin.css) */
    --gray: var(--color-muted);
    --light-gray: var(--color-surface);

    /* typografie */
    --font-heading: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;

    /* tvary a stíny */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-pill: 999px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .04), 0 2px 8px rgba(0, 0, 0, .04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, .06), 0 12px 32px rgba(0, 0, 0, .06);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, .08), 0 24px 48px rgba(0, 0, 0, .10);

    --ease-out: cubic-bezier(.2, .7, .2, 1);
    --nav-height: 76px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

html, body {
    margin: 0;
    font-size: 16px;
    font-weight: 300;
    color: var(--color-text-soft);
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-body);
    background: var(--color-bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.no-scroll {
    overflow: hidden;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: #000;
    line-height: 1.2;
    text-wrap: balance;
}

p {
    text-wrap: pretty;
}

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

a {
    color: var(--color-text-soft);
}

:focus-visible {
    outline: 2px solid var(--color-text);
    outline-offset: 3px;
    border-radius: 4px;
}

::selection {
    background: var(--color-text);
    color: #fff;
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    z-index: 2000;
    padding: .75rem 1rem;
    background: var(--color-text);
    color: #fff;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-decoration: none;
    transition: top .2s var(--ease-out);
}

.skip-link:focus {
    top: 1rem;
}

/* ========================= */
/*            NAV            */
/* ========================= */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, .8);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid transparent;
    transition: border-color .3s ease, box-shadow .3s ease;
}

.site-header.scrolled {
    border-bottom-color: var(--color-border);
    box-shadow: var(--shadow-sm);
}

.nav {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    min-height: var(--nav-height);
    padding: 0 1rem;
}

.nav .center {
    display: flex;
    gap: 2rem;
}

.nav .right {
    position: absolute;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: .75rem;
}

.nav .right a {
    display: inline-flex;
}

.nav .right img {
    width: clamp(32px, 4vw, 38px);
    height: auto;
    transition: transform .4s var(--ease-out);
}

.nav .right a:hover img {
    transform: scale(1.12);
}

#git-hub-img {
    width: clamp(36px, 4.5vw, 42px);
}

.nav .center a {
    position: relative;
    display: inline-block;
    padding: .25rem 0;
    text-decoration: none;
    color: var(--color-text);
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: .95rem;
    letter-spacing: .02em;
}

.nav .center a::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 100%;
    background-color: currentColor;
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform .4s var(--ease-out);
}

.nav .center a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.hamburger {
    position: absolute;
    left: 1rem;
    z-index: 1100;
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: transparent;
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.hamburger-line {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: transform .3s var(--ease-out), opacity .2s ease;
}

.hamburger[aria-expanded="true"] .hamburger-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger[aria-expanded="true"] .hamburger-line:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] .hamburger-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

main {
    flex: 1;
}

.main-sizing {
    padding: 0 20px;
}

/* ========================= */
/*          BUTTONS          */
/* ========================= */

.button.back {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem 1rem;
    font-family: var(--font-heading);
    font-size: .875rem;
    font-weight: 600;
    color: var(--color-text);
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    text-decoration: none;
    transition: background-color .2s ease, transform .2s var(--ease-out);
}

.button.back:hover {
    background-color: var(--color-surface-hover);
}

.button.back:hover span {
    transform: translateX(-3px);
}

.button.back span {
    display: inline-block;
    transition: transform .2s var(--ease-out);
}

/* ========================= */
/*           FOOTER          */
/* ========================= */

.site-footer {
    margin-top: 6rem;
    background: var(--color-footer-bg);
    color: var(--color-footer-text);
    font-size: .95rem;
}

.footer-inner {
    width: min(100% - 2rem, 1200px);
    margin-inline: auto;
    padding: 4.5rem 0 2rem;
}

.site-footer a {
    color: inherit;
    text-decoration: none;
    transition: color .2s ease;
}

.site-footer a:hover {
    color: #fff;
}

.site-footer :focus-visible {
    outline-color: #fff;
}

.footer-cta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 3.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.footer-eyebrow {
    margin: 0;
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: .9rem;
    letter-spacing: .04em;
}

.footer-title {
    margin: 0;
    color: #fff;
    max-width: 18ch;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 600;
    letter-spacing: -.025em;
}

.footer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

.site-footer .footer-button.secondary {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .25);
}

.site-footer .footer-button.secondary:hover {
    color: #fff;
    border-color: #fff;
    box-shadow: none;
}

.site-footer .footer-button {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    margin-top: .5rem;
    padding: .9rem 1.5rem;
    background: #fff;
    color: var(--color-text);
    border-radius: var(--radius-pill);
    font-family: var(--font-heading);
    font-weight: 600;
    transition: transform .3s var(--ease-out), box-shadow .3s ease;
}

.site-footer .footer-button:hover {
    color: var(--color-text);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 255, 255, .12);
}

.footer-button span {
    transition: transform .3s var(--ease-out);
}

.footer-button:hover span {
    transform: translateX(4px);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2.5rem;
    padding: 3rem 0;
}

.footer-brand p {
    max-width: 34ch;
    margin: .75rem 0 0;
}

.site-footer .footer-logo {
    color: #fff;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.15rem;
}

.footer-links h3 {
    margin: 0 0 1rem;
    color: #fff;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.footer-links ul {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-social a {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, .1);
    font-size: .8rem;
}

.footer-bottom p {
    margin: 0;
}

.footer-bottom a:not(.footer-top) {
    color: #fff;
}

.site-footer .footer-top {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin-left: auto;
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 50%;
    color: #fff;
    transition: background-color .2s ease, transform .3s var(--ease-out);
}

.site-footer .footer-top:hover {
    background: rgba(255, 255, 255, .1);
    transform: translateY(-3px);
}

/* ========================= */
/*     MOBILE (max 768px)    */
/* ========================= */

@media (max-width: 768px) {
    :root {
        --nav-height: 64px;
    }

    /* backdrop-filter by z hlavičky udělal containing block pro fixní menu */
    .site-header {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        background: rgba(255, 255, 255, .96);
    }

    .nav {
        justify-content: flex-end;
    }

    .hamburger {
        display: flex;
    }

    .nav .center {
        position: fixed;
        inset: 0;
        height: 100vh;
        height: 100dvh;
        background: rgba(255, 255, 255, .97);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        transform: translateY(-100%);
        visibility: hidden;
        transition: transform .4s var(--ease-out), visibility 0s linear .4s;
        z-index: 1000;
    }

    .nav .center a {
        font-size: 1.5rem;
    }

    .nav .center.active {
        transform: translateY(0);
        visibility: visible;
        transition: transform .4s var(--ease-out), visibility 0s;
    }

    .nav .right {
        position: static;
    }

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

    .footer-brand {
        grid-column: 1 / -1;
    }
}

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

    .footer-inner {
        padding-top: 3.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
