/* ═══════════════════════════════════════════════════════════════
   STYLE.CSS — Кофейный премиальный стиль (вдохновлено Coffeemania)
   С parallax-эффектом падающих кофейных зёрен
   ═══════════════════════════════════════════════════════════════ */

/* ─── Google Fonts ─── */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=Nunito+Sans:wght@300;400;500;600&display=swap');

/* ─── CSS Variables ─── */
:root {
    /* Основные цвета */
    --color-bg: #FAF8F5;
    --color-bg-warm: #F5F1EB;
    --color-bg-card: #FFFFFF;
    
    /* Кофейная палитра */
    --color-espresso: #3D2314;
    --color-latte: #8B6914;
    --color-cappuccino: #A67C52;
    --color-cream: #E8DED1;
    --color-foam: #F9F6F2;
    
    /* Текст */
    --color-text: #2C2420;
    --color-text-secondary: #6B5B4F;
    --color-text-muted: #9A8A7B;
    
    /* Акценты */
    --color-accent: #8B6914;
    --color-accent-hover: #6B5010;
    --color-link: #6B4423;
    --color-link-hover: #8B6914;
    
    /* Границы и тени */
    --border-color: #E5DDD3;
    --shadow-soft: 0 2px 20px rgba(61, 35, 20, 0.06);
    --shadow-hover: 0 8px 32px rgba(61, 35, 20, 0.10);
    --shadow-card: 0 4px 24px rgba(61, 35, 20, 0.05);
    
    /* Типографика */
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Nunito Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Размеры */
    --container-max: 900px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    
    /* Анимации */
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Reset & Base ─── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    color: var(--color-text);
    background-color: var(--color-bg);
    background-image: 
        radial-gradient(ellipse at top, var(--color-foam) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(139, 105, 20, 0.03) 0%, transparent 40%);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ─── Selection ─── */
::selection {
    background: var(--color-cream);
    color: var(--color-espresso);
}

/* ═══════════════════════════════════════════════════════════════
   КОФЕЙНЫЕ ЗЁРНА — PARALLAX
   ═══════════════════════════════════════════════════════════════ */
.beans-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.coffee-bean {
    position: absolute;
    will-change: transform;
    filter: drop-shadow(0 4px 8px rgba(61, 35, 20, 0.15));
}

.coffee-bean svg {
    width: 100%;
    height: 100%;
}

/* Левая сторона */
.bean-l1 { left: 3%; top: 5%; width: 45px; opacity: 0.7; }
.bean-l2 { left: 8%; top: 18%; width: 35px; opacity: 0.5; }
.bean-l3 { left: 2%; top: 35%; width: 55px; opacity: 0.6; }
.bean-l4 { left: 10%; top: 48%; width: 30px; opacity: 0.4; }
.bean-l5 { left: 4%; top: 62%; width: 50px; opacity: 0.7; }
.bean-l6 { left: 9%; top: 78%; width: 38px; opacity: 0.5; }
.bean-l7 { left: 3%; top: 90%; width: 42px; opacity: 0.6; }

/* Правая сторона */
.bean-r1 { right: 4%; top: 8%; width: 40px; opacity: 0.6; }
.bean-r2 { right: 9%; top: 22%; width: 50px; opacity: 0.7; }
.bean-r3 { right: 3%; top: 38%; width: 32px; opacity: 0.5; }
.bean-r4 { right: 7%; top: 52%; width: 48px; opacity: 0.6; }
.bean-r5 { right: 2%; top: 68%; width: 36px; opacity: 0.5; }
.bean-r6 { right: 10%; top: 82%; width: 55px; opacity: 0.7; }
.bean-r7 { right: 5%; top: 95%; width: 40px; opacity: 0.5; }

/* Анимация левитации */
@keyframes levitate {
    0%, 100% { transform: translateY(0) rotate(var(--rotation, 0deg)); }
    50% { transform: translateY(-15px) rotate(calc(var(--rotation, 0deg) + 5deg)); }
}

.bean-l1 { --rotation: 15deg; animation: levitate 6s ease-in-out infinite; }
.bean-l2 { --rotation: -25deg; animation: levitate 7s ease-in-out infinite 0.5s; }
.bean-l3 { --rotation: 40deg; animation: levitate 5s ease-in-out infinite 1s; }
.bean-l4 { --rotation: -10deg; animation: levitate 8s ease-in-out infinite 0.3s; }
.bean-l5 { --rotation: 30deg; animation: levitate 6.5s ease-in-out infinite 0.8s; }
.bean-l6 { --rotation: -35deg; animation: levitate 7.5s ease-in-out infinite 0.2s; }
.bean-l7 { --rotation: 20deg; animation: levitate 5.5s ease-in-out infinite 1.2s; }

.bean-r1 { --rotation: -20deg; animation: levitate 7s ease-in-out infinite 0.4s; }
.bean-r2 { --rotation: 35deg; animation: levitate 5.5s ease-in-out infinite 0.9s; }
.bean-r3 { --rotation: -45deg; animation: levitate 6.5s ease-in-out infinite 0.1s; }
.bean-r4 { --rotation: 10deg; animation: levitate 8s ease-in-out infinite 0.6s; }
.bean-r5 { --rotation: -30deg; animation: levitate 6s ease-in-out infinite 1.1s; }
.bean-r6 { --rotation: 25deg; animation: levitate 7s ease-in-out infinite 0.7s; }
.bean-r7 { --rotation: -15deg; animation: levitate 5s ease-in-out infinite 0.3s; }

/* ─── Container ─── */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 60px 40px 80px;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── Typography ─── */
h1 {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 5vw, 3rem);
    font-weight: 500;
    color: var(--color-espresso);
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 16px;
    position: relative;
}

h1::after {
    content: '';
    display: block;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--color-accent), transparent);
    margin-top: 20px;
    border-radius: 2px;
}

h2 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 500;
    color: var(--color-espresso);
    letter-spacing: -0.01em;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.subtitle {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    font-weight: 300;
    margin-bottom: 40px;
}

/* ─── Links ─── */
a {
    color: var(--color-link);
    text-decoration: none;
    transition: var(--transition-fast);
    position: relative;
}

a:hover {
    color: var(--color-link-hover);
}

/* ─── Back Link ─── */
.back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    margin-bottom: 32px;
    padding: 10px 18px;
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    transition: var(--transition-smooth);
}

.back:hover {
    color: var(--color-espresso);
    background: var(--color-foam);
    transform: translateX(-4px);
    box-shadow: var(--shadow-hover);
}

/* ─── Table ─── */
.problems-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    margin-top: 32px;
}

.problems-table thead {
    background: linear-gradient(135deg, var(--color-espresso) 0%, #4A3020 100%);
}

.problems-table th {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-cream);
    text-align: left;
    padding: 18px 24px;
    letter-spacing: 0.02em;
}

.problems-table th:first-child {
    border-radius: var(--radius-lg) 0 0 0;
}

.problems-table th:last-child {
    border-radius: 0 var(--radius-lg) 0 0;
}

.problems-table td {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

.problems-table tr:last-child td {
    border-bottom: none;
}

.problems-table tr:last-child td:first-child {
    border-radius: 0 0 0 var(--radius-lg);
}

.problems-table tr:last-child td:last-child {
    border-radius: 0 0 var(--radius-lg) 0;
}

.problems-table tbody tr {
    transition: var(--transition-fast);
}

.problems-table tbody tr:hover {
    background: var(--color-foam);
}

.problems-table .title {
    font-weight: 500;
}

.problems-table .title a {
    color: var(--color-espresso);
    display: block;
    position: relative;
    padding-right: 20px;
}

.problems-table .title a::after {
    content: '→';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: var(--transition-fast);
    color: var(--color-accent);
}

.problems-table tbody tr:hover .title a::after {
    opacity: 1;
    right: -4px;
}

.problems-table .title a:hover {
    color: var(--color-accent);
}

.problems-table .impact {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ─── Sections ─── */
section {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(229, 221, 211, 0.5);
    transition: var(--transition-smooth);
}

section:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

/* ─── Lists ─── */
ul, ol {
    padding-left: 0;
    list-style: none;
}

section ul li,
section ol li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 12px;
    color: var(--color-text);
    line-height: 1.7;
}

section ul li:last-child,
section ol li:last-child {
    margin-bottom: 0;
}

section ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 6px;
    background: var(--color-cappuccino);
    border-radius: 50%;
}

section ol {
    counter-reset: step-counter;
}

section ol li {
    counter-increment: step-counter;
}

section ol li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-accent);
    line-height: 1.7;
}

/* ─── Photo Gallery ─── */
.photo-gallery {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: nowrap;
    margin-top: 10px;
}

.photo-thumb {
    flex: 1 1 0;
    max-width: 25%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--color-foam);
    border-radius: var(--radius-md);
    padding: 8px;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 1px solid var(--border-color);
}

.photo-thumb:hover {
    transform: scale(1.03) translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.photo-thumb img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

/* ─── Lightbox ─── */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    inset: 0;
    background: rgba(44, 36, 32, 0.92);
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
}

.lightbox.active {
    display: flex;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-img {
    max-width: 90%;
    max-height: 90%;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.lightbox-close {
    position: fixed;
    top: 24px;
    right: 32px;
    color: var(--color-cream);
    font-size: 36px;
    font-weight: 300;
    cursor: pointer;
    z-index: 10000;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: var(--transition-fast);
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* ─── Footer ─── */
footer {
    margin-top: 60px;
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
}

.footnote {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    text-align: center;
    font-style: italic;
}

/* ─── Responsive ─── */
@media (max-width: 1200px) {
    .photo-thumb {
        max-width: 33.3%;
    }
    .beans-container {
        opacity: 0.5;
    }
}

@media (max-width: 800px) {
    .container {
        padding: 40px 24px 60px;
    }
    
    .photo-gallery {
        flex-wrap: wrap;
    }
    
    .photo-thumb {
        max-width: 48%;
    }
    
    section {
        padding: 24px;
    }
    
    .problems-table th,
    .problems-table td {
        padding: 16px 18px;
    }
    
    .beans-container {
        display: none;
    }
}

@media (max-width: 500px) {
    .container {
        padding: 32px 16px 48px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .photo-thumb {
        max-width: 100%;
    }
    
    section {
        padding: 20px;
        border-radius: var(--radius-md);
    }
    
    .problems-table {
        font-size: 0.9rem;
    }
    
    .problems-table th,
    .problems-table td {
        padding: 14px 12px;
    }
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--color-cream);
    border-radius: 10px;
    border: 2px solid var(--color-bg);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-cappuccino);
}
