/* ============================================================
   Teamflows — общие стили сайта (index / about / pricing).
   Палитра 1:1 из lib/core/theme/app_colors.dart (светлая тема
   + легенда статусов задач).
   ============================================================ */
:root {
    --primary: #6366F1;
    /* Indigo 500 */
    --primary-dark: #4F46E5;
    /* Indigo 600 */
    --accent: #14B8A6;
    /* Teal 500 — таймер идёт */

    --backlog: #94A3B8;
    /* Slate 400 — Назначено */
    --progress: #F59E0B;
    /* Amber 500 — В работе */
    --review: #3B82F6;
    /* Blue 500 — На проверке */
    --done: #22C55E;
    /* Green 500 — Выполнено */
    --overdue: #EF4444;
    /* Red 500 */
    --duesoon: #FB923C;
    /* Orange 400 */

    --bg: #F6F7FB;
    --surface: #FFFFFF;
    --surface-alt: #EEF0F6;
    --text: #0F172A;
    --muted: #64748B;
    --line: #E2E8F0;
    --line-strong: #CBD5E1;

    --rail: 132px;
    --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;
}

* {
    box-sizing: border-box
}

html.i18n-wait body {
    visibility: hidden
}

/* --- жёсткая защита от бокового скролла --- */
html {
    scroll-behavior: smooth;
    overflow-x: hidden
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
    width: 100%;
    max-width: 100%;
    background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 120px 120px;
    background-position: center top;
}

img,
svg,
video,
table {
    max-width: 100%
}

img {
    height: auto
}

/* элементы грида/флекса не должны раздувать трек своим min-content */
.row>*,
.board,
.col,
.trio>*,
.steps>*,
.matrix>*,
.time-wrap>*,
.cta>*,
.grid2>*,
.cards>* {
    min-width: 0
}

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

h1,
h2,
h3 {
    font-family: var(--display);
    margin: 0;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.02
}

p {
    margin: 0
}

.shell {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 28px
}

.lbl {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted)
}

.num {
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum"
}

.dotc {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex: none;
    display: inline-block
}

.skip {
    position: absolute;
    left: -9999px
}

.skip:focus {
    left: 12px;
    top: 12px;
    z-index: 200;
    background: var(--surface);
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--line-strong)
}

/* иконки */
.i {
    width: 1em;
    height: 1em;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: -.13em
}

/* ---- шапка ---- */
.top {
    position: sticky;
    top: 0;
    z-index: 60;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line)
}

.top-in {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    height: 66px
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    font-family: var(--display);
    font-weight: 800;
    font-size: 19px;
    letter-spacing: -.02em
}

.mark {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    object-fit: cover;
    display: block;
    flex: none
}

.top-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    font-family: var(--mono);
    font-size: 12.5px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted)
}

.nav-sep {
    width: 1px;
    height: 13px;
    background: var(--line-strong);
    flex: none
}

.top-nav a:hover,
.top-nav a[aria-current="page"] {
    color: var(--text)
}

.top-nav a[aria-current="page"] {
    font-weight: 600
}

.top-right {
    display: flex;
    align-items: center;
    gap: 10px
}

.only-wide {
    display: inline
}

/* ---- переключатель языка (шапка + боковое меню) ---- */
.lang {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    flex: none;
    padding: 3px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--surface-alt)
}

.lang-b {
    font-family: var(--mono);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .06em;
    line-height: 1;
    color: var(--muted);
    background: transparent;
    border: 0;
    padding: 7px 9px;
    border-radius: 7px;
    cursor: pointer;
    transition: background .15s, color .15s
}

.lang-b:hover {
    color: var(--text)
}

.lang-b[aria-pressed="true"] {
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .12)
}

.lang-b:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px
}

.drawer-foot .lang {
    justify-content: stretch
}

.drawer-foot .lang-b {
    flex: 1;
    padding: 11px 9px;
    font-size: 12.5px
}

@media(max-width:1080px) {
    .top-nav {
        gap: 14px;
        font-size: 11.5px;
        letter-spacing: .05em
    }
}

/* ---- бургер ---- */
.burger {
    display: none;
    width: 42px;
    height: 42px;
    padding: 0;
    flex: none;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 1px solid var(--line-strong);
    border-radius: 11px;
    background: var(--surface);
    transition: .18s ease
}

.burger:hover {
    border-color: var(--text)
}

.burger:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px
}

.burger span {
    display: block;
    width: 17px;
    height: 2px;
    border-radius: 2px;
    background: var(--text)
}

/* ---- боковое меню ---- */
.scrim {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(15, 23, 42, .5);
    opacity: 0;
    transition: opacity .25s ease
}

.scrim.on {
    opacity: 1
}

.drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    width: min(330px, 86vw);
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-left: 1px solid var(--line);
    box-shadow: -30px 0 70px -40px rgba(15, 23, 42, .55);
    overscroll-behavior: contain;
    transform: translateX(102%);
    visibility: hidden;
    transition: transform .3s cubic-bezier(.32, .72, 0, 1), visibility .3s
}

.drawer.on {
    transform: none;
    visibility: visible
}

.drawer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    padding-top: calc(16px + env(safe-area-inset-top));
    border-bottom: 1px solid var(--line)
}

.drawer-top .brand {
    font-size: 17px
}

.dclose {
    width: 38px;
    height: 38px;
    flex: none;
    padding: 0;
    cursor: pointer;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    transition: .18s
}

.dclose .i {
    font-size: 19px
}

.dclose:hover {
    border-color: var(--line-strong)
}

.dclose:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px
}

.drawer-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px
}

.dgroup {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 14px 10px 6px
}

.drawer-nav .dgroup:first-child {
    padding-top: 4px
}

.drawer-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 10px;
    border-radius: 11px;
    font-weight: 600;
    font-size: 15.5px;
    transition: background .15s, color .15s
}

.drawer-nav a .i {
    font-size: 19px;
    color: var(--muted);
    flex: none;
    transition: color .15s
}

.drawer-nav a:active {
    background: var(--surface-alt)
}

@media(hover:hover) {
    .drawer-nav a:hover {
        background: var(--surface-alt)
    }
}

.drawer-nav a[aria-current="page"] {
    color: var(--primary-dark);
    background: color-mix(in srgb, var(--primary) 9%, transparent)
}

.drawer-nav a[aria-current="page"] .i {
    color: var(--primary-dark)
}

.drawer-foot {
    display: grid;
    gap: 10px;
    padding: 16px 18px;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line)
}

.drawer-foot .btn {
    width: 100%;
    justify-content: center
}

.dstore {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--muted)
}

.dstore:hover {
    color: var(--text)
}

body.nav-open {
    overflow: hidden
}

@media(max-width:900px) {
    .top-nav {
        display: none
    }

    .burger {
        display: inline-flex
    }
}

@media(max-width:560px) {
    .shell {
        padding: 0 20px
    }

    .top-in {
        height: 60px
    }

    .top-right {
        gap: 8px
    }

    .top-right .btn {
        padding: 10px 15px;
        font-size: 14px;
        gap: 6px
    }

    .brand {
        font-size: 17px
    }

    .mark {
        width: 31px;
        height: 31px
    }

    .only-wide {
        display: none
    }

    .top-right .lang {
        display: none
    }

    .burger {
        width: 40px;
        height: 40px
    }
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-family: var(--sans);
    font-weight: 600;
    font-size: 15px;
    padding: 12px 20px;
    border-radius: 9px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: .18s ease;
    text-align: left
}

.btn .i {
    font-size: 18px;
    flex: none
}

.btn-solid {
    background: var(--primary-dark);
    color: #fff
}

.btn-solid:hover {
    background: #4338CA
}

.btn-line {
    background: var(--surface);
    color: var(--text);
    border-color: var(--line-strong)
}

.btn-line:hover {
    border-color: var(--text)
}

.btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px
}

/* ---- строки-«ведомости» ---- */
.row {
    display: grid;
    grid-template-columns: var(--rail) 1fr;
    gap: 36px;
    border-top: 1px solid var(--line);
    padding: 78px 0
}

.row:first-of-type {
    border-top: 0
}

.rail {
    position: sticky;
    top: 96px;
    align-self: start
}

.rail .idx {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--primary);
    margin-bottom: 10px
}

.rail .k {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted)
}

@media(max-width:820px) {
    .row {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 56px 0
    }

    .rail {
        position: static;
        display: flex;
        gap: 14px;
        align-items: baseline
    }
}

.h2 {
    font-size: clamp(28px, 3.6vw, 42px);
    max-width: 20ch
}

.lede {
    color: var(--muted);
    margin-top: 14px;
    max-width: 58ch
}

.body-txt {
    margin-top: 16px;
    max-width: 66ch
}

.body-txt p+p {
    margin-top: 12px
}

/* ---- таблица ---- */
.perm {
    margin-top: 26px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch
}

.perm table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 520px
}

.perm th,
.perm td {
    padding: 13px 16px;
    text-align: left;
    border-bottom: 1px solid var(--line)
}

.perm thead th {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 500;
    background: var(--surface-alt)
}

.perm td.c,
.perm th.c {
    text-align: center
}

.perm tr:last-child td {
    border-bottom: 0
}

.perm .yes {
    color: var(--done)
}

.perm .no {
    color: var(--line-strong)
}

.perm .i {
    font-size: 17px
}

@media(max-width:620px) {
    .perm table {
        font-size: 12.5px
    }

    .perm th,
    .perm td {
        padding: 11px 10px
    }
}

/* ---- карточки 3 в ряд ---- */
.trio {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 16px
}

.mini {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 20px
}

.mini .ic {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    color: #fff;
    margin-bottom: 14px
}

.mini .ic .i {
    font-size: 20px
}

.mini h3,
.mini h4 {
    font-family: var(--display);
    font-size: 17px;
    margin: 0 0 6px;
    font-weight: 700
}

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

@media(max-width:720px) {
    .trio {
        grid-template-columns: 1fr
    }
}

/* ---- шаги ---- */
.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 26px
}

.step {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 22px
}

.step .sn {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--primary);
    letter-spacing: .1em
}

.step h3,
.step h4 {
    font-family: var(--display);
    font-size: 19px;
    margin: 10px 0 8px;
    font-weight: 700
}

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

@media(max-width:720px) {
    .steps {
        grid-template-columns: 1fr
    }
}

/* ---- CTA ---- */
.cta {
    background: var(--text);
    color: #fff;
    border-radius: 18px;
    padding: 52px 40px;
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 30px;
    align-items: center
}

.cta h2 {
    font-size: clamp(28px, 4vw, 42px);
    color: #fff;
    max-width: 16ch
}

.cta p {
    color: #94A3B8;
    margin-top: 14px;
    max-width: 46ch
}

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

.btn-store {
    background: #fff;
    color: var(--text);
    justify-content: flex-start;
    padding: 14px 18px;
    border-radius: 11px;
    width: 100%
}

.btn-store.ghost {
    background: transparent;
    border: 1px solid #334155;
    color: #fff
}

.btn-store.ghost:hover {
    border-color: #94A3B8
}

.btn-store.soon {
    background: transparent;
    border: 1px dashed #475569;
    color: #94A3B8;
    cursor: default
}

.btn-store .soon-tag {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: .1em;
    text-transform: uppercase;
    border: 1px solid currentColor;
    border-radius: 999px;
    padding: 2px 8px;
    opacity: .85
}

@media(max-width:720px) {
    .cta {
        grid-template-columns: 1fr;
        padding: 36px 24px
    }
}

@media(max-width:400px) {
    .cta {
        padding: 28px 18px
    }

    .btn-store {
        padding: 13px 14px;
        font-size: 14px
    }
}

/* ---- подвал ---- */
footer {
    border-top: 1px solid var(--line);
    margin-top: 78px;
    padding: 36px 0
}

.foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
    letter-spacing: .04em
}

.foot .l {
    display: flex;
    gap: 18px;
    flex-wrap: wrap
}

.foot a:hover {
    color: var(--text)
}

.footcredit {
    background: var(--text)
}

.footcredit .fc {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 20px 0;
    font-family: var(--mono);
    font-size: 12.5px;
    letter-spacing: .04em;
    color: #94A3B8;
    text-align: center
}

.footcredit a {
    font-weight: 700;
    transition: opacity .18s
}

.footcredit a:hover {
    opacity: .82
}

.footcredit .dg {
    color: #fff
}

.footcredit .pl {
    color: #60A5FA
}

.footcredit .sep {
    opacity: .4
}

.footcredit .eco {
    color: #fff;
    font-weight: 700
}

/* ---- мобильная плотность ---- */
@media(max-width:560px) {
    body {
        font-size: 16px
    }

    .lbl {
        font-size: 11px;
        letter-spacing: .1em
    }

    .row {
        padding: 44px 0;
        gap: 14px
    }

    .h2 {
        font-size: clamp(25px, 7vw, 32px)
    }

    .lede {
        margin-top: 12px
    }

    .cta {
        padding: 28px 20px;
        border-radius: 16px
    }

    .cta .stores {
        gap: 9px
    }

    footer {
        margin-top: 52px;
        padding: 28px 0
    }

    .foot {
        gap: 16px
    }

    .foot .l {
        gap: 12px 14px
    }
}

/* ---- появление при скролле ---- */
.rv {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .6s ease, transform .6s ease
}

.rv.in {
    opacity: 1;
    transform: none
}

@media(prefers-reduced-motion:reduce) {
    * {
        animation: none !important;
        transition: none !important
    }

    .rv {
        opacity: 1;
        transform: none
    }
}