/* landing.css — the public site: landing, blog, 404. Not the app.
 *
 * Loads after theme.css and takes every colour from its tokens, so the three
 * themes (light, dark, sun) hold here without a single hex. app.css is NOT
 * loaded: the site has no header chrome, no sheets, no rows — it is a page.
 * The one thing it shares with the app is the breakpoint: 900 px, the same
 * in every file (rozhodnutia.md §4).
 *
 * Mobile first. Everything below the media query is the phone; the media
 * query only widens what has room to widen. */

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

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

body.site {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.55;
}

h1,
h2,
h3,
p,
ul,
ol,
figure {
    margin: 0;
}

a {
    color: inherit;
}

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

.ico {
    display: block;
    flex: none;
    fill: currentColor;
}

/* The wordmark is stroked with currentColor; the file carries a dark fallback
 * colour as an attribute, and an attribute beats inheritance — so the rule
 * lives here, where the page knows what colour the text is. */
.brand__lockup g,
.hero__lockup g {
    color: var(--text);
}

.skip-link {
    position: absolute;
    left: 8px;
    top: -100px;
    z-index: 60;
    padding: 12px 16px;
    border-radius: var(--radius);
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 600;
    text-decoration: none;
}

.skip-link:focus {
    top: 8px;
}

/* ----------------------------------------------------------- header --- */

.site-hdr {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 56px;
    padding: 4px 12px;
    padding-top: max(4px, var(--safe-t));
    border-bottom: 1px solid var(--line-soft);
    background: var(--bg);
}

.brand {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 0 6px;
    color: var(--text);
    border-radius: var(--radius-sm);
}

.brand svg {
    display: block;
    height: 36px;
    width: auto;
}

/* `.brand svg` above is (0,1,1); a bare `.brand__lockup` (0,1,0) would lose to it
   and both the mark and the lockup would render — that was the doubled logo. */
.brand .brand__lockup {
    display: none;
}

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

.site-nav > a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
}

.site-nav > a[aria-current='page'] {
    color: var(--accent);
}

/* The primary button in the nav is the phone's shortcut; the wider hero CTA
 * below says the same thing with more room. Hidden on the phone — the header
 * would otherwise squeeze four things into 390 px. */
.site-nav > .btn {
    display: none;
}

/* `.site-nav > a` above outranks `.btn--primary`; the button keeps its own ink. */
.site-nav > .btn--primary {
    color: var(--on-accent);
}

.lang {
    display: inline-flex;
    margin: 0 4px;
    border: 1px solid var(--line);
    border-radius: 999px;
    overflow: hidden;
}

.lang a {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 10px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-decoration: none;
}

.lang a[aria-current='true'] {
    background: var(--accent);
    color: var(--on-accent);
}

/* ----------------------------------------------------------- buttons --- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 12px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
}

.btn--primary {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--on-accent);
}

.btn--small {
    min-height: 40px;
    padding: 8px 16px;
    font-size: 15px;
}

.link {
    color: var(--accent);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ------------------------------------------------------------- page --- */

.site-main {
    max-width: 640px;
    margin: 0 auto;
    padding: 8px 20px 40px;
}

.site-main h2 {
    margin-bottom: 8px;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.intro,
.lede {
    font-size: 18px;
    line-height: 1.5;
}

.site-main section {
    padding-top: 44px;
}

.site-main section:first-child {
    padding-top: 24px;
}

/* ------------------------------------------------------------- hero --- */

.hero {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.hero__lockup {
    display: block;
    width: min(100%, 300px);
    height: auto;
}

.hero h1 {
    font-size: clamp(34px, 9.5vw, 46px);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.hero .lede {
    font-size: 19px;
    max-width: 38ch;
}

.hero .sub {
    font-size: 17px;
    max-width: 38ch;
}

.cta {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 6px;
}

.fine {
    color: var(--muted);
    font-size: 14px;
}

/* --------------------------------------------------------- phases --- */

.phases {
    display: grid;
    gap: 10px;
    margin-top: 18px;
    padding: 0;
    list-style: none;
}

.phase {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 12px;
    align-items: center;
    padding: 14px 16px;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.phase__chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-self: start;
    min-height: 36px;
    padding: 4px 14px 4px 10px;
    border-radius: 999px;
    font-size: 16px;
    font-weight: 700;
}

.phase--take .phase__chip {
    background: var(--accent-soft);
    color: var(--accent);
}

.phase--ready .phase__chip {
    background: var(--amber-soft);
    color: var(--amber);
}

.phase--packed .phase__chip {
    background: var(--green-soft);
    color: var(--green);
}

.phase__step {
    color: var(--muted);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.phase__text {
    grid-column: 1 / -1;
    color: var(--muted);
}

.aside {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-top: 16px;
    color: var(--muted);
}

.aside .ico {
    margin-top: 2px;
    color: var(--accent);
}

/* ----------------------------------------------------------- group --- */

.group {
    display: grid;
    gap: 22px;
}

.bullets {
    display: grid;
    gap: 12px;
    margin-top: 16px;
    padding: 0;
    list-style: none;
}

.bullets li {
    padding-left: 18px;
    border-left: 3px solid var(--accent-soft);
}

/* The board — a picture of the group screen, ordered from the problem. */
.board {
    display: grid;
    gap: 6px;
    padding: 12px;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.board__head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px 8px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.need {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 10px;
    align-items: center;
    min-height: var(--row-min);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--surface2);
}

.need__name {
    font-weight: 600;
}

.need__qty {
    color: var(--muted);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

.need__badge {
    grid-row: 1 / 3;
    grid-column: 2;
    justify-self: end;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.need__who {
    color: var(--muted);
    font-size: 14px;
}

.need--missing {
    background: var(--red-soft);
}

.need--missing .need__badge {
    background: var(--red);
    color: var(--on-accent);
}

.need--extra .need__badge {
    background: var(--amber);
    color: var(--on-accent);
}

.need--covered .need__badge {
    background: var(--green);
    color: var(--on-accent);
}

/* ------------------------------------------------------------ nots --- */

.notlist {
    display: grid;
    gap: 14px;
    margin-top: 16px;
    padding: 0;
    list-style: none;
}

.notlist li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.notlist .ico {
    margin-top: 2px;
    color: var(--red);
}

/* ------------------------------------------------------------ blog --- */

.posts {
    display: grid;
    gap: 12px;
    margin-top: 18px;
    padding: 0;
    list-style: none;
}

.card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 18px;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.card__title {
    font-size: 19px;
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none;
}

.card__title:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.card__date {
    color: var(--muted);
    font-size: 13px;
}

.card__summary {
    margin-top: 4px;
    color: var(--muted);
}

.more {
    margin-top: 16px;
}

.bloghead h1,
.notfound h1 {
    font-size: 34px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.bloghead .lede,
.notfound .lede {
    margin-top: 8px;
    color: var(--muted);
}

.empty {
    margin-top: 24px;
    color: var(--muted);
}

.notfound {
    display: grid;
    gap: 12px;
    justify-items: start;
}

/* One post: magazine typography — title, date, lede, then the body with air. */
.post {
    max-width: 640px;
}

.crumb a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 44px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.post__head {
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line-soft);
}

.post__head h1 {
    font-size: clamp(30px, 7vw, 40px);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.post__date {
    margin-top: 8px;
    color: var(--muted);
    font-size: 14px;
}

.post__lede {
    margin-top: 12px;
    font-size: 18px;
    line-height: 1.5;
    color: var(--muted);
}

.post__hero {
    display: block;
    width: 100%;
    height: auto;
    margin-top: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.post__body {
    margin-top: 24px;
    font-size: 17px;
    line-height: 1.65;
}

.post__body p,
.post__body ul,
.post__body ol,
.post__body pre,
.post__body figure {
    margin-bottom: 18px;
}

.post__body h2 {
    margin: 32px 0 10px;
    font-size: 24px;
}

.post__body h3 {
    margin: 26px 0 8px;
    font-size: 19px;
}

.post__body h4 {
    margin: 20px 0 6px;
    font-size: 17px;
}

.post__body ul,
.post__body ol {
    padding-left: 24px;
}

.post__body li {
    margin-bottom: 6px;
}

.post__body blockquote {
    margin: 22px 0;
    padding: 4px 0 4px 18px;
    border-left: 3px solid var(--accent);
    color: var(--muted);
    font-style: italic;
}

.post__body blockquote p {
    margin: 0;
}

.post__body a {
    color: var(--accent);
    text-underline-offset: 3px;
}

.post__body code {
    padding: 1px 5px;
    border-radius: 6px;
    background: var(--surface2);
    font-size: 0.92em;
}

.post__body pre {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: var(--surface2);
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.5;
}

.post__body pre code {
    padding: 0;
    background: none;
    font-size: inherit;
}

.post__body img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
}

.post__body hr {
    margin: 28px 0;
    border: 0;
    border-top: 1px solid var(--line-soft);
}

/* Previous / next by date, then the way back. A missing side is missing,
 * not greyed out. */
.postnav {
    display: grid;
    gap: 10px;
    margin-top: 36px;
    padding-top: 20px;
    border-top: 1px solid var(--line-soft);
}

.postnav__prev,
.postnav__next {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 2px 10px;
    align-items: center;
    padding: 12px 14px;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    text-decoration: none;
}

.postnav__next {
    grid-template-columns: 1fr 24px;
    text-align: right;
}

.postnav__next .ico {
    grid-column: 2;
    grid-row: 1 / 3;
}

.postnav__prev .ico {
    grid-row: 1 / 3;
}

.postnav__label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.postnav__title {
    font-weight: 600;
}

.postnav__back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    color: var(--muted);
    font-weight: 600;
    text-decoration: none;
}

/* ----------------------------------------------------------- footer --- */

.site-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    justify-content: center;
    max-width: 1040px;
    margin: 24px auto 0;
    padding: 24px 20px calc(24px + var(--safe-b));
    border-top: 1px solid var(--line-soft);
    color: var(--muted);
    font-size: 14px;
}

.site-foot a {
    color: var(--muted);
    text-underline-offset: 3px;
}

/* ------------------------------------------------- the wide window --- */

@media (min-width: 900px) {
    .site-hdr {
        padding-inline: 24px;
    }

    .brand .brand__mark {
        display: none;
    }

    .brand .brand__lockup {
        display: block;
    }

    .site-nav > .btn {
        display: inline-flex;
        margin-left: 8px;
    }

    .site-main {
        max-width: 1040px;
        padding: 8px 32px 56px;
    }

    .site-main section {
        padding-top: 64px;
    }

    .site-main h2 {
        font-size: 32px;
    }

    .hero {
        padding-top: 40px;
    }

    .hero__lockup {
        width: 360px;
    }

    .hero h1 {
        font-size: 60px;
        max-width: 14ch;
    }

    .hero .lede {
        font-size: 22px;
        max-width: 44ch;
    }

    .hero .sub {
        font-size: 19px;
        max-width: 44ch;
    }

    .cta {
        flex-direction: row;
    }

    .phases {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }

    .phase {
        align-content: start;
        padding: 18px 20px;
    }

    .group {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 40px;
        align-items: start;
    }

    .board {
        margin-top: 8px;
    }

    .notlist {
        grid-template-columns: 1fr 1fr;
        gap: 18px 32px;
    }

    .posts {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }

    [data-page='blog'] .posts {
        grid-template-columns: 1fr 1fr;
        max-width: 760px;
    }

    .post,
    .bloghead {
        max-width: 680px;
        margin-inline: auto;
    }

    [data-page='blog'] .posts {
        margin-inline: auto;
    }

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

    .postnav__back {
        grid-column: 1 / -1;
        justify-self: center;
    }
}

/* ------------------------------------------------- post pictures --- */

/* A card with a picture puts it on top, 16:9, cropped — the file's own
 * width/height attributes reserve the box, so nothing jumps. A card
 * without one is the same card minus the picture: no empty frame. */
.card--img {
    padding-top: 0;
    overflow: hidden;
}

.card__pic {
    display: block;
    margin: 0 -18px 12px;
}

.card__pic img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    object-fit: cover;
}

.post__figure {
    margin: 20px 0 0;
}

.post__figure .post__hero {
    margin-top: 0;
}
