/* ==========================================
   FNL — единый стиль сайта fnl.pw
   ⠀  Дизайн-система вдохновлена TON.org
   ========================================== */

/* --- CSS Custom Properties (TON.org inspired) --- */
:root {
    --color-bg: #10161F;
    --color-white: #ffffff;
    --color-muted: #93A5B8;
    --color-accent-blue: #1EAEFB;
    --color-calc: #006a94;
    --color-support: rgba(76, 80, 32, 1);
    --font-family: 'Google Sans Flex', 'Google Sans', 'Inter', 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    --font-weight-normal: 400;
    --font-weight-bold: 500;
    --radius-round: 12px;
    --radius-btn: 8px;
    --logo-border: none;
    --footer-bg-color: #0a0d10;
    --footer-color: #6d8394;
    --header-height: 62px;
    --header-bg-color: rgba(28, 36, 48, 0.92);
}

/* --- Reset --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: var(--font-family);
    font-weight: var(--font-weight-normal);
    background: var(--color-bg);
    color: var(--color-white);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: var(--header-height);
}

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

a {
    color: inherit;
    text-decoration: none;
}

/* --- Header (Fragment.com inspired) --- */
.tm-header {
    display: flex;
    align-items: center;
    margin: 0 auto;
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: 100;
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    background-color: var(--header-bg-color);
    -webkit-backdrop-filter: blur(25px);
    backdrop-filter: blur(25px);
    height: var(--header-height);
}

.tm-header-logo {
    display: flex;
    align-items: center;
    padding: 0 20px;
}

.tm-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: var(--color-white);
    font-weight: 600;
    font-size: 18px;
    letter-spacing: -0.3px;
}

.tm-logo-img {
    height: 24px;
    width: auto;
    display: block;
}

@media screen and (max-width: 639px) {
    .tm-logo-img {
        height: 29px;
        width: auto;
        max-width: none;
    }
}

/* Mobile: two-row header — logo + TON / navigation */
@media screen and (max-width: 639px) {
    .tm-header {
        flex-wrap: wrap;
        height: auto;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .tm-header-body {
        flex-basis: 100%;
        width: 100%;
        justify-content: center;
        padding: 6px 0 2px;
        order: 3;
    }

    .tm-ton-connect-btn {
        margin-left: auto;
        margin-right: 12px;
        order: 2;
    }

    .tm-header-logo {
        order: 1;
    }
}

.tm-header-body {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    padding-right: 0;
}

/* --- Connect TON button in header (links to Mini App) --- */
.tm-ton-connect-btn {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    margin-right: 16px;
    padding: 8px 14px;
    font-size: 14px;
    line-height: 18px;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 8px;
    background-color: var(--color-accent-blue);
    color: var(--color-white);
    text-decoration: none;
    transition: opacity 0.2s;
}
.tm-ton-connect-btn:hover {
    opacity: 0.9;
}

.tm-header-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tm-header-link {
    font-size: 14px;
    line-height: 18px;
    font-weight: 500;
    padding: 8px 14px;
    white-space: nowrap;
    color: rgba(203, 215, 229, 0.7);
    text-decoration: none;
    border-radius: 8px;
    transition: color 0.16s, background-color 0.16s;
}

.tm-header-link:hover,
.tm-header-link:focus {
    color: var(--color-white);
    background-color: rgba(255, 255, 255, 0.06);
}

.tm-header-link.active {
    color: var(--color-white);
    background-color: rgba(255, 255, 255, 0.08);
}

/* --- Layout --- */
.page-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    position: relative;
}

.container {
    width: 100%;
    max-width: 1360px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

/* --- Typography --- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- Main Block --- */
.main-block {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 8px;
    padding-bottom: 36px;
    position: relative;
    overflow: hidden;
}

.main-block__brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-bottom: 76px; }

.main-block__logo {
    border-radius: 50%;
    border: var(--logo-border);
    overflow: hidden;
    flex-shrink: 0;
}

.main-block__logo a {
    display: block;
    width: 100%;
    height: 100%;
}

.main-block__logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.main-block__titles {
    text-align: left;
}

.main-block__title {
    font-family: var(--font-family);
    font-weight: var(--font-weight-normal);
    line-height: 1.2;
    margin: 0;
}

.main-block__subtitle {
    opacity: 0.7;
    line-height: 1.4;
    margin: 4px 0 0;
}

.main-block__intro {
    max-width: 720px;
    margin: 0 auto 36px;
    padding: 0 24px;
}

.main-block__lead {
    font-size: 20px;
    font-weight: 500;
    line-height: 1.5;
    color: var(--color-white);
    text-align: center;
    margin-bottom: 28px;
}

.main-block__cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.main-block__col {
    border-left: 2px solid var(--color-accent-blue);
    padding-left: 22px;
    text-align: left;
}

.main-block__col p {
    font-size: 16px;
    line-height: 1.65;
    color: #cbd5e1;
    margin: 0;
}

.main-block__col strong {
    display: block;
    color: var(--color-accent-blue);
    font-weight: 500;
    margin-bottom: 6px;
}

/* Mobile */
@media screen and (max-width: 639px) {
    .main-block__intro {
        max-width: 720px;
    }

    .main-block__lead {
        font-size: 18px;
    }

    .main-block__cols {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .main-block__col {
        padding-left: 16px;
    }

    .main-block__col p {
        font-size: 14px;
    }
}

/* Desktop */
@media screen and (min-width: 960px) {
    :root {
        --header-height: 55px;
    }
    .main-block__brand {
        justify-content: flex-start;
        align-self: flex-start;
        margin-bottom: 48px;
        padding-left: 160px;
        width: 100%;
    }

    .main-block {
        padding-top: 0;
    }

    .main-block__intro {
        max-width: 960px;
        margin-bottom: 40px;
    }

    .main-block__lead {
        font-size: 22px;
        margin-bottom: 32px;
    }

    .main-block__lead br {
        display: none;
    }

    .main-block__cols {
        gap: 36px;
    }

    .main-block__col {
        padding-left: 24px;
    }

    .main-block__col p {
        font-size: 16px;
        line-height: 1.7;
    }

    .main-block__buttons {
        margin-top: 24px;
    }
}

/* --- Buttons Row --- */
.main-block__buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 19px;
    width: 100%;
    max-width: 400px;
    padding: 0 24px;
    box-sizing: border-box;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-round);
    font-family: var(--font-family);
    font-weight: var(--font-weight-bold);
    font-size: 16px;
    color: var(--color-white);
    cursor: pointer;
    text-align: center;
    transition: opacity 0.2s, transform 0.2s;
    line-height: 1.4;
    text-decoration: none;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn--blue {
    background-color: var(--color-accent-blue);
}

.btn--teal {
    background-color: var(--color-calc);
}

.btn--olive {
    background-color: var(--color-support);
}

/* --- Footer (Fragment.com inspired) --- */
.tm-footer {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    background-color: var(--footer-bg-color);
}

.tm-footer-links {
    display: flex;
    font-size: 12px;
    line-height: 16px;
    padding: 14px 20px;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0;
}

.tm-footer-link + .tm-footer-link {
    margin-left: 32px;
}

.tm-footer-link,
.tm-footer-link:hover,
.tm-footer-link:focus {
    color: var(--footer-color);
    text-decoration: none;
    transition: color 0.2s;
}

.tm-footer-link:hover {
    color: var(--color-white);
}

/* --- Footer Mobile — центрируем строки при переносе --- */
@media screen and (max-width: 639px) {
    .tm-footer-links {
        justify-content: center;
        text-align: center;
    }

    .tm-footer-link + .tm-footer-link {
        margin-left: 20px;
    }
}

/* ==========================================
   Responsive — размеры шрифтов и логотипа
   ========================================== */

/* Mobile (≤639px) */
@media screen and (max-width: 639px) {
    .main-block {
        padding-top: 32px;
    }

    .main-block__brand {
        gap: 16px;
        margin-bottom: 32px; }

.main-block__logo {
        width: 58px;
        height: 58px;
    }

    .main-block__title {
        font-size: 24px;
    }

    .main-block__subtitle {
        font-size: 13px;
    }

    .btn {
        max-width: 100%;
    }

    .main-block__buttons {
        width: 100%;
    }
}

/* Tablet (640–959px) */
@media screen and (min-width: 640px) and (max-width: 959px) {
    .main-block__brand {
        gap: 20px;
        margin-bottom: 63px; }

.main-block__logo {
        width: 70px;
        height: 70px;
    }

    .main-block__title {
        font-size: 26px;
    }

    .main-block__subtitle {
        font-size: 16px;
    }

    .btn {
        min-width: 400px;
        max-width: 100%;
    }
}

/* Desktop (960–1359px) */
@media screen and (min-width: 960px) and (max-width: 1359px) {
    .main-block__brand {
        justify-content: flex-start;
        align-self: flex-start;
        gap: 24px;
        margin-bottom: 48px;
        padding-left: 160px;
        width: 100%;
    }

    .main-block__logo {
        width: 77px;
        height: 77px;
    }

    .main-block {
        padding-top: 0;
        margin-top: 0;
    }

    .main-block__title {
        font-size: 28px;
    }

    .main-block__subtitle {
        font-size: 17px;
    }

    .btn {
        min-width: 400px;
        max-width: 100%;
    }
}

/* Large Desktop (≥1360px) */
@media screen and (min-width: 1360px) {
    .main-block__brand {
        justify-content: flex-start;
        align-self: flex-start;
        gap: 28px;
        margin-bottom: 16px;
        padding-left: 160px;
        width: 100%;
    }

    .main-block__logo {
        width: 83px;
        height: 83px;
    }

    .main-block {
        padding-top: 0;
        margin-top: 0;
    }

    .main-block__intro {
        margin-bottom: 24px;
    }

    .main-block__title {
        font-size: 36px;
    }

    .main-block__subtitle {
        font-size: 18px;
    }

    .btn {
        min-width: 400px;
        max-width: 100%;
    }
}
