﻿/* ============================================================
   Base & Typography
   ============================================================ */

html {
    scroll-behavior: smooth;
    font-size: 14px;
}

@media (min-width: 992px) {
    html {
        font-size: 16px;
    }
}

body {
    font-family: "Geomini", "Source Serif 4", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin-bottom: 0;
    height: 100vh;
    height: 100dvh;
}

/* ============================================================
   CSS Custom Properties (brand tokens)
   ============================================================ */

:root {
    --koshka-accent: #5C6BC0;
    --koshka-accent-hover: #4655b3;
    --koshka-accent-text: #ffffff;
    --koshka-bubble-own-bg: #5C6BC0;
    --koshka-bubble-own-fg: #ffffff;
    --koshka-bubble-bg: #e9ecef;
    --koshka-bubble-fg: #212529;
    --koshka-navbar-bg: #ffffff;
    --koshka-navbar-fg: #212529;
    --koshka-navbar-border: rgba(0,0,0,.08);
    --koshka-footer-bg: #f8f9fa;
    --koshka-footer-fg: #6c757d;
    --koshka-feed-bg: #f5f6fa;
    --koshka-compose-bg: #ffffff;
    --koshka-badge-bg: #dee2e6;
    --koshka-badge-fg: #495057;
}

[data-bs-theme="dark"] {
    --koshka-accent: #7986CB;
    --koshka-accent-hover: #8f9bd4;
    --koshka-bubble-own-bg: #7986CB;
    --koshka-bubble-own-fg: #ffffff;
    --koshka-bubble-bg: #2c2f3a;
    --koshka-bubble-fg: #e8eaf0;
    --koshka-navbar-bg: #1a1b26;
    --koshka-navbar-fg: #e8eaf0;
    --koshka-navbar-border: rgba(255,255,255,.07);
    --koshka-footer-bg: #151620;
    --koshka-footer-fg: #9199a4;
    --koshka-feed-bg: #12131c;
    --koshka-compose-bg: #1a1b26;
    --koshka-badge-bg: #2c2f3a;
    --koshka-badge-fg: #c5cae9;
}

/* ============================================================
   Theme toggle button
   ============================================================ */

.theme-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    background: transparent;
    border: 1.5px solid var(--koshka-navbar-border);
    border-radius: 50%;
    color: var(--koshka-navbar-fg);
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
}

    .theme-toggle-btn:hover {
        background-color: color-mix(in srgb, var(--koshka-accent) 12%, transparent);
        border-color: var(--koshka-accent);
        color: var(--koshka-accent);
    }

    .theme-toggle-btn:focus-visible {
        outline: 3px solid var(--koshka-accent);
        outline-offset: 2px;
    }

/* ============================================================
   Skip to main content (WCAG 2.4.1)
   ============================================================ */

.skip-link {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 9999;
    padding: 0.5rem 1rem;
    background: var(--koshka-accent);
    color: var(--koshka-accent-text);
    border-radius: 0.375rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

    /* Bootstrap's .visually-hidden-focusable already handles show/hide;
    we override to ensure our styling wins when focused */
    .skip-link:not(:focus):not(:focus-within) {
        clip: rect(0,0,0,0);
        clip-path: inset(50%);
        width: 1px;
        height: 1px;
        overflow: hidden;
        white-space: nowrap;
    }

/* ============================================================
   Focus rings (WCAG 2.4.7 — visible for all interactive elements)
   ============================================================ */

.btn:focus-visible,
.btn:focus,
.nav-link:focus-visible,
.form-control:focus,
.form-check-input:focus,
a:focus-visible {
    outline: 3px solid var(--koshka-accent);
    outline-offset: 2px;
    box-shadow: none;
}

/* ============================================================
   Alert dismissible
   ============================================================ */

.alert {
    border-radius: 0.6rem;
    font-size: 0.9375rem;
}

/* ============================================================
   Navbar
   ============================================================ */

.koshka-navbar {
    background-color: var(--koshka-navbar-bg);
    border-bottom: 1px solid var(--koshka-navbar-border);
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    padding-block: 0.5rem;
    transition: background-color 0.2s ease;
    overflow: visible;
}

    .koshka-navbar .navbar-brand {
        overflow: visible;
        line-height: 0;
    }

    .koshka-navbar .navbar-brand,
    .koshka-navbar .nav-link,
    .koshka-navbar .btn-link {
        color: var(--koshka-navbar-fg) !important;
    }

        .koshka-navbar .nav-link:hover,
        .koshka-navbar .nav-link:focus {
            color: var(--koshka-accent) !important;
        }

    .koshka-navbar .navbar-toggler {
        border-color: var(--koshka-navbar-border);
    }

.navbar-logo {
    /* Cat + wordmark are hard-black; glow/sweep carry theme-independent light */
    color: #000000;
    display: block;
    height: 30px;
    width: auto;
    overflow: visible;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.navbar-brand:hover .navbar-logo {
    opacity: 0.92;
}

/* Desktop: enlarge logo via scale. transform-origin left keeps the brand
   flush with the navbar edge; brand box reserves the scaled footprint so
   layout (and neighbors) aren't affected by transform's out-of-flow paint. */
@media (min-width: 992px) {
    .koshka-navbar .navbar-brand {
        --koshka-logo-scale: 1.85;
        display: flex;
        align-items: center;
        width: calc(120px * var(--koshka-logo-scale));
        height: calc(30px * var(--koshka-logo-scale));
    }

    .navbar-logo {
        transform: scale(var(--koshka-logo-scale));
        transform-origin: left center;
    }
}

/* ------------------------------------------------------------
   Brand logo motion — purple L→R light sweep + lively glow
   (gradient travel is SMIL inside the SVG; CSS handles pulses)
   ------------------------------------------------------------ */

.koshka-logo__aura {
    transform-origin: 20px 20px;
    transform-box: fill-box;
    animation: koshka-aura 6.5s ease-in-out infinite;
    will-change: opacity, transform;
}

.koshka-logo__cat {
    fill: #000000;
    filter: url(#koshkaBodyGlow);
}

.koshka-logo__eye-glow {
    animation: koshka-eye-bloom 4.5s ease-in-out infinite;
    will-change: opacity;
}

.koshka-logo__eye-glow--right {
    animation-delay: 0.45s;
}

.koshka-logo__eye {
    animation: koshka-eye-tint 5.5s ease-in-out infinite;
}

.koshka-logo__pupil {
    animation: koshka-pupil 4.5s ease-in-out infinite;
}

.koshka-logo__wordmark-base {
    fill: #000000;
}

.koshka-logo__wordmark-glow {
    animation: koshka-text-bloom 8s ease-in-out infinite;
}

@keyframes koshka-aura {
    0%, 100% {
        opacity: 0.45;
        transform: scale(0.9);
    }

    50% {
        opacity: 1;
        transform: scale(1.15);
    }
}

@keyframes koshka-eye-bloom {
    0%, 100% {
        opacity: 0.45;
    }

    50% {
        opacity: 1;
    }
}

@keyframes koshka-eye-tint {
    0%, 100% {
        fill: #f3e5f5;
    }

    50% {
        fill: #e1bee7;
    }
}

@keyframes koshka-pupil {
    0%, 100% {
        fill: #4a148c;
    }

    50% {
        fill: #7b1fa2;
    }
}

@keyframes koshka-text-bloom {
    0%, 100% {
        filter: url(#koshkaTextBloom) drop-shadow(0 0 0 transparent);
    }

    35%, 55% {
        filter: url(#koshkaTextBloom) drop-shadow(0 0 3px rgba(179, 136, 255, 0.9));
    }
}

@media (prefers-reduced-motion: reduce) {
    .koshka-logo__aura,
    .koshka-logo__eye-glow,
    .koshka-logo__eye,
    .koshka-logo__pupil,
    .koshka-logo__wordmark-glow {
        animation: none !important;
    }

    .koshka-logo__wordmark-wash,
    .koshka-logo__wordmark-glow {
        display: none;
    }

    .koshka-logo__aura {
        opacity: 0.35;
        transform: none;
    }

    .koshka-logo__eye-glow {
        opacity: 0.55;
    }

    /* Freeze SMIL gradient travel */
    .koshka-logo animate {
        display: none;
    }
}

[data-bs-theme="dark"] .koshka-logo__aura {
    filter: brightness(1.25) saturate(1.2);
}

[data-bs-theme="dark"] .koshka-logo__eye-glow {
    fill: #e1bee7;
}

[data-bs-theme="dark"] .koshka-logo__wordmark-glow {
    animation-name: koshka-text-bloom-dark;
}

@keyframes koshka-text-bloom-dark {
    0%, 100% {
        filter: url(#koshkaTextBloom) drop-shadow(0 0 0 transparent);
    }

    35%, 55% {
        filter: url(#koshkaTextBloom) drop-shadow(0 0 4px rgba(224, 176, 255, 0.95));
    }
}

/* ============================================================
   Footer
   ============================================================ */

.koshka-footer {
    background-color: var(--koshka-footer-bg);
    border-top: 1px solid var(--koshka-navbar-border);
    color: var(--koshka-footer-fg);
    padding: 0.75rem 0;
    font-size: 0.875rem;
}

    .koshka-footer a {
        color: var(--koshka-accent);
        text-decoration: none;
    }

        .koshka-footer a:hover,
        .koshka-footer a:focus {
            text-decoration: underline;
            color: var(--koshka-accent-hover);
        }


/* ============================================================
   Home page layout
   ============================================================ */

.landing-page {
    max-width: 1040px;
    width: 100%;
    padding: 1.5rem 1rem 2rem;
    overflow: visible;
}

.landing-hero {
    display: grid;
    gap: 1.25rem;
    padding: clamp(1.5rem, 2.8vw, 2.5rem);
    border: 1px solid var(--koshka-navbar-border);
    border-radius: 1.5rem;
    background: linear-gradient(135deg, color-mix(in srgb, var(--koshka-accent) 12%, var(--bs-body-bg)) 0%, color-mix(in srgb, var(--koshka-accent) 4%, var(--bs-body-bg)) 100%);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(6px);
}

.landing-hero__content {
    display: grid;
    gap: 0.75rem;
}

.landing-hero__eyebrow {
    display: inline-flex;
    align-self: flex-start;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--koshka-accent) 16%, transparent);
    color: var(--koshka-accent);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.landing-hero h2 {
    margin: 0;
    font-size: clamp(1.85rem, 3vw, 2.65rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--koshka-navbar-fg);
}

.landing-hero__text {
    margin: 0;
    max-width: 65ch;
    font-size: 1.03rem;
    line-height: 1.75;
    color: var(--koshka-footer-fg);
}

.landing-hero__highlights {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.landing-hero__card {
    padding: 1rem 1.1rem;
    border: 1px solid var(--koshka-navbar-border);
    border-radius: 1rem;
    background: color-mix(in srgb, var(--koshka-compose-bg) 86%, transparent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

    .landing-hero__card h3 {
        margin: 0 0 0.4rem;
        font-size: 1rem;
        font-weight: 700;
        color: var(--koshka-navbar-fg);
    }

    .landing-hero__card p {
        margin: 0;
        font-size: 0.95rem;
        line-height: 1.6;
        color: var(--koshka-footer-fg);
    }

@media (max-width: 768px) {
    .landing-page {
        padding: 1rem 0.75rem 1.5rem;
    }

    .landing-hero__highlights {
        grid-template-columns: 1fr;
    }
}
