/* 
    Style.css 
    Structure: Root -> Base -> Header/Readme -> Sticker -> Layout -> Components -> Footer 
*/

:root {
    --bg: #fcfcfc;
    --bg-footer: #f4f4f4;
    --border: rgba(0, 0, 0, 0.06);
    --text-main: #1a1a1a;
    --text-secondary: #888888;
    --mono: 'JetBrains Mono', monospace;
    --transition-main: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg);
    background-image: radial-gradient(rgba(0,0,0,0.05) 1px, transparent 0);
    background-size: 30px 30px;
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

/* --- HEADER & ADAPTIVE README --- */

header {
    width: 100%;
    padding: 60px 20px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.readme-box {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px 25px;
    transition: var(--transition-main);
    display: grid;
    /* Анимация от закрытого (auto + 0fr) к открытому (auto + 1fr) */
    grid-template-rows: auto 0fr; 
    width: 100%;
    max-width: 450px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
    z-index: 10;
    cursor: default;
}

.readme-box:hover {
    grid-template-rows: auto 1fr;
    padding: 20px 25px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.05);
}

.readme-title {
    font-family: var(--mono);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-main);
    text-align: center;
    line-height: 1.4; /* Фикс наслоения текста на мобилках */
    margin-bottom: 0;
    transition: margin 0.3s ease;
}

.readme-box:hover .readme-title {
    margin-bottom: 15px;
}

.links-list {
    overflow: hidden; /* Критично для grid-анимации */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.readme-box:hover .links-list {
    opacity: 1;
}

.fly-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-family: var(--mono);
    font-size: 0.85rem;
    word-break: break-all;
    transition: color 0.2s;
}

.fly-link:hover { color: #000; }

.readme-full-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 10px;
    border-top: 1px solid var(--border);
    padding-top: 15px;
    width: 100%;
    text-align: center;
}

/* --- STICKER & ANIMATIONS --- */

.sticker-main {
    margin-top: 40px;
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 45px;
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    animation: float 5s ease-in-out infinite;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sticker-main:hover { transform: scale(1.08); }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

/* --- OVERLAY (MODAL) --- */

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    cursor: zoom-out;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

.overlay img {
    max-width: 85%;
    max-height: 85%;
    border-radius: 40px;
    box-shadow: 0 40px 80px rgba(0,0,0,0.15);
    transform: scale(0.5);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.overlay.active img { transform: scale(1); }

/* --- MAIN LAYOUT GRID --- */

.layout-grid {
    max-width: 1000px;
    width: 90%;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 25px;
    margin: 20px auto 100px;
    flex-grow: 1;
}

.panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 24px;
    overflow: hidden;
}

.banner-img {
    width: 100%;
    height: 100%;
    min-height: 500px;
    object-fit: cover;
    display: block;
}

/* --- CONTENT STYLES --- */

.content-panel { padding: 45px; }

.h1-md::before { content: "# "; color: #ddd; }

.h1-md {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0 0 15px 0;
    letter-spacing: -1px;
}

.data-list {
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.data-list li { margin-bottom: 8px; }
.data-list li span { color: var(--text-main); font-weight: 500; }

.md-divider {
    height: 1px;
    background: var(--border);
    border: none;
    margin: 30px 0;
}

.text-md {
    font-size: 1rem;
    line-height: 1.7;
    color: #333;
}

.contacts {
    margin-top: 40px;
    padding-top: 25px;
    border-top: 1px dotted #ccc;
}

.contacts-label {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 15px;
    font-family: var(--mono);
}

.contact-link {
    display: inline-flex;
    text-decoration: none;
    color: var(--text-main);
    font-family: var(--mono);
    font-size: 0.9rem;
    background: #f1f1f1;
    padding: 8px 16px;
    border-radius: 8px;
    transition: background 0.2s;
    margin: 0 10px 10px 0;
}

.contact-link:hover { background: #e5e5e5; }

/* --- FOOTER --- */

footer {
    width: 100%;
    background: var(--bg-footer);
    padding: 20px 0;
    border-top: 1px solid var(--border);
    text-align: center;
    margin-top: auto;
}

.copyright-text {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: #aaa;
    letter-spacing: 1px;
}

/* --- MEDIA QUERIES (MOBILE) --- */

@media (max-width: 800px) {
    .layout-grid { grid-template-columns: 1fr; }
    .banner-img { height: 400px; min-height: auto; }
    .content-panel { padding: 35px 25px; }
    .h1-md { font-size: 1.8rem; }
}

@media (max-width: 480px) {
    .readme-box {
        padding: 10px 15px;
        width: 95%;
    }
    .readme-title {
        font-size: 0.8rem;
    }
    .sticker-main {
        width: 160px;
        height: 160px;
    }
}
