/*
 * KalininPro Home — editorial expert-home version
 * Scoped to .kph / body.kp-home-template so Reboot keeps its own header and footer.
 */

:root {
    --kph-purple: #4d3bfe;
    --kph-purple-dark: #3f30da;
    --kph-purple-soft: #f0eeff;
    --kph-purple-faint: #f8f7ff;
    --kph-text: #191a1f;
    --kph-text-soft: #34353c;
    --kph-muted: #6a6c75;
    --kph-line: #e5e6eb;
    --kph-soft: #f6f7fa;
    --kph-white: #ffffff;
    --kph-max: 1160px;
    --kph-radius: 18px;
    --kph-shadow: 0 16px 38px rgba(25, 26, 31, .07);
}

/* =========================================================
   REBOOT / THEME SAFETY
   ========================================================= */

body.kp-home-template .kph-theme-posts #primary,
body.kp-home-template .kph-theme-posts .content-area,
body.kp-home-template .kph-theme-posts .site-main {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    float: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* =========================================================
   BASE
   ========================================================= */

.kph,
.kph *,
.kph *::before,
.kph *::after,
.kph-fallback-posts,
.kph-fallback-posts *,
.kph-fallback-posts *::before,
.kph-fallback-posts *::after {
    box-sizing: border-box;
}

.kph {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    overflow-x: clip;
    background: var(--kph-white);
    color: var(--kph-text);
    font-family: inherit;
    line-height: 1.6;
}

.kph a,
.kph-fallback-posts a {
    color: inherit;
    text-decoration: none;
}

.kph img,
.kph-fallback-posts img {
    display: block;
    max-width: 100%;
    height: auto;
}

.kph h1,
.kph h2,
.kph h3,
.kph p,
.kph figure,
.kph-fallback-posts h2,
.kph-fallback-posts h3,
.kph-fallback-posts p {
    max-width: none;
}

.kph h1,
.kph h2,
.kph h3,
.kph-fallback-posts h2,
.kph-fallback-posts h3 {
    font-family: inherit;
}

.kph-container {
    width: calc(100% - 48px);
    max-width: var(--kph-max);
    min-width: 0;
    margin: 0 auto;
    padding: 0;
}

.kph-section {
    width: 100%;
    padding: 66px 0;
    scroll-margin-top: 24px;
}

.kph-eyebrow {
    margin: 0;
    color: #747680;
    font-size: 11px;
    line-height: 1.35;
    font-weight: 800;
    letter-spacing: .065em;
    text-transform: uppercase;
}

.kph-heading {
    max-width: 720px;
    margin-bottom: 30px;
}

.kph-heading--compact {
    margin-bottom: 26px;
}

.kph-heading h2 {
    margin: 10px 0 0;
    color: var(--kph-text);
    font-size: clamp(32px, 3.7vw, 46px);
    line-height: 1.08;
    letter-spacing: -.038em;
    font-weight: 850;
}

.kph-heading > p:last-child {
    max-width: 640px;
    margin: 14px 0 0;
    color: var(--kph-muted);
    font-size: 16px;
    line-height: 1.62;
}

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

.kph-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

.kph-btn {
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 19px;
    border: 1px solid transparent;
    border-radius: 11px;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 800;
    transition: transform .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}

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

.kph-btn:focus-visible,
.kph-text-link:focus-visible,
.kph-tool:focus-visible,
.kph-route-card:focus-visible {
    outline: 3px solid rgba(77, 59, 254, .22);
    outline-offset: 3px;
}

.kph-btn--primary {
    background: var(--kph-purple);
    color: #fff !important;
    box-shadow: 0 8px 20px rgba(77, 59, 254, .16);
}

.kph-btn--primary:hover {
    background: var(--kph-purple-dark);
}

.kph-btn--secondary {
    border-color: var(--kph-line);
    background: #fff;
    color: var(--kph-text) !important;
}

.kph-btn--secondary:hover {
    border-color: #c8c9d0;
}

.kph-btn--light {
    margin-top: 24px;
    border-color: #d9d6ff;
    background: #fff;
    color: var(--kph-text) !important;
}

.kph-btn--light:hover {
    border-color: #c7c2ff;
    box-shadow: 0 8px 20px rgba(77, 59, 254, .08);
}

.kph-text-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    color: var(--kph-purple) !important;
    font-size: 14px;
    line-height: 1.3;
    font-weight: 850;
}

.kph-text-link span,
.kph-btn span,
.kph-route-card__action b {
    transition: transform .18s ease;
}

.kph-text-link:hover span,
.kph-btn:hover span,
.kph-route-card:hover .kph-route-card__action b {
    transform: translateX(3px);
}

/* =========================================================
   HERO
   ========================================================= */

.kph-hero {
    padding: 36px 0 44px;
    border-bottom: 1px solid #efeff3;
    background: linear-gradient(180deg, #fff 0%, #fcfcff 100%);
}

.kph-hero__layout {
    display: block;
}

.kph-hero__content {
    min-width: 0;
    max-width: 900px;
}

.kph-hero h1 {
    max-width: 880px;
    margin: 14px 0 0;
    color: var(--kph-text);
    font-size: clamp(42px, 4.5vw, 58px);
    line-height: 1.015;
    letter-spacing: -.048em;
    font-weight: 880;
}

.kph-hero__lead {
    max-width: 700px !important;
    margin: 22px 0 0;
    color: var(--kph-text-soft);
    font-size: clamp(18px, 1.6vw, 21px);
    line-height: 1.52;
    letter-spacing: -.012em;
}

/* =========================================================
   START ROUTES
   ========================================================= */

.kph-start {
    padding-top: 42px;
    padding-bottom: 54px;
    background: #fff;
}

.kph-route-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.kph-route-card {
    min-width: 0;
    min-height: 208px;
    display: flex;
    flex-direction: column;
    padding: 22px 22px 20px;
    border: 1px solid var(--kph-line);
    border-radius: var(--kph-radius);
    background: #fff;
    color: var(--kph-text) !important;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.kph-route-card:hover {
    transform: translateY(-2px);
    border-color: #d7d5ff;
    box-shadow: var(--kph-shadow);
}

.kph-route-card__tag {
    display: inline-flex;
    align-self: flex-start;
    margin-bottom: 14px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: var(--kph-purple);
    font-size: 10px;
    line-height: 1.2;
    font-weight: 850;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.kph-route-card h3 {
    margin: 0;
    color: var(--kph-text);
    font-size: 22px;
    line-height: 1.16;
    letter-spacing: -.03em;
    font-weight: 840;
}

.kph-route-card p {
    margin: 11px 0 0;
    color: var(--kph-muted);
    font-size: 14px;
    line-height: 1.56;
}

.kph-route-card__action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 14px;
    color: var(--kph-purple);
    font-size: 13px;
    line-height: 1.3;
    font-weight: 850;
}

.kph-route-card__action b {
    font-size: 15px;
    font-weight: inherit;
}

/* =========================================================
   TOOLS
   ========================================================= */

.kph-tools {
    padding-top: 4px;
    padding-bottom: 28px;
    background: #fff;
}

.kph-tools__panel {
    display: grid;
    grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
    gap: 40px;
    align-items: center;
    padding: 36px;
    border: 1px solid #dedbff;
    border-radius: 22px;
    background: linear-gradient(135deg, #f8f7ff 0%, #f3f1ff 100%);
}

.kph-tools__intro {
    min-width: 0;
}

.kph-tools__intro .kph-eyebrow {
    color: var(--kph-purple);
}

.kph-tools__intro h2 {
    margin: 10px 0 0;
    color: var(--kph-text);
    font-size: clamp(29px, 3vw, 37px);
    line-height: 1.08;
    letter-spacing: -.038em;
    font-weight: 850;
}

.kph-tools__intro > p:last-of-type {
    max-width: 500px;
    margin: 16px 0 0;
    color: var(--kph-muted);
    font-size: 15px;
    line-height: 1.62;
}

.kph-tools__list {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #dedee5;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(25, 26, 31, .05);
}

.kph-tool {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 20px;
    gap: 14px;
    align-items: center;
    padding: 19px 20px;
    color: var(--kph-text) !important;
    transition: background-color .18s ease;
}

.kph-tool + .kph-tool {
    border-top: 1px solid var(--kph-line);
}

.kph-tool:hover {
    background: #fafaff;
}

.kph-tool__icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--kph-purple);
    color: #fff;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .02em;
}

.kph-tool__body {
    min-width: 0;
}

.kph-tool__body strong {
    display: block;
    color: var(--kph-text);
    font-size: 16px;
    line-height: 1.3;
    font-weight: 820;
}

.kph-tool__body small {
    display: block;
    margin-top: 4px;
    color: var(--kph-muted);
    font-size: 12px;
    line-height: 1.48;
}

.kph-tool__arrow {
    color: #8a8b93;
    font-size: 17px;
    transition: transform .18s ease;
}

.kph-tool:hover .kph-tool__arrow {
    transform: translateX(3px);
}

/* =========================================================
   ABOUT
   ========================================================= */

.kph-about {
    padding-top: 28px;
    padding-bottom: 44px;
    background: #fff;
}

.kph-about__grid {
    display: grid;
    align-items: center;
}

.kph-about__grid--photo {
    grid-template-columns: minmax(230px, .58fr) minmax(0, 1.42fr);
    gap: 52px;
    padding: 0;
    background: transparent;
}

.kph-about__grid--no-photo {
    grid-template-columns: minmax(0, 1.38fr) minmax(250px, .62fr);
    gap: 56px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.kph-about__photo {
    width: 100%;
    max-width: 310px;
    margin: 0;
    overflow: hidden;
    border-radius: 18px;
    background: var(--kph-purple-soft);
    box-shadow: 0 15px 36px rgba(25, 26, 31, .09);
}

.kph-about__photo img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: center 18%;
}

.kph-about__content {
    min-width: 0;
    max-width: 720px;
}

.kph-about__content h2 {
    margin: 10px 0 0;
    color: var(--kph-text);
    font-size: clamp(34px, 3.8vw, 46px);
    line-height: 1.02;
    letter-spacing: -.044em;
    font-weight: 870;
}

.kph-about__role {
    margin: 10px 0 0;
    color: #666873;
    font-size: 13px;
    line-height: 1.45;
    font-weight: 750;
}

.kph-about__lead {
    margin: 20px 0 0;
    color: var(--kph-text);
    font-size: 18px;
    line-height: 1.55;
    letter-spacing: -.015em;
    font-weight: 700;
}

.kph-about__content > p:not(.kph-eyebrow):not(.kph-about__role):not(.kph-about__lead) {
    margin: 14px 0 0;
    color: var(--kph-muted);
    font-size: 15px;
    line-height: 1.66;
}

.kph-about__method {
    align-self: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: 6px 0 6px 24px;
    border-left: 3px solid var(--kph-purple);
    background: transparent;
}

.kph-about__method .kph-eyebrow {
    color: var(--kph-purple);
}

.kph-about__method > p:last-child {
    margin: 13px 0 0;
    color: var(--kph-text);
    font-size: 19px;
    line-height: 1.48;
    letter-spacing: -.018em;
    font-weight: 760;
}

/* =========================================================
   FUTURE COMMERCIAL BLOCK
   ========================================================= */

.kph-commercial {
    background: #fff;
}

.kph-commercial__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.kph-commercial__card {
    min-width: 0;
    padding: 28px;
    border: 1px solid var(--kph-line);
    border-radius: var(--kph-radius);
    background: var(--kph-purple-faint);
}

.kph-commercial__card h3 {
    margin: 0;
    color: var(--kph-text);
    font-size: 24px;
    line-height: 1.16;
    letter-spacing: -.03em;
}

.kph-commercial__card p {
    margin: 11px 0 0;
    color: var(--kph-muted);
    font-size: 14px;
    line-height: 1.6;
}

/* =========================================================
   WORK WITH ME
   ========================================================= */

.kph-work {
    padding-top: 22px;
    padding-bottom: 18px;
    background: #fff;
}

.kph-work__card {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: 56px;
    align-items: center;
    padding: 34px 36px;
    border: 1px solid #dedbff;
    border-radius: 22px;
    background: linear-gradient(135deg, #faf9ff 0%, #f4f2ff 100%);
}

.kph-work__heading {
    min-width: 0;
}

.kph-work__heading .kph-eyebrow {
    color: var(--kph-purple);
}

.kph-work__heading h2 {
    max-width: 560px;
    margin: 9px 0 0;
    color: var(--kph-text);
    font-size: clamp(30px, 3.2vw, 41px);
    line-height: 1.08;
    letter-spacing: -.038em;
    font-weight: 850;
}

.kph-work__content {
    min-width: 0;
    max-width: 620px;
}

.kph-work__content p {
    margin: 0;
    color: var(--kph-text-soft);
    font-size: 16px;
    line-height: 1.66;
}

.kph-work__content .kph-btn {
    margin-top: 20px;
}

/* =========================================================
   TELEGRAM
   ========================================================= */

.kph-telegram {
    padding-top: 10px;
    padding-bottom: 54px;
    background: #fff;
}

.kph-telegram__inline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 36px;
    align-items: center;
    padding-top: 24px;
    border-top: 1px solid var(--kph-line);
}

.kph-telegram__content {
    min-width: 0;
    max-width: 760px;
}

.kph-telegram__content .kph-eyebrow {
    color: var(--kph-purple);
}

.kph-telegram__content h2 {
    margin: 7px 0 0;
    color: var(--kph-text);
    font-size: 27px;
    line-height: 1.13;
    letter-spacing: -.032em;
    font-weight: 840;
}

.kph-telegram__content > p:not(.kph-eyebrow) {
    max-width: 700px;
    margin: 9px 0 0;
    color: var(--kph-muted);
    font-size: 14px;
    line-height: 1.58;
}

.kph-telegram__content small {
    display: block;
    margin-top: 7px;
    color: var(--kph-text-soft);
    font-size: 11px;
    line-height: 1.45;
    font-weight: 780;
}

.kph-telegram__button {
    white-space: nowrap;
}

/* =========================================================
   REBOOT NATIVE POSTS
   ========================================================= */

.kph-theme-posts {
    width: 100%;
    border-top: 1px solid #f0f0f3;
    background: #fff;
}

body.kp-home-template .kph-theme-posts #primary {
    width: 100% !important;
}

/* =========================================================
   FALLBACK LATEST POSTS — only if Reboot constructor is off
   ========================================================= */

.kph-fallback-posts {
    width: 100%;
    padding: 68px 0 82px;
    border-top: 1px solid #f0f0f3;
    background: #fff;
    color: var(--kph-text);
    font-family: inherit;
}

.kph-post-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.kph-post-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--kph-line);
    border-radius: 16px;
    background: #fff;
    transition: transform .2s ease, box-shadow .2s ease;
}

.kph-post-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--kph-shadow);
}

.kph-post-card__cover {
    display: block;
    overflow: hidden;
    background: var(--kph-soft);
}

.kph-post-card__cover img,
.kph-post-card__empty {
    width: 100%;
    aspect-ratio: 16 / 9;
}

.kph-post-card__cover img {
    object-fit: cover;
    transition: transform .25s ease;
}

.kph-post-card:hover .kph-post-card__cover img {
    transform: scale(1.018);
}

.kph-post-card__empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--kph-purple-soft);
    color: var(--kph-purple);
    font-weight: 850;
}

.kph-post-card__body {
    padding: 20px;
}

.kph-post-card__category {
    display: inline-block;
    margin-bottom: 11px;
    color: var(--kph-purple);
    font-size: 10px;
    line-height: 1.3;
    font-weight: 850;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.kph-post-card h3 {
    margin: 0;
    color: var(--kph-text);
    font-size: 20px;
    line-height: 1.23;
    letter-spacing: -.025em;
}

.kph-post-card p {
    margin: 10px 0 0;
    color: var(--kph-muted);
    font-size: 14px;
    line-height: 1.55;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 960px) {
    .kph-route-grid {
        grid-template-columns: 1fr;
    }

    .kph-route-card {
        min-height: 0;
    }

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

    .kph-about__grid--photo {
        grid-template-columns: minmax(220px, .55fr) minmax(0, 1.45fr);
        gap: 40px;
    }

    .kph-work__card {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .kph-telegram__inline {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .kph-telegram__button {
        justify-self: start;
    }
}

@media (max-width: 700px) {
    .kph-container {
        width: calc(100% - 32px);
    }

    .kph-section {
        padding: 44px 0;
    }

    .kph-hero {
        padding: 30px 0 34px;
    }

    .kph-hero h1 {
        margin-top: 10px;
        font-size: 38px;
        line-height: 1.03;
    }

    .kph-hero__lead {
        margin-top: 17px;
        font-size: 16px;
        line-height: 1.5;
    }

    .kph-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        margin-top: 22px;
    }

    .kph-btn {
        width: 100%;
        min-height: 46px;
        padding: 12px 16px;
    }

    .kph-start {
        padding-top: 36px;
        padding-bottom: 42px;
    }

    .kph-heading {
        margin-bottom: 22px;
    }

    .kph-heading h2 {
        margin-top: 8px;
        font-size: 30px;
        line-height: 1.08;
    }

    .kph-heading > p:last-child {
        margin-top: 10px;
        font-size: 14px;
        line-height: 1.55;
    }

    .kph-route-grid {
        gap: 10px;
    }

    .kph-route-card {
        padding: 18px;
        border-radius: 15px;
    }

    .kph-route-card__tag {
        margin-bottom: 10px;
    }

    .kph-route-card h3 {
        font-size: 20px;
    }

    .kph-route-card p {
        margin-top: 8px;
        font-size: 13px;
    }

    .kph-route-card__action {
        padding-top: 11px;
    }

    .kph-tools {
        padding-top: 0;
        padding-bottom: 26px;
    }

    .kph-tools__panel {
        gap: 24px;
        padding: 22px 18px;
        border-radius: 17px;
    }

    .kph-tools__intro h2 {
        margin-top: 8px;
        font-size: 28px;
    }

    .kph-tools__intro > p:last-of-type {
        margin-top: 12px;
        font-size: 14px;
    }

    .kph-btn--light {
        margin-top: 18px;
    }

    .kph-tool {
        grid-template-columns: 34px minmax(0, 1fr) 18px;
        gap: 11px;
        padding: 15px 14px;
    }

    .kph-tool__icon {
        width: 34px;
        height: 34px;
        border-radius: 9px;
    }

    .kph-about {
        padding-top: 28px;
        padding-bottom: 34px;
    }

    .kph-about__grid--photo,
    .kph-about__grid--no-photo {
        grid-template-columns: 1fr;
        gap: 22px;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .kph-about__photo {
        width: min(78vw, 280px);
        max-width: 280px;
        justify-self: start;
        margin-bottom: 4px;
    }

    .kph-about__content h2 {
        margin-top: 8px;
        font-size: 34px;
    }

    .kph-about__role {
        margin-top: 7px;
        font-size: 12px;
    }

    .kph-about__lead {
        margin-top: 16px;
        font-size: 16px;
        line-height: 1.52;
    }

    .kph-about__content > p:not(.kph-eyebrow):not(.kph-about__role):not(.kph-about__lead) {
        margin-top: 11px;
        font-size: 14px;
    }

    .kph-about__method {
        padding: 3px 0 3px 17px;
        border-left-width: 2px;
    }

    .kph-about__method > p:last-child {
        margin-top: 9px;
        font-size: 17px;
        line-height: 1.42;
    }

    .kph-text-link {
        margin-top: 16px;
    }

    .kph-commercial__grid {
        grid-template-columns: 1fr;
    }

    .kph-work {
        padding-top: 14px;
        padding-bottom: 14px;
    }

    .kph-work__card {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 24px 18px;
        border-radius: 17px;
    }

    .kph-work__heading h2 {
        font-size: 29px;
        line-height: 1.08;
    }

    .kph-work__content p {
        font-size: 15px;
        line-height: 1.6;
    }

    .kph-work__content .kph-btn {
        width: 100%;
        margin-top: 18px;
    }

    .kph-telegram {
        padding-top: 6px;
        padding-bottom: 34px;
    }

    .kph-telegram__inline {
        grid-template-columns: 1fr;
        gap: 14px;
        padding-top: 20px;
    }

    .kph-telegram__content h2 {
        font-size: 24px;
        line-height: 1.12;
    }

    .kph-telegram__content > p:not(.kph-eyebrow) {
        font-size: 13px;
    }

    .kph-telegram__button {
        width: 100%;
        justify-self: stretch;
    }

    .kph-post-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 390px) {
    .kph-container {
        width: calc(100% - 24px);
    }

    .kph-hero {
        padding-top: 26px;
    }

    .kph-hero h1 {
        font-size: 35px;
    }

    .kph-heading h2 {
        font-size: 28px;
    }

    .kph-tools__intro h2 {
        font-size: 27px;
    }
}



@media (prefers-reduced-motion: reduce) {
    .kph *,
    .kph *::before,
    .kph *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
