/* Kaidzen — общие стили лендинга и кабинета. Палитра: бумага васи + тушь + киноварь. */

:root {
    --paper: #f6f0e3;
    --card: #fffdf6;
    --ink: #241f1c;
    --muted: #7d7268;
    --line: #e7dcc4;
    --red: #d4402e;
    --red-dark: #b93123;
    --gold: #b98a2f;
    --jp: 'Yu Gothic', 'Hiragino Sans', 'Noto Sans JP', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Segoe UI', -apple-system, system-ui, Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--ink);
    background: var(--paper);
    /* лёгкое зерно бумаги */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.045 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 22px; }

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Кнопки ---------- */

.btn {
    display: inline-block;
    background: var(--red);
    color: #fff;
    padding: 12px 24px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 16px;
    border: 0;
    cursor: pointer;
    transition: background .15s, transform .15s;
}
.btn:hover { background: var(--red-dark); transform: translateY(-1px); text-decoration: none; }
.btn-ghost {
    background: transparent;
    color: var(--ink);
    border: 1.5px solid var(--line);
}
.btn-ghost:hover { background: var(--card); transform: none; }
.btn-sm { padding: 8px 16px; font-size: 14px; }

/* ---------- Шапка ---------- */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0 10px;
    gap: 16px;
}
.topbar .logo img { height: 46px; display: block; }
.topbar nav { display: flex; align-items: center; gap: 22px; }
.topbar nav a.nav-link { color: var(--ink); font-weight: 600; font-size: 15px; }
.topbar nav a.nav-link:hover { color: var(--red); text-decoration: none; }

/* ---------- Хиро ---------- */

.hero {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    gap: 44px;
    align-items: center;
    padding: 34px 0 30px;
}
.eyebrow {
    color: var(--red);
    font-weight: 700;
    letter-spacing: 3px;
    font-size: 13px;
    text-transform: uppercase;
    margin: 0 0 10px;
}
.hero h1 {
    font-size: clamp(42px, 6.2vw, 72px);
    line-height: 1.04;
    font-weight: 800;
    letter-spacing: -1px;
    margin: 0;
}
.hero h1 .accent {
    color: var(--red);
    background: linear-gradient(transparent 70%, rgba(212, 64, 46, .18) 70%);
}
.lead {
    font-size: 18px;
    line-height: 1.6;
    color: #4c443d;
    max-width: 34em;
    margin: 18px 0 26px;
}

.cta-card {
    display: inline-block;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 20px 24px;
    box-shadow: 0 3px 0 var(--line);
    min-width: 300px;
}
.cta-card .cta-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--muted);
    margin: 0 0 12px;
}
.tg-widget { min-height: 44px; }
.cta-alt { font-size: 14px; margin: 12px 0 0; }
.cta-note { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; max-width: 26em; }

.daruma-wrap { text-align: center; }
.daruma-wrap svg { width: 100%; max-width: 520px; height: auto; }
.daruma-wrap figcaption {
    font-size: 13.5px;
    color: var(--muted);
    font-style: italic;
    margin-top: 4px;
}

/* ---------- Волны сэйгайха ---------- */

.seigaiha {
    height: 50px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='84' height='42'%3E%3Cg fill='none' stroke='%23d4402e' stroke-opacity='.20' stroke-width='2'%3E%3Ccircle cx='0' cy='42' r='40'/%3E%3Ccircle cx='0' cy='42' r='30'/%3E%3Ccircle cx='0' cy='42' r='20'/%3E%3Ccircle cx='0' cy='42' r='10'/%3E%3Ccircle cx='42' cy='42' r='40'/%3E%3Ccircle cx='42' cy='42' r='30'/%3E%3Ccircle cx='42' cy='42' r='20'/%3E%3Ccircle cx='42' cy='42' r='10'/%3E%3Ccircle cx='84' cy='42' r='40'/%3E%3Ccircle cx='84' cy='42' r='30'/%3E%3Ccircle cx='84' cy='42' r='20'/%3E%3Ccircle cx='84' cy='42' r='10'/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-position: bottom;
    margin: 8px 0;
}

/* ---------- Секции ---------- */

section { padding: 44px 0 10px; }
section h2 { font-size: clamp(28px, 3.4vw, 34px); font-weight: 800; margin: 0; }
.sec-sub { color: var(--muted); font-size: 16px; margin: 10px 0 30px; max-width: 48em; }

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 18px;
}
.feature {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 24px;
    transition: transform .18s, box-shadow .18s;
}
.feature:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(36, 31, 28, .08); }
.feature .icon { height: 44px; margin-bottom: 14px; }
.feature h3 { font-size: 18px; margin: 0 0 8px; }
.feature p { font-size: 15px; color: var(--muted); line-height: 1.55; margin: 0; }

.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    padding: 0;
    margin: 0;
    list-style: none;
    counter-reset: step;
}
.steps li {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 24px;
    counter-increment: step;
}
.steps li::before {
    content: counter(step);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--red);
    color: #fff;
    font-weight: 800;
    font-size: 18px;
    margin-bottom: 14px;
}
.steps h3 { font-size: 17px; margin: 0 0 8px; }
.steps p { font-size: 15px; color: var(--muted); line-height: 1.55; margin: 0; }

.philosophy {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 40px;
    align-items: start;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 36px 40px;
    margin-top: 44px;
}
.kanji-vert {
    writing-mode: vertical-rl;
    font-family: var(--jp);
    font-size: 100px;
    font-weight: 700;
    color: var(--red);
    line-height: 1;
    margin: 0 auto;
    user-select: none;
}
.philosophy h2 { margin-bottom: 12px; }
.philosophy p { font-size: 17px; line-height: 1.65; margin: 12px 0 0; }
.philosophy .joke {
    font-style: italic;
    color: var(--muted);
    font-size: 15px;
    border-left: 3px solid var(--red);
    padding-left: 14px;
    margin-top: 18px;
}

/* ---------- Подвал ---------- */

footer {
    border-top: 1px solid var(--line);
    margin-top: 54px;
    padding: 26px 0 36px;
}
footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}
footer img { height: 32px; opacity: .92; }
footer p { color: var(--muted); font-size: 14px; margin: 0; }

/* ---------- Кабинет ---------- */

.appbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
    gap: 14px;
}
.appbar .logo img { height: 38px; display: block; }
.chip { display: flex; align-items: center; gap: 12px; }
.chip .avatar, .chip .avatar-fb {
    width: 38px; height: 38px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
.chip .avatar-fb {
    background: var(--red);
    color: #fff;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
}
.chip .who { line-height: 1.2; }
.chip .who b { font-size: 15px; display: block; }
.chip .who span { font-size: 13px; color: var(--muted); }
.chip form { margin: 0 0 0 6px; }

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 32px 0 20px;
}
.stat {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 20px 22px;
    text-align: center;
}
.stat b { font-size: 36px; display: block; }
.stat .label {
    font-size: 12.5px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 4px;
}
.stat .note { font-size: 12px; color: var(--muted); font-style: italic; margin-top: 6px; }

.empty {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 52px 30px;
    text-align: center;
    margin: 14px 0 40px;
}
.empty h2 { font-size: 27px; margin: 18px 0 10px; }
.empty p { color: var(--muted); max-width: 46em; margin: 0 auto; font-size: 15.5px; line-height: 1.6; }
.empty .actions { display: flex; gap: 12px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }

/* ---------- Страница входа через бота ---------- */

.auth-card {
    max-width: 520px;
    margin: 56px auto;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 36px 38px;
    box-shadow: 0 3px 0 var(--line);
}
.auth-card .logo { display: block; margin: 0 auto 20px; height: 46px; }
.auth-card h1 { font-size: 24px; text-align: center; margin: 0 0 6px; }
.auth-card .sub { text-align: center; color: var(--muted); font-size: 14.5px; margin: 0 0 18px; }
.auth-card ol { font-size: 15.5px; line-height: 1.7; color: #4c443d; margin: 0 0 24px; padding-left: 22px; }
.auth-card .btn { display: block; text-align: center; }
.auth-status { text-align: center; font-size: 14.5px; color: var(--muted); margin: 18px 0 0; }
.auth-status.ok { color: #2e7d32; font-weight: 700; }
.auth-card .back { display: block; text-align: center; font-size: 14px; margin-top: 16px; }

/* ---------- Адаптив ---------- */

@media (max-width: 920px) {
    .hero { grid-template-columns: 1fr; gap: 26px; }
    .daruma-wrap { order: -1; }
    .daruma-wrap svg { max-width: 400px; }
    .steps { grid-template-columns: 1fr; }
    .philosophy { grid-template-columns: 1fr; gap: 10px; padding: 28px; }
    .kanji-vert { writing-mode: horizontal-tb; font-size: 64px; }
}
@media (max-width: 640px) {
    .stats { grid-template-columns: 1fr; }
    .topbar nav a.nav-link { display: none; }
    .auth-card { margin: 24px auto; padding: 28px 22px; }
}
