/* ===== СЕМЕЙНЫЙ ПОРТАЛ ПЕТРЕНКО ===== */
/* Основные переменные */
:root {
    --primary-dark: #1a2a3a;
    --primary-warm: #c17b4c;
    --primary-gold: #d4a373;
    --light-cream: #f9f1e7;
    --soft-sage: #8ba88a;
    --deep-forest: #2c4a3b;
    --elegant-gray: #4a4a4a;
    --soft-white: #fefcf7;
    
    --shadow-sm: 0 5px 15px rgba(0,0,0,0.08);
    --shadow-md: 0 10px 25px rgba(0,0,0,0.1);
    --shadow-lg: 0 20px 40px rgba(0,0,0,0.15);
    
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-sans: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ===== Базовые стили ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    color: var(--elegant-gray);
    background-color: var(--soft-white);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 30px;
}

/* ===== Фоновые декорации ===== */
.background-decor {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    opacity: 0.4;
}

.decor-leaf {
    position: absolute;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" fill="%238ba88a" opacity="0.2"><path d="M50,10 Q70,20 75,40 Q80,60 60,80 Q40,95 20,80 Q5,60 20,35 Q35,15 50,10 Z"/></svg>');
    background-repeat: no-repeat;
    background-size: contain;
    width: 300px;
    height: 300px;
    animation: float 20s infinite ease-in-out;
}

.decor-leaf-1 {
    top: -50px;
    left: -100px;
    transform: rotate(-15deg);
    animation-delay: 0s;
}

.decor-leaf-2 {
    bottom: -50px;
    right: -100px;
    transform: rotate(160deg) scaleX(-1);
    animation-delay: -7s;
}

.decor-line {
    position: absolute;
    top: 20%;
    right: 5%;
    width: 2px;
    height: 60%;
    background: linear-gradient(to bottom, transparent, var(--primary-gold), transparent);
    opacity: 0.2;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(-15deg); }
    50% { transform: translateY(-30px) rotate(-10deg); }
}

/* ===== Шапка портала ===== */
.portal-header {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    margin-bottom: 50px;
}

.header-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}

.header-background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.7) saturate(1.2);
}

.header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 0%, rgba(0,0,0,0.4) 100%);
    z-index: -1;
}

.header-content {
    max-width: 900px;
    padding: 0 20px;
    animation: fadeInUp 1.5s ease;
}

.family-crest {
    font-size: 4rem;
    color: var(--primary-gold);
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header-content h1 {
    font-family: var(--font-serif);
    font-size: 5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header-content h1 span {
    font-weight: 300;
    font-style: italic;
    color: var(--primary-gold);
}

.header-content .subtitle {
    font-size: 1.4rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    font-weight: 300;
    letter-spacing: 1px;
}

.family-quote {
    font-size: 1.2rem;
    font-style: italic;
    border-left: 3px solid var(--primary-gold);
    padding-left: 1.5rem;
    margin: 2rem auto;
    max-width: 600px;
    text-align: left;
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* ===== Секция "Наши ресурсы" ===== */
.section-title {
    text-align: center;
    font-family: var(--font-serif);
    font-size: 3rem;
    color: var(--primary-dark);
    margin-bottom: 4rem;
    position: relative;
    padding-bottom: 1.5rem;
}

.section-title::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 3px;
    background: linear-gradient(to right, transparent, var(--primary-gold), var(--primary-warm), var(--primary-gold), transparent);
}

.section-title::after {
    content: '✦';
    position: absolute;
    bottom: -13px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--soft-white);
    padding: 0 20px;
    color: var(--primary-warm);
    font-size: 1.5rem;
}

/* Сетка карточек */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    padding: 1rem;
    margin-top: 2rem;
}

/* Карточка ресурса */
.resource-card {
    position: relative;
    background: white;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
    color: inherit;
    display: block;
    border: 1px solid rgba(0,0,0,0.05);
}

.resource-card:hover {
    transform: translateY(-15px);
    box-shadow: var(--shadow-lg);
}

.card-media {
    position: relative;
    height: 280px;
    overflow: hidden;
}

.card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.resource-card:hover .card-media img {
    transform: scale(1.1);
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
    display: flex;
    align-items: flex-end;
    padding: 2rem;
}

.resource-card:hover .card-overlay {
    opacity: 1;
}

.card-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--primary-gold);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 1px;
    box-shadow: var(--shadow-sm);
    z-index: 2;
}

.card-content {
    padding: 2rem;
    background: white;
    position: relative;
}

.card-content h3 {
    font-family: var(--font-serif);
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
}

.card-relationship {
    font-size: 1rem;
    color: var(--primary-warm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.card-description {
    color: var(--elegant-gray);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(0,0,0,0.1);
    padding-top: 1.5rem;
}

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-warm);
    font-weight: 600;
    transition: gap 0.3s ease;
}

.resource-card:hover .card-link {
    gap: 1rem;
}

.card-link i {
    font-size: 0.9rem;
}

.card-stats {
    display: flex;
    gap: 1rem;
    color: #999;
    font-size: 0.9rem;
}

.card-stats i {
    margin-right: 0.3rem;
}

/* Специальная карточка для сервера (главная) */
.resource-card.primary-card {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 900px;
    margin: 0 auto;
}

.resource-card.primary-card .card-media {
    height: 100%;
    min-height: 350px;
}

/* Карточка "Скоро" */
.resource-card.coming-soon {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border: 2px dashed var(--primary-gold);
    cursor: default;
    opacity: 0.9;
}

.resource-card.coming-soon:hover {
    transform: none;
    box-shadow: var(--shadow-md);
}

.coming-soon-content {
    padding: 3rem 2rem;
    text-align: center;
}

.coming-soon-content i {
    font-size: 4rem;
    color: var(--primary-gold);
    margin-bottom: 1rem;
}

.coming-soon-content h3 {
    font-size: 2rem;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.coming-soon-content p {
    color: var(--elegant-gray);
    margin-bottom: 1.5rem;
}

.coming-soon-tag {
    display: inline-block;
    padding: 0.5rem 2rem;
    background: rgba(255,255,255,0.5);
    border-radius: 50px;
    font-size: 0.9rem;
    color: var(--primary-warm);
    font-weight: 600;
    backdrop-filter: blur(5px);
}

/* ===== Секция "Семейное древо" ===== */
.family-tree-section {
    background: linear-gradient(135deg, var(--light-cream) 0%, var(--soft-white) 100%);
    padding: 5rem 0;
    margin: 4rem 0;
    position: relative;
    overflow: hidden;
}

.tree-decoration {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.tree-decoration::before,
.tree-decoration::after {
    content: '🌳';
    position: absolute;
    font-size: 15rem;
    opacity: 0.03;
}

.tree-decoration::before {
    top: -50px;
    left: -50px;
    transform: rotate(15deg);
}

.tree-decoration::after {
    bottom: -50px;
    right: -50px;
    transform: rotate(-15deg) scaleX(-1);
}

.tree-preview {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin: 3rem 0;
}

.tree-node {
    text-align: center;
    position: relative;
}

.tree-node::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -2rem;
    width: 2rem;
    height: 2px;
    background: linear-gradient(to left, var(--primary-gold), transparent);
}

.tree-node:first-child::before {
    display: none;
}

.tree-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-gold) 0%, var(--primary-warm) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    border: 3px solid white;
    box-shadow: var(--shadow-md);
}

.tree-avatar i {
    font-size: 3rem;
    color: white;
}

.tree-node span {
    display: block;
    font-weight: 600;
    color: var(--primary-dark);
}

.tree-node .tree-relation {
    font-size: 0.9rem;
    color: var(--primary-warm);
}

/* ===== Секция "Летопись" ===== */
.timeline-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.timeline-event {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease;
    border-left: 4px solid var(--primary-gold);
}

.timeline-event:hover {
    transform: translateX(10px);
    box-shadow: var(--shadow-md);
}

.event-year {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-warm);
    margin-bottom: 0.5rem;
}

.event-title {
    font-size: 1.3rem;
    font-family: var(--font-serif);
    margin-bottom: 1rem;
    color: var(--primary-dark);
}

/* ===== Футер ===== */
.portal-footer {
    background: var(--primary-dark);
    color: white;
    padding: 4rem 0 2rem;
    margin-top: 5rem;
    position: relative;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-logo {
    font-family: var(--font-serif);
    font-size: 2rem;
    color: var(--primary-gold);
}

.footer-logo i {
    margin-right: 0.5rem;
    color: var(--primary-warm);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-gold);
}

.footer-subscribe {
    display: flex;
    gap: 0.5rem;
}

.footer-subscribe input {
    flex: 1;
    padding: 0.8rem;
    border: none;
    border-radius: 5px;
    background: rgba(255,255,255,0.1);
    color: white;
}

.footer-subscribe input::placeholder {
    color: rgba(255,255,255,0.5);
}

.footer-subscribe button {
    padding: 0.8rem 1.5rem;
    background: var(--primary-gold);
    border: none;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    transition: background 0.3s ease;
}

.footer-subscribe button:hover {
    background: var(--primary-warm);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
    font-size: 0.9rem;
}

/* ===== Анимации ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0) translateX(-50%); }
    40% { transform: translateY(-20px) translateX(-50%); }
    60% { transform: translateY(-10px) translateX(-50%); }
}

.fade-in {
    animation: fadeInUp 1s ease forwards;
    opacity: 0;
}

.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }

/* ===== Адаптивность ===== */
@media (max-width: 768px) {
    .header-content h1 {
        font-size: 3rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .resource-card.primary-card {
        grid-template-columns: 1fr;
    }
    
    .resource-card.primary-card .card-media {
        min-height: 200px;
    }
    
    .family-crest {
        font-size: 3rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 20px;
    }
    
    .header-content h1 {
        font-size: 2.2rem;
    }
    
    .card-media {
        height: 200px;
    }
}