/* ==========================================
   palsunch.ru — сайт-визитка Павла Скороходова
   Единый стиль экосистемы FinaLife (fnl.pw)
   Дизайн-система вдохновлена TON.org
   ========================================== */

/* --- CSS Custom Properties (TON.org inspired, синхронизировано с fnl.pw) --- */
:root {
    --color-bg: #10161F;
    --color-white: #ffffff;
    --color-muted: #93A5B8;
    --color-accent-blue: #1EAEFB;
    --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;
    --footer-bg-color: #0a0d10;
    --footer-color: #6d8394;
    --header-height: 62px;
    --header-bg-color: rgba(28, 36, 48, 0.92);
    --card-bg: rgba(255, 255, 255, 0.04);
    --card-border: rgba(255, 255, 255, 0.06);
    --card-hover-bg: rgba(255, 255, 255, 0.08);
    --card-hover-border: rgba(255, 255, 255, 0.12);
    --section-alt-bg: #141b26;
    --transition-fast: 0.15s;
    --transition-smooth: 0.3s ease;
}

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

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

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);
    line-height: 1.5;
}

/* --- Animations (fnl.pw/app style) --- */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section {
    animation: fadeInUp 0.6s ease both;
    padding: 72px 20px;
}

.section:nth-child(2) { animation-delay: 0.1s; }
.section:nth-child(3) { animation-delay: 0.2s; }
.section:nth-child(4) { animation-delay: 0.3s; }
.section:nth-child(5) { animation-delay: 0.4s; }

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

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

/* --- Header (идентичен fnl.pw) --- */
.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: 500;
    font-size: 18px;
    letter-spacing: -0.3px;
}

.tm-logo-img {
    display: block;
    width: 28px;
    height: 28px;
    margin-right: 10px;
    flex-shrink: 0;
}

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

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

/* Mobile: two-row header */
@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-logo-text {
        display: none;
    }

    .tm-logo-img {
        margin-right: 0;
    }
}

/* --- 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;
}

.container--narrow {
    max-width: 960px;
}

/* --- Sections --- */
.section__title {
    font-size: 28px;
    font-weight: var(--font-weight-bold);
    text-align: center;
    margin-bottom: 48px;
    color: var(--color-white);
}

.section--about,
.section--projects {
    background: var(--section-alt-bg);
}

/* --- Hero --- */
.section--hero {
    padding-top: 60px;
    padding-bottom: 60px;
    text-align: center;
    min-height: calc(100vh - var(--header-height));
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero__brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    margin-bottom: 36px;
}

.hero__photo {
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

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

.hero__titles {
    text-align: center;
}

.hero__name {
    font-family: var(--font-family);
    font-weight: var(--font-weight-normal);
    line-height: 1.2;
    margin: 0 0 4px;
}

.hero__role {
    font-size: 16px;
    opacity: 0.7;
    line-height: 1.4;
    margin: 0;
}

.hero__tagline {
    font-size: 18px;
    font-weight: 500;
    line-height: 1.5;
    color: #cbd5e1;
    text-align: center;
    margin-bottom: 36px;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.hero__buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 240px;
    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 var(--transition-fast), transform var(--transition-fast);
    line-height: 1.4;
    text-decoration: none;
}

.btn:hover {
    opacity: 0.9;
}

.btn:active {
    opacity: 0.8;
}

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

.btn--outline {
    background: transparent;
    border: 2px solid var(--color-accent-blue);
    color: var(--color-accent-blue);
}

.btn--outline:hover {
    background: var(--color-accent-blue);
    color: var(--color-white);
    opacity: 1;
}

/* --- About --- */
.about__cols {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 48px;
    align-items: start;
}

.about__photo {
    border-radius: var(--radius-round);
    overflow: hidden;
}

.about__photo img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
}

.about__lead {
    font-size: 20px;
    font-weight: 500;
    line-height: 1.5;
    color: var(--color-accent-blue);
    margin-bottom: 28px;
}

.about__timeline {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.about__timeline li {
    border-left: 2px solid var(--color-accent-blue);
    padding-left: 22px;
    font-size: 16px;
    line-height: 1.65;
    color: #cbd5e1;
}

.about__timeline li strong {
    display: block;
    color: var(--color-white);
    font-weight: 500;
    margin-bottom: 2px;
}

/* --- Tech Stack --- */
.stack__grid {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.stack__group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stack__label {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stack__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-block;
    padding: 6px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-white);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-btn);
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.tag:hover {
    background: var(--card-hover-bg);
    border-color: var(--card-hover-border);
}

/* --- Projects --- */
.projects__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.project-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 36px 24px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-round);
    transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
    text-decoration: none;
    color: inherit;
}

.project-card:hover {
    background: var(--card-hover-bg);
    border-color: var(--card-hover-border);
    transform: translateY(-2px);
}

.project-card__icon {
    font-size: 36px;
    margin-bottom: 16px;
}

.project-card__title {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--color-white);
}

.project-card__desc {
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-muted);
}

/* --- Contacts --- */
.contacts__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.contact-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px 20px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-round);
}

.contact-item__icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.contact-item__title {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.contact-item__link,
.contact-item__text {
    font-size: 16px;
    font-weight: 500;
    color: var(--color-accent-blue);
}

.contact-item__text {
    color: var(--color-white);
}

/* --- Footer (идентичен fnl.pw) --- */
.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);
}

/* ==========================================
   Responsive
   ========================================== */

/* Mobile (≤639px) */
@media screen and (max-width: 639px) {
    .section {
        padding: 48px 16px;
    }

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

    .section--hero {
        padding-top: 40px;
        padding-bottom: 40px;
    }

    .hero__photo {
        width: 180px;
        height: 180px;
    }

    .hero__name {
        font-size: 26px;
    }

    .hero__role {
        font-size: 14px;
    }

    .hero__tagline {
        font-size: 16px;
    }

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

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

    .about__photo {
        max-width: 200px;
        margin: 0 auto;
    }

    .about__lead {
        font-size: 17px;
    }

    .about__timeline li {
        font-size: 14px;
        padding-left: 16px;
    }

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

    .contacts__grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .contact-item {
        flex-direction: row;
        align-items: center;
        text-align: left;
        padding: 16px 20px;
        gap: 14px;
    }

    .contact-item__icon {
        font-size: 24px;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .contact-item__title {
        margin-bottom: 2px;
    }

    .tm-footer-links {
        justify-content: center;
        text-align: center;
    }

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

/* Tablet (640–959px) */
@media screen and (min-width: 640px) and (max-width: 959px) {
    .hero__photo {
        width: 140px;
        height: 140px;
    }

    .hero__name {
        font-size: 30px;
    }

    .hero__role {
        font-size: 15px;
    }

    .about__cols {
        grid-template-columns: 220px 1fr;
        gap: 36px;
    }

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

    .project-card {
        padding: 28px 16px;
    }

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

/* Desktop (≥960px) */
@media screen and (min-width: 960px) {
    :root {
        --header-height: 55px;
    }

    .hero__photo {
        width: 160px;
        height: 160px;
    }

    .hero__name {
        font-size: 36px;
    }

    .hero__role {
        font-size: 18px;
    }

    .hero__tagline {
        font-size: 20px;
    }
}
