:root {
    --color-bg: #f7f5f0;
    --color-ink: #252938;
    --color-petrol: #168c85;
    /* Tmavší petrol pro text a výplň tlačítek — kontrast na teplé bílé (AA). */
    --color-petrol-strong: #0f6e69;
    --color-petrol-hover: #0b5c58;
    --color-muted: #6b6e7a;
    --color-line: #e2ded5;
    --color-white: #ffffff;

    --font-sans: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
    --container-max: 1360px;
    --gutter: 48px;
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background-color: var(--color-bg);
    color: var(--color-ink);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

.container {
    width: 100%;
    max-width: calc(var(--container-max) + 2 * var(--gutter));
    margin: 0 auto;
    padding: 0 var(--gutter);
}

:focus-visible {
    outline: 2px solid var(--color-petrol);
    outline-offset: 3px;
}

/* Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn--primary {
    padding: 11px 22px;
    background-color: var(--color-ink);
    color: var(--color-white);
}

.btn--primary:hover {
    background-color: #353a4d;
}

.btn--petrol {
    padding: 11px 22px;
    background-color: var(--color-petrol-strong);
    color: var(--color-white);
}

.btn--petrol:hover {
    background-color: var(--color-petrol-hover);
}

.btn--outline {
    padding: 11px 38px;
    border-color: #bdb8ad;
    background-color: transparent;
    color: var(--color-ink);
    font-weight: 500;
}

.btn--outline:hover {
    border-color: var(--color-ink);
}

.btn--lg {
    padding: 20px 56px;
    font-size: 19px;
}

/* Header */

.site-header__inner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 32px;
    padding-top: 24px;
    padding-bottom: 24px;
}

/* Linka pod hlavičkou jen v šířce obsahu. */
.site-header__inner::after {
    content: "";
    position: absolute;
    right: var(--gutter);
    bottom: 0;
    left: var(--gutter);
    height: 1px;
    background: var(--color-line);
}

.site-header__logo {
    display: inline-flex;
    flex-shrink: 0;
}

.site-header__logo img {
    width: auto;
    height: 38px;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 52px;
    margin-left: auto;
    margin-right: 30px;
}

.site-nav__link {
    color: var(--color-ink);
    font-size: 17px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s ease;
}

.site-nav__link:hover {
    color: var(--color-petrol-strong);
}

.site-header__menu {
    display: none;
}

/* Hero */

.hero__inner {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    align-items: center;
    gap: 40px;
    padding-top: 56px;
    padding-bottom: 56px;
}

.hero__eyebrow {
    margin: 0 0 28px;
    color: var(--color-petrol-strong);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hero__title {
    margin: 0 0 32px;
    font-size: clamp(38px, 4.35vw, 68px);
    font-weight: 700;
    line-height: 1.04;
    letter-spacing: -0.04em;
}

/* „Your team's knowledge." vždy na jednom řádku (na desktopu). */
.hero__title-line {
    display: block;
    white-space: nowrap;
}

.hero__lead {
    margin: 0 0 40px;
    max-width: 620px;
    font-size: clamp(18px, 1.6vw, 22px);
    line-height: 1.6;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px 32px;
    margin-bottom: 28px;
}

.hero__play {
    display: inline-flex;
    align-items: center;
    gap: 18px;
    color: var(--color-ink);
    font-size: 19px;
    font-weight: 600;
    text-decoration: none;
}

.hero__play-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 2px solid var(--color-ink);
    border-radius: 50%;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.hero__play-icon svg {
    margin-left: 2px;
}

.hero__play:hover .hero__play-icon {
    background-color: var(--color-ink);
    color: var(--color-bg);
}

.hero__note {
    margin: 0;
    color: var(--color-muted);
    font-size: 16px;
}

.hero__visual {
    display: flex;
    justify-content: flex-end;
}

/* Koláž: obrázek 1254×1254 + karty a spojnice v jeho souřadnicích.
   Rozměry karet v % a cqw (1 cqw = 1 % šířky koláže = 12,54 px originálu). */
.collage {
    position: relative;
    width: 100%;
    max-width: 680px;
    margin: 0;
    container-type: inline-size;
}

.collage__image {
    width: 100%;
    /* Okraj obrázku plynule do pozadí — webp komprese netrefí barvu pozadí přesně
       (±1 odstín), bez přechodu by byl na velké ploše vidět obdélník. */
    -webkit-mask-image:
        linear-gradient(to right, transparent, #000 4%, #000 96%, transparent),
        linear-gradient(to bottom, transparent, #000 4%, #000 96%, transparent);
    -webkit-mask-composite: source-in;
    mask-image:
        linear-gradient(to right, transparent, #000 4%, #000 96%, transparent),
        linear-gradient(to bottom, transparent, #000 4%, #000 96%, transparent);
    mask-composite: intersect;
}

.collage__link {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}

.collage__path {
    fill: none;
    stroke: var(--color-petrol-strong);
    stroke-width: 3.5;
    stroke-linecap: round;
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
}

.collage__dot {
    fill: var(--color-petrol-strong);
    transform-box: fill-box;
    transform-origin: center;
}

.collage-card {
    position: absolute;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 2cqw;
    padding: 0 2.4cqw;
    border-radius: 1.9cqw;
    background-color: var(--color-white);
    box-shadow:
        0 0.2cqw 0.6cqw rgba(37, 41, 56, 0.06),
        0 1.6cqw 4cqw rgba(37, 41, 56, 0.12);
}

.collage-card--saved {
    top: 34.7%;
    left: 50.7%;
    width: 39.6%;
    height: 11.6%;
}

.collage-card--found {
    top: 60.8%;
    left: 49%;
    width: 41.4%;
    height: 11.9%;
}

.collage-card__icon {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 6.5cqw;
    height: 6.5cqw;
    border-radius: 1.3cqw;
    background-color: #f1efea;
    color: var(--color-ink);
}

.collage-card__icon svg {
    width: 3.2cqw;
    height: 3.2cqw;
}

.collage-card__text {
    display: flex;
    flex-direction: column;
    gap: 0.5cqw;
    min-width: 0;
    white-space: nowrap;
}

.collage-card__title {
    font-size: 2.05cqw;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.collage-card__meta {
    color: var(--color-muted);
    font-size: 1.7cqw;
    line-height: 1.2;
}

/* Animace: karta 1 → spojnice → karta 2. Spouští ji site.js (.is-playing) po načtení
   obrázku; do té doby jsou prvky skryté jen s JS (.js), bez JS je vidět výsledek. */
.js [data-collage]:not(.is-playing) .collage-card,
.js [data-collage]:not(.is-playing) .collage__dot {
    opacity: 0;
}

.js [data-collage]:not(.is-playing) .collage__path {
    stroke-dashoffset: 1;
}

.collage.is-playing .collage-card {
    animation: collage-card-in 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.collage.is-playing .collage-card--saved {
    animation-delay: 0.2s;
}

.collage.is-playing .collage__dot--from {
    animation: collage-dot-in 0.3s ease-out 0.75s both;
}

.collage.is-playing .collage__path {
    animation: collage-draw 0.8s ease-in-out 0.9s both;
}

.collage.is-playing .collage__dot--to {
    animation: collage-dot-in 0.3s ease-out 1.65s both;
}

.collage.is-playing .collage-card--found {
    animation-delay: 1.7s;
}

@keyframes collage-card-in {
    from {
        opacity: 0;
        transform: translateY(1.6cqw) scale(0.98);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes collage-dot-in {
    from {
        opacity: 0;
        transform: scale(0);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes collage-draw {
    from {
        stroke-dashoffset: 1;
    }
    to {
        stroke-dashoffset: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .collage .collage-card,
    .collage .collage__dot,
    .collage .collage__path {
        animation: none !important;
        opacity: 1 !important;
        stroke-dashoffset: 0 !important;
        transform: none !important;
    }
}

.hero__tagline {
    margin: 0;
    padding: 36px 0 44px;
    border-top: 1px solid var(--color-line);
    color: var(--color-muted);
    font-size: 17px;
    letter-spacing: 0.08em;
    text-align: center;
}

/* Admin */

.admin-page {
    padding-top: 48px;
    padding-bottom: 48px;
}

.admin-page__title {
    margin: 0 0 8px;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.admin-page__text {
    margin: 0 0 24px;
}

@media (max-width: 960px) {
    .hero__inner {
        grid-template-columns: 1fr;
        gap: 32px;
        padding-top: 40px;
    }

    .hero__title {
        max-width: none;
    }

    .hero__visual {
        justify-content: center;
    }

    .collage {
        max-width: 560px;
    }
}

@media (max-width: 768px) {
    :root {
        --gutter: 16px;
    }

    .site-header__inner {
        gap: 12px;
        padding-top: 14px;
        padding-bottom: 14px;
    }

    .site-header__logo img {
        height: 28px;
    }

    .site-header__login {
        margin-left: auto;
        padding: 9px 20px;
        font-size: 15px;
    }

    .site-header__menu {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        padding: 0;
        border: 0;
        border-radius: 8px;
        background: none;
        color: var(--color-ink);
        cursor: pointer;
    }

    .site-header__menu svg {
        pointer-events: none;
    }

    .site-header__menu:hover {
        background-color: rgba(37, 41, 56, 0.06);
    }

    /* Rozbalovací panel pod hlavičkou. */
    .site-nav {
        position: absolute;
        top: 100%;
        right: var(--gutter);
        left: var(--gutter);
        z-index: 10;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        margin: 0;
        padding: 8px;
        border: 1px solid var(--color-line);
        border-radius: 12px;
        background-color: var(--color-white);
        box-shadow: 0 12px 32px rgba(37, 41, 56, 0.12);
    }

    .site-nav.is-open {
        display: flex;
    }

    .site-nav__link {
        padding: 12px 14px;
        border-radius: 8px;
    }

    .site-nav__link:hover {
        background-color: var(--color-bg);
    }

    .hero__inner {
        padding-top: 32px;
        padding-bottom: 40px;
    }

    .hero__eyebrow {
        margin-bottom: 18px;
        font-size: 13px;
    }

    .hero__title {
        margin-bottom: 20px;
    }

    .hero__title-line {
        display: inline;
        white-space: normal;
    }

    .hero__lead {
        margin-bottom: 28px;
    }

    .hero__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn--lg {
        padding: 17px 24px;
        font-size: 17px;
    }

    .hero__play {
        justify-content: center;
        font-size: 17px;
    }

    .hero__note {
        font-size: 15px;
        text-align: center;
    }

    .hero__tagline {
        padding: 28px 0 32px;
        font-size: 15px;
    }
}
