/* ===========================================================
   avsch.ru — тёплый глассморфизм с живым фоном.
   Светлая/тёмная тема, локальный шрифт Manrope, микро-анимации.
   =========================================================== */

@font-face { font-family: 'Manrope'; src: url('/static/fonts/manrope-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('/static/fonts/manrope-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('/static/fonts/manrope-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('/static/fonts/manrope-800.woff2') format('woff2'); font-weight: 800; font-display: swap; }

:root {
    --ink: #4a3a2e;
    --ink-soft: #8a7256;
    --accent: #f0852f;
    --accent-2: #ff5d8f;
    --card: rgba(255, 255, 255, 0.46);
    --card-brd: rgba(255, 255, 255, 0.65);
    --card-hi: rgba(255, 255, 255, 0.92);
    --shadow: 0 8px 32px rgba(150, 95, 50, 0.14);
    --shadow-hi: 0 16px 44px rgba(150, 95, 50, 0.22);
    --radius: 24px;
    --up: #c0563f;
    --down: #3f8a5b;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--ink);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* ---------- живой фон с плывущими «облаками» ---------- */
.bg-orbs {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    background: linear-gradient(160deg, #fff4e8 0%, #ffe9d8 45%, #ffe1ec 100%);
}
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(46px);
    opacity: 0.72;
    will-change: transform;
    animation: float 16s ease-in-out infinite;
}
.orb.o1 { width: 44vmax; height: 44vmax; background: #ffab63; top: -12vmax; left: -8vmax; }
.orb.o2 { width: 38vmax; height: 38vmax; background: #ff7da6; bottom: -14vmax; right: -6vmax; animation-duration: 21s; }
.orb.o3 { width: 32vmax; height: 32vmax; background: #ffc94f; top: 34%; left: 54%; animation-duration: 25s; }
.orb.o4 { width: 30vmax; height: 30vmax; background: #b98cff; top: 22%; left: 4%; animation-duration: 19s; opacity: 0.55; }

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(9vmax, -7vmax) scale(1.16); }
    66% { transform: translate(-7vmax, 6vmax) scale(0.9); }
}

/* ---------- каркас ---------- */
.wrap {
    max-width: 860px;
    margin: 0 auto;
    padding: 40px 18px 64px;
}

/* появление блоков «лесенкой» */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.site-head, .cat-hero, .card, .wish, .site-foot { animation: rise 0.6s cubic-bezier(.2,.7,.2,1) both; }
.cat-hero { animation-delay: 0.05s; }
.card-ai { animation-delay: 0.10s; }
.grid-2:nth-of-type(1) { animation-delay: 0.14s; }
.card-jokes { animation-delay: 0.18s; }

/* ---------- шапка / герой ---------- */
.site-head { text-align: center; margin-bottom: 30px; }
.site-head h1 {
    margin: 0;
    font-size: clamp(2rem, 6vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -1px;
}
.hi-emoji {
    display: inline-block;
    animation: bob 4.5s ease-in-out infinite;
}
.hi-text {
    background: linear-gradient(120deg, var(--accent), var(--accent-2), var(--accent));
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: shimmer 7s ease-in-out infinite;
}
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-7px) rotate(-7deg); } }
@keyframes shimmer { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.site-head .date {
    margin: 8px 0 0;
    color: var(--ink-soft);
    font-size: 1.05rem;
    font-weight: 600;
}

/* ---------- котик в стеклянной раме ---------- */
.cat-hero {
    position: relative;
    margin-bottom: 24px;
    border-radius: var(--radius);
    overflow: hidden;
    padding: 8px;
    background: var(--card);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid var(--card-brd);
    box-shadow: var(--shadow);
}
.cat-hero img {
    display: block;
    width: 100%;
    max-height: 520px;
    object-fit: contain;
    border-radius: 18px;
}

/* ---------- стеклянные карточки ---------- */
.card {
    background: var(--card);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    border: 1px solid var(--card-brd);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px 26px;
    margin-bottom: 22px;
    transition: transform 0.28s cubic-bezier(.2,.7,.2,1), box-shadow 0.28s, border-color 0.28s;
}
.card:hover {
    transform: translateY(-7px) scale(1.012);
    box-shadow: var(--shadow-hi);
    border-color: var(--card-hi);
}
.card h2 { margin: 0 0 16px; font-size: 1.2rem; font-weight: 800; letter-spacing: -0.3px; }
.muted { color: var(--ink-soft); font-style: italic; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 22px; }
.grid-2 .card { margin-bottom: 0; }

/* ---------- AI мысль ---------- */
.card-ai {
    background: linear-gradient(135deg, rgba(255,240,224,0.55), rgba(255,225,236,0.5));
}
.ai-text { margin: 0; font-size: 1.18rem; line-height: 1.6; font-weight: 600; }

/* ---------- погода ---------- */
.weather-main { display: flex; align-items: center; gap: 14px; }
.weather-emoji { font-size: 3rem; line-height: 1; filter: drop-shadow(0 4px 8px rgba(0,0,0,.12)); }
.weather-temp { font-size: 3rem; font-weight: 800; letter-spacing: -2px; }
.weather-desc { margin: 4px 0 14px; color: var(--ink-soft); font-weight: 600; }
.weather-meta { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 0.95rem; color: var(--ink-soft); }
.weather-meta b { color: var(--ink); font-weight: 700; }

/* ---------- курсы ---------- */
.rates-date { margin: 0 0 14px; color: var(--ink-soft); font-size: 0.9rem; font-weight: 600; }
.rate-row { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px dashed rgba(138,114,86,0.28); }
.rate-row:last-child { border-bottom: none; }
.rate-cur { font-weight: 700; }
.rate-val { font-variant-numeric: tabular-nums; font-size: 1.12rem; font-weight: 700; }
.up { color: var(--up); }
.down { color: var(--down); }

/* ---------- анекдоты ---------- */
.jokes { margin: 0; padding-left: 0; counter-reset: j; list-style: none; }
.jokes li { position: relative; padding: 16px 0 16px 46px; border-bottom: 1px solid rgba(240,133,47,0.14); }
.jokes li:last-child { border-bottom: none; }
.jokes li::before {
    counter-increment: j; content: counter(j);
    position: absolute; left: 0; top: 14px;
    width: 30px; height: 30px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 0.85rem;
    box-shadow: 0 4px 12px rgba(240,133,47,0.35);
}

/* ---------- история / праздники ---------- */
.history, .holidays { margin: 0; padding-left: 20px; }
.history li, .holidays li { margin-bottom: 10px; }
.history .year { font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }

/* ---------- пожелание ---------- */
.wish { text-align: center; margin: 8px 0 22px; padding: 20px; font-size: 1.2rem; font-weight: 800; }
.wish p { margin: 0; }
.wish-text { background: linear-gradient(120deg, var(--accent), var(--accent-2), var(--accent)); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 7s ease-in-out infinite; }

/* ---------- отзывы ---------- */
.reviews-details summary { cursor: pointer; font-size: 1.2rem; font-weight: 800; list-style: none; display: flex; align-items: center; gap: 8px; user-select: none; }
.reviews-details summary::-webkit-details-marker { display: none; }
.reviews-details summary::after { content: "▾"; margin-left: auto; color: var(--accent); transition: transform .25s; }
.reviews-details[open] summary::after { transform: rotate(180deg); }
.reviews-body { margin-top: 18px; }

.flash { padding: 11px 15px; border-radius: 14px; margin: 0 0 14px; font-size: 0.95rem; font-weight: 600; }
.flash-ok { background: rgba(120,200,140,0.25); color: #2f6b3c; }
.flash-err { background: rgba(230,120,90,0.22); color: #a83a26; }

.review-form { display: flex; flex-direction: column; gap: 11px; margin-bottom: 22px; }
.review-form input[type=text], .review-form textarea {
    font: inherit; color: var(--ink);
    padding: 11px 14px; border: 1px solid rgba(138,114,86,0.3);
    border-radius: 14px; background: rgba(255,255,255,0.6); resize: vertical;
    transition: border-color .2s, box-shadow .2s;
}
.review-form input:focus, .review-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(240,133,47,0.18); }
.review-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
.captcha-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.captcha-row label { color: var(--ink-soft); font-size: 0.95rem; font-weight: 600; }
.captcha-row input { width: 84px; }
.review-form button {
    align-self: flex-start; font: inherit; font-weight: 800; cursor: pointer;
    background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border: none;
    padding: 11px 26px; border-radius: 999px;
    box-shadow: 0 6px 18px rgba(240,133,47,0.35); transition: transform .15s, filter .15s;
}
.review-form button:hover { transform: translateY(-2px); filter: brightness(1.06); }

.reviews { list-style: none; margin: 0; padding: 0; }
.reviews li { padding: 13px 0; border-bottom: 1px solid rgba(240,133,47,0.14); }
.reviews li:last-child { border-bottom: none; }
.review-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.review-name { font-weight: 800; }
.review-date { color: var(--ink-soft); font-size: 0.82rem; }
.review-text { margin: 0; white-space: pre-wrap; word-break: break-word; }

/* ---------- подвал ---------- */
.site-foot { text-align: center; margin-top: 30px; color: var(--ink-soft); font-size: 0.88rem; font-weight: 600; }
.site-foot .visits { margin: 6px 0 0; font-size: 0.85rem; }

/* ---------- тёмная тема ---------- */
@media (prefers-color-scheme: dark) {
    :root {
        --ink: #f3e9df;
        --ink-soft: #b6a48f;
        --card: rgba(48, 38, 46, 0.46);
        --card-brd: rgba(255, 255, 255, 0.14);
        --card-hi: rgba(255, 255, 255, 0.28);
        --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
        --shadow-hi: 0 16px 44px rgba(0, 0, 0, 0.5);
    }
    .bg-orbs { background: linear-gradient(160deg, #2a1f2e 0%, #3a2536 45%, #2e2436 100%); }
    .orb { opacity: 0.5; }
    .orb.o1 { background: #c9692f; } .orb.o2 { background: #b8456e; }
    .orb.o3 { background: #c79a3a; } .orb.o4 { background: #7a5ec9; }
    .card-ai { background: linear-gradient(135deg, rgba(80,50,40,0.5), rgba(80,40,60,0.45)); }
    .review-form input[type=text], .review-form textarea { background: rgba(255,255,255,0.08); }
    .flash-ok { color: #9be0ad; } .flash-err { color: #f0a48f; }
}

/* ---------- адаптив ---------- */
@media (max-width: 600px) {
    .grid-2 { grid-template-columns: 1fr; }
    .wrap { padding: 28px 14px 48px; }
    .card { padding: 20px; }
    .orb { filter: blur(50px); }   /* легче для мобильных */
}

/* уважение к «уменьшить движение» */
@media (prefers-reduced-motion: reduce) {
    .orb, .hi-emoji, .hi-text, .wish-text { animation: none; }
    .site-head, .cat-hero, .card, .wish, .site-foot { animation: none; }
    .hi-text, .wish-text { background-position: 0 50%; }
    html { scroll-behavior: auto; }
}
