/* ===========================
   Personal Site
   Modern minimalist twist
   =========================== */

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

html {
    font-size: 17px;
    scroll-behavior: smooth;
    position: relative;
    min-height: 100%;
}

/* CSS Variables */
:root {
    --page-max-width: 1120px;
    --page-padding-x: 40px;
    --col-gap: 56px;

    /* Glassmorphism Variables */
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: 1px solid rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    --backdrop-blur: blur(12px);
    --glass-radius: 24px;
}

/* Общий контейнер */
/* Общий контейнер */
.page-inner {
    max-width: var(--page-max-width);
    margin: 40px auto;
    padding: 40px var(--page-padding-x) 80px;

    /* Glass Effect */
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border: var(--glass-border);
    border-radius: var(--glass-radius);
    box-shadow: var(--glass-shadow);
}

/* Жесткий контейнер для главной страницы */
body.home .page-inner {
    max-width: 1040px;
    margin: 40px auto 80px;
    padding: 40px;
}

/* Skip to main content link (accessibility) */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #2d7d3a;
    color: #fff;
    padding: 0.5rem 1rem;
    text-decoration: none;
    z-index: 100;
    font-weight: 600;
}

.skip-link:focus {
    top: 0;
    color: #fff;
}

/* Development Banner */
.dev-banner {
    background: #fffbf0;
    padding: 4px 0;
    font-size: 12px;
    position: relative;
    z-index: 10;
}

.dev-banner-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 40px;
}

.dev-banner p {
    margin: 0;
    font-weight: 400;
    color: #9a7d4a;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: #0a0a0a;
    /* Minimalist Fog Theme */
    background-color: #f8f9fa;
    background-image:
        radial-gradient(at 0% 0%, rgba(255, 255, 255, 1) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(240, 242, 245, 1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(230, 232, 235, 1) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(245, 247, 250, 1) 0px, transparent 50%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    /* For skip-link positioning */
    overflow-x: hidden;
}

/* Noise Texture Overlay */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    opacity: 0.5;
    pointer-events: none;
    z-index: -1;
}

/* Typography — Editorial Style */
h1,
h2,
h3 {
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.025em;
    color: #0a0a0a;
}

h1 {
    font-size: 1.75rem;
    font-weight: 700;
}

h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: -0.015em;
}

/* H3 в статьях - улучшенная типографика */
body.article .section-content h3 {
    font-size: 1.125rem;
    font-weight: 400;
    /* Убрали жирность для скандинавского стиля */
    margin-top: 2em;
    /* Большой верхний отступ */
    margin-bottom: 0.6em;
    letter-spacing: 0.015em;
    /* Разреженный трекинг */
    color: #2a2a2a;
    line-height: 1.3;
}

p {
    margin-bottom: 1rem;
}

a {
    color: rgba(45, 125, 58, 0.9);
    /* Softer accent color */
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: rgba(45, 125, 58, 1);
}

/* Mobile: softer accent colors */
@media (max-width: 768px) {
    a {
        color: rgba(45, 125, 58, 0.85);
    }

    a:hover {
        color: rgba(45, 125, 58, 1);
    }

    .section-content a {
        color: rgba(45, 125, 58, 0.8);
    }

    .section-content a:hover {
        color: rgba(45, 125, 58, 0.95);
    }
}

strong,
b {
    font-weight: 600;
    color: #0a0a0a;
}

em,
i {
    font-style: italic;
    color: #2a2a2a;
}

ul {
    list-style-position: inside;
    margin-bottom: 1rem;
}

ul li {
    margin-bottom: 0.5rem;
}

/* Clean list without bullets - using proximity principle */
.list-clean {
    margin-top: 0.5rem;
}

.list-clean p {
    margin-bottom: 0.65rem;
    line-height: 1.6;
}

.list-clean p:last-child {
    margin-bottom: 0;
}

/* Color coding for current vs past memberships */
.list-clean p.current {
    color: #0a0a0a;
}

.list-clean p.past {
    color: #666;
}

/* Header — Compact Editorial */
.header {
    border-bottom: none;
    /* Removed border for glass look */
    padding: 0;
    background: transparent;
    /* Transparent to show body background */
    margin-bottom: 20px;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 48px;
}

/* Site header inner - привязка к контейнеру */
.site-header-inner {
    max-width: var(--page-max-width);
    margin: 0 auto;
    padding: 8px var(--page-padding-x);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;

    /* Glass Effect for Header */
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border: var(--glass-border);
    border-radius: 100px;
    /* Pill shape */
    box-shadow: var(--glass-shadow);
    margin-top: 20px;
}

/* Desktop: Compact header aligned with content center */
@media (min-width: 1024px) {
    .header-inner {
        max-width: 1000px;
        min-height: 52px;
    }

    .site-header-inner {
        min-height: 52px;
        padding: 10px var(--page-padding-x);
    }
}

.header-brand {
    display: flex;
    align-items: center;
}

.header-brand-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
}

.header-brand-link:hover {
    opacity: 0.8;
}

/* Mobile: скрыть глаз или сделать маленькой иконкой */
@media (max-width: 768px) {
    .observer-eye {
        display: none;
        /* Убираем глаз на мобилке */
    }

    .header-brand-link {
        gap: 0;
    }

    /* Узкая шапка высотой ±56–64px */
    .header {
        border-bottom: 1px solid #e4ddcc;
        background: #f7f2e7;
    }

    .site-header-inner {
        padding: 12px 20px;
        min-height: 56px;
        max-height: 64px;
    }

    .header-inner {
        padding: 12px 20px;
        min-height: 56px;
        max-height: 64px;
    }

    /* Убрать лишние жирные горизонтальные линии под шапкой */
    .header {
        border-bottom-width: 1px;
    }
}

.site-title {
    font-size: 1.25rem;
    margin: 0;
    letter-spacing: 0.04em;
    color: #0a0a0a;
    font-weight: 500;
    font-family: 'Montserrat', 'Poppins', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    text-transform: uppercase;
    line-height: 1.2;
}

/* Desktop: slightly larger but still compact */
@media (min-width: 1024px) {
    .site-title {
        font-size: 1.3125rem;
    }
}

/* Language Switcher - Light, minimal style */
.lang-switcher {
    display: flex;
    gap: 0.2rem;
    align-items: center;
    justify-content: flex-end;
}

.lang-switcher button {
    padding: 0.25rem 0.45rem;
    font-size: 0.6875rem;
    font-weight: 400;
    color: #999;
    background: transparent;
    border: 0.5px solid rgba(0, 0, 0, 0.12);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Mobile: тонкие текстовые тумблеры */
@media (max-width: 768px) {
    .lang-switcher {
        gap: 0.15rem;
    }

    .lang-switcher button {
        padding: 0.2rem 0.4rem;
        font-size: 0.625rem;
        border: 0.5px solid rgba(0, 0, 0, 0.1);
    }
}

.lang-switcher button:hover {
    color: rgba(45, 125, 58, 0.85);
    border-color: rgba(45, 125, 58, 0.3);
    background: transparent;
}

.lang-switcher button.active {
    color: #2d7d3a;
    border-color: #2d7d3a;
    background: transparent;
    font-weight: 600;
    position: relative;
}

.lang-switcher button.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: #2d7d3a;
    border-radius: 50%;
}

/* Desktop: slightly larger but still minimal */
@media (min-width: 1024px) {
    .lang-switcher button {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
    }
}

.lang-switcher button:focus {
    outline: 2px solid #2d7d3a;
    outline-offset: 2px;
}

/* Observer Eye Symbol */
.observer-eye {
    max-width: 28px;
    opacity: 0.9;
    transition: opacity 0.25s ease;
    flex-shrink: 0;
}

.observer-eye:hover {
    opacity: 1;
}

.observer-eye svg {
    width: 100%;
    height: auto;
    display: block;
}

/* На главной странице глаз можно скрыть или оставить с подписью */
body.home .observer-eye {
    opacity: 0.7;
}

body.home .observer-eye[title]:hover::after {
    content: attr(title);
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    margin-top: 8px;
    z-index: 1000;
}

/* Mobile: скрыть глаз полностью */
@media (max-width: 768px) {
    .observer-eye {
        display: none;
    }
}

/* Layout — Editorial Grid */
.layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 3rem;
    column-gap: 4rem;
}

/* Projects page layout - wider container */
body:not(.home):not(.article) .layout {
    max-width: 1120px;
    padding: 40px 40px 80px;
}

/* HOME layout - одна колонка, сайдбар скрыт */
body.home .home-layout {
    display: block;
    max-width: none;
    padding: 0;
}

/* Скрыть сайдбар на главной странице */
body.home .home-sidebar-hidden {
    display: none;
}

body.home .home-sidebar {
    font-size: 14px;
    line-height: 1.7;
}

/* Разделитель перед Journal */
.journal-divider {
    width: 100%;
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
    margin: 2rem 0 2rem 0;
}

/* Hero для главной - успокоенный, тизер */
body.home .journal-header-block {
    margin-bottom: 24px;
}

/* Уменьшить жирность заголовка Journal для иерархии */
body.home .journal-title {
    font-size: clamp(1.375rem, 2vw, 1.5rem);
    font-weight: 600;
    color: #2d7d3a;
}

body.home .journal-eyebrow {
    font-size: 0.625rem;
    margin-bottom: 0.5rem;
}

body.home .journal-title {
    font-size: 1.5rem;
    line-height: 1.2;
    margin: 0 0 0.5rem 0;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #2d7d3a;
}

body.home .journal-description {
    font-size: 0.9375rem;
    line-height: 1.5;
    color: #666;
    margin: 0 0 16px 0;
    max-width: 100%;
}

/* Список записей только в левой колонке - тизер на главной */
body.home .home-posts {
    grid-column: 1 / 2;
    margin-top: 16px;
}

/* На главной показываем последние записи как тизеры */
body.home .home-posts .journal-entry {
    padding: 0;
    border-bottom: none;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

body.home .home-posts .journal-entry:last-child {
    margin-bottom: 0;
}

body.home .home-posts .journal-entry .entry-date {
    display: none;
    /* Скрываем дату в тизерах */
}

body.home .home-posts .journal-entry h3 {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: -0.01em;
    margin: 0;
    color: #0a0a0a;
    flex: 1;
}

body.home .home-posts .journal-entry h3 a {
    color: #0a0a0a;
    text-decoration: none;
    transition: color 0.15s ease;
}

body.home .home-posts .journal-entry h3 a:hover {
    color: #2d7d3a;
}

body.home .home-posts .journal-entry p {
    display: none;
    /* Скрываем превью в тизерах */
}

body.home .home-posts .journal-entry .entry-image {
    display: none;
    /* Скрываем картинку в тизерах */
}

/* Убираем grid layout для постов на главной */
body.home .journal-news-grid {
    display: block;
    grid-template-columns: none;
    gap: 0;
    margin-bottom: 0;
}

/* ARTICLE layout */
body.article .layout {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(260px, 1fr);
    gap: var(--col-gap);
    align-items: flex-start;
}

body.article .article-main {
    max-width: 720px;
}

body.article .article-sidebar {
    font-size: 14px;
    line-height: 1.7;
}

/* Desktop: Narrower layout for articles */
@media (min-width: 1024px) {
    .layout {
        max-width: 1000px;
    }

    /* Two-column grid for articles: 720px content + sidebar */
    body.article .layout {
        grid-template-columns: minmax(0, 2.2fr) minmax(260px, 1fr);
        gap: var(--col-gap);
        max-width: var(--page-max-width);
        padding: 40px var(--page-padding-x) 80px;
    }

    body.article .article-main {
        max-width: 720px;
    }

    body.home .home-layout {
        max-width: none;
        padding: 0;
    }
}

/* Main Content */
.content {
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
}

/* Desktop: Narrower content column for articles */
@media (min-width: 1024px) {

    /* For article pages, limit content width */
    body.article .layout .content {
        max-width: 720px;
    }

    /* Subtle depth: very light shadow for article content */
    body.article .layout .content {
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
        border-radius: 0 0 8px 8px;
    }
}

/* Personal Sections */
.personal-section {
    margin-bottom: 3rem;
    padding-bottom: 2.5rem;
}

/* Mobile: lighter borders */
@media (max-width: 768px) {
    .personal-section {
        border-bottom: none;
    }

    .journal-entry-full {
        border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
    }

    .journal-page-hero {
        border-bottom: 1px solid rgba(0, 0, 0, 0.12);
    }

    .journal-back-link {
        border-top: 0.5px solid rgba(0, 0, 0, 0.08);
    }

    .article-footer-section {
        border-top: 0.5px solid rgba(0, 0, 0, 0.08);
    }
}

.personal-section.first-section {
    margin-top: 0;
    padding-top: 0.5rem;
}

/* Уменьшить отступ сверху для header-grid */
body.home .personal-section.first-section {
    padding-top: 0;
}

.personal-section:last-child {
    padding-bottom: 0;
}

/* Article meta info - shown above heading on mobile */
.article-meta-mobile {
    display: none;
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
    color: #999;
    line-height: 1.5;
}

.article-meta-mobile p {
    margin-bottom: 0;
    display: inline;
    color: #999;
}

.article-meta-mobile p:first-child::after {
    content: ' • ';
    margin: 0 0.375rem;
    color: #999;
}

.article-meta-mobile p:last-child {
    display: inline;
}

/* Desktop: show meta in sidebar, single line format */
@media (min-width: 1024px) {
    body.article .sidebar-section.article-info-section .sidebar-content p {
        display: inline;
        margin-bottom: 0;
        font-size: 0.8125rem;
        color: #999;
    }

    body.article .sidebar-section.article-info-section .sidebar-content p:first-child::after {
        content: ' • ';
        margin: 0 0.375rem;
        color: #999;
    }
}

.section-heading {
    font-size: 1.375rem;
    margin-bottom: 1.5rem;
    color: #0a0a0a;
    /* Changed from green to black for articles */
    font-weight: 700;
    letter-spacing: -0.022em;
    line-height: 1.15;
}

/* Keep green color for non-article pages */
body:not(.article) .section-heading {
    color: #2d7d3a;
}

/* Mobile: единый стиль секционных заголовков на главной */
@media (max-width: 768px) {
    body.home .section-heading {
        font-size: 1.25rem;
        margin-bottom: 1rem;
        color: #2d7d3a;
        font-weight: 700;
        letter-spacing: -0.02em;
    }

    /* Все секционные заголовки одного стиля (зелёный текст + тонкий штрих) */
    body.home .personal-section .section-heading::before {
        content: '';
        display: block;
        width: 32px;
        height: 2px;
        background: #2d7d3a;
        margin-bottom: 0.5rem;
        border-radius: 1px;
    }

    /* Исключаем первый заголовок (About) от штриха, если нужно */
    body.home .personal-section.first-section .section-heading::before {
        display: none;
    }
}

/* Уменьшить расстояние от заголовка до текста в hero-блоке */
body.home .personal-section.first-section .section-heading {
    margin-bottom: 0.5rem;
    font-size: clamp(1.375rem, 2vw, 1.625rem);
    font-weight: 700;
}

/* Заголовок в header-grid */
.header-grid-left .section-heading {
    margin-bottom: 0.5rem;
}

/* Заголовок Проекты на главной - усиленная иерархия */
body.home #projects .section-heading {
    font-size: clamp(1.5rem, 2.5vw, 1.75rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    letter-spacing: -0.03em;
    color: #0a0a0a;
}

/* Уменьшить расстояние между Om mig и Projekter */
body.home #projects {
    margin-top: 2rem;
    padding-top: 2rem;
}

/* Улучшенный заголовок для страницы проектов */
.personal-section.first-section .section-heading {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.035em;
    margin-bottom: 0.75rem;
    color: #0a0a0a;
    padding-left: 0;
}

/* Подзаголовок для страницы проектов */
.section-subtitle {
    font-size: 1rem;
    line-height: 1.6;
    color: #666;
    margin-bottom: 1.5rem;
    font-weight: 400;
}

/* Desktop: Article title and lead improvements */
@media (min-width: 1024px) {

    /* Main article title (H1 equivalent) - увеличен до 2.2-2.4rem */
    body.article .personal-section.first-section .section-heading {
        font-size: 2.3rem;
        font-weight: 700;
        margin-bottom: 0.3em;
        padding-left: 0;
        color: #0a0a0a;
        line-height: 1.2;
    }

    /* First H2 in article content - make it a subheading */
    body.article .personal-section.first-section .section-content h2:first-of-type {
        font-size: 1.3rem;
        font-weight: 600;
        margin-top: 0.6em;
        margin-bottom: 0.6em;
        padding-top: 0;
        letter-spacing: 0.02em;
        color: #2a2a2a;
        line-height: 1.3;
    }

    /* Other H2 headings in article - скандинавская иерархия с верхним отступом */
    body.article .personal-section.first-section .section-content h2:not(:first-of-type) {
        font-size: 1.3rem;
        font-weight: 400;
        /* Убрали жирность для скандинавского стиля */
        margin-top: 2.2em;
        /* Большой верхний отступ вместо жирности */
        margin-bottom: 0.6em;
        padding-top: 0;
        letter-spacing: 0.02em;
        /* Разреженный трекинг */
        color: #1a1a1a;
        line-height: 1.3;
    }

    /* H3 headings - подзаголовки (используются в статьях) */
    body.article .personal-section.first-section .section-content h3:first-of-type {
        font-size: 1.3rem;
        font-weight: 600;
        margin-top: 0.6em;
        margin-bottom: 0.6em;
        letter-spacing: 0.02em;
        color: #2a2a2a;
        line-height: 1.3;
    }

    /* Other H3 headings - скандинавская иерархия с верхним отступом */
    body.article .personal-section.first-section .section-content h3:not(:first-of-type) {
        font-size: 1.3rem;
        font-weight: 400;
        /* Убрали жирность для скандинавского стиля */
        margin-top: 2.5rem;
        /* 40px между секциями - больше воздуха */
        margin-bottom: 0.6em;
        letter-spacing: 0.02em;
        /* Разреженный трекинг */
        color: #1a1a1a;
        line-height: 1.3;
    }

    /* Visually distinguish lead: larger size, slightly lighter color, больше отступов */
    body.article .personal-section.first-section .section-content p:first-of-type {
        font-size: 1.125rem;
        line-height: 1.8;
        /* Увеличенный line-height для лида */
        color: #555;
        /* Серый на 70-80% черного (#333 → #555) */
        margin-top: 0.6em;
        /* Отступ между заголовком и лидом */
        margin-bottom: 1.2em;
        /* Отступ после лида */
        max-width: 95%;
        /* Slightly narrower than main text */
    }

    /* Add spacing before first paragraph after subheading */
    body.article .personal-section.first-section .section-content h2:first-of-type+p {
        margin-top: 0.75rem;
        /* 12px */
    }

    /* Отступы между параграфами после подзаголовков */
    body.article .personal-section.first-section .section-content h2+p,
    body.article .personal-section.first-section .section-content h3+p {
        margin-top: 1rem;
        /* 16px между подзаголовком и текстом */
    }

}

.section-heading a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.section-heading a:hover {
    opacity: 0.7;
}

.section-content {
    font-size: 0.9375rem;
    line-height: 1.65;
    /* Увеличенный межстрочный интервал для плотного гротеска */
    color: #1a1a1a;
    /* Тёплый чёрный для текста */
    text-align: left;
}

.section-content p {
    margin-bottom: 1rem;
    /* Увеличенный отступ между параграфами */
    line-height: 1.65;
    /* Увеличенный межстрочный интервал */
}

.section-content p:first-of-type {
    font-size: 1rem;
    line-height: 1.65;
    color: #1a1a1a;
}

/* Desktop: Main text typography improvements for articles */
@media (min-width: 1024px) {
    body.article .personal-section.first-section .section-content {
        line-height: 1.65;
        /* Увеличенный межстрочный интервал для читаемости */
        text-align: left;
        /* Ensure left alignment, no justify */
        max-width: 640px;
        /* Оптимальная ширина колонки (60-75 знаков) */
    }

    /* Paragraph spacing - используем кратность базовой сетки (8px) */
    body.article .personal-section.first-section .section-content p {
        margin-bottom: 1rem;
        /* 16px - шаг базовой сетки */
        line-height: 1.65;
        /* Увеличенный межстрочный интервал */
    }

    /* Exclude lead from equal spacing (already styled above) */
    body.article .personal-section.first-section .section-content p:first-of-type {
        margin-bottom: 1.2em;
        /* Already set above for lead */
    }

    /* Отступы между секциями - 32-40px */
    body.article .personal-section.first-section .section-content h2+p,
    body.article .personal-section.first-section .section-content h3+p {
        margin-top: 1rem;
        /* 16px между подзаголовком и текстом */
    }
}

/* Mobile: improved typography for article content */
@media (max-width: 768px) {

    /* Article container - ограничиваем ширину для читаемости (18-22 слова в строке) */
    body.article .layout .content,
    body.article .personal-section.first-section {
        max-width: 640px;
        margin: 0 auto;
        padding: 16px 20px 40px;
    }

    body.article .section-content {
        max-width: 100%;
        padding-left: 0;
        padding-right: 0;
        line-height: 1.7;
        font-size: 16px;
        text-align: left;
        /* Не использовать full-justify на мобилке */
    }

    body.article .section-heading {
        font-size: 24px;
        margin-bottom: 8px;
    }

    body.article .article-meta-mobile {
        font-size: 12px;
        color: #9b9384;
        margin-bottom: 18px;
    }

    body.article .section-content p+p {
        margin-top: 10px;
    }

    body.article .section-content p {
        margin-bottom: 0.875rem;
        /* 14px - consistent spacing */
    }

    body.article .section-content p+p {
        margin-top: 0;
    }

    /* Article heading */
    body.article .section-heading {
        font-size: 24px;
        margin-bottom: 0.75rem;
        /* Reduced */
    }

    /* First H3 in article - make it a subheading */
    body.article .section-content h3:first-of-type {
        font-size: 1.125rem;
        font-weight: 600;
        margin-top: 0.75rem;
        /* 12px */
        margin-bottom: 0.875rem;
        padding-top: 0;
        letter-spacing: -0.01em;
        color: #2a2a2a;
    }

    /* Other H3 headings in article - скандинавская иерархия */
    body.article .section-content h3:not(:first-of-type) {
        font-size: 1.125rem;
        font-weight: 400;
        margin-top: 2em;
        margin-bottom: 0.6em;
        letter-spacing: 0.015em;
        color: #2a2a2a;
    }

    /* Article meta */
    body.article .article-meta-mobile {
        font-size: 0.75rem;
        color: #999;
        margin-bottom: 0.75rem;
    }

    /* Add spacing after subheading before first paragraph */
    body.article .section-content h3:first-of-type+p {
        margin-top: 0.5rem;
        /* 8px */
    }

    /* Отступы между параграфами после подзаголовков на мобильных */
    body.article .section-content h3+p {
        margin-top: 1rem;
        /* 16px между подзаголовком и текстом */
    }
}

@media (max-width: 480px) {
    .section-content {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .section-content p {
        margin-bottom: 0.75rem;
        /* ~12px */
    }

    .section-content h2:first-of-type+p {
        margin-top: 0.5rem;
        /* ~8px */
    }
}

.section-content ul {
    margin-top: 0.5rem;
}

.section-content ul li {
    margin-bottom: 0.4rem;
    line-height: 1.5;
}

/* Header Grid - новая структура для главной страницы */
.header-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1.6fr) 1.2fr;
    column-gap: 40px;
    align-items: start;
    margin-top: 0;
}

.header-grid-left {
    display: grid;
    grid-template-columns: 136px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.header-grid-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-left: 24px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    padding-top: 0;
    align-self: start;
}

/* About Photo - уменьшен до 80-85% */
.about-photo {
    width: 136px;
    height: 136px;
    border-radius: 24px;
    overflow: hidden;
    flex-shrink: 0;
}

.about-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    display: block;
}

/* About Content */
.about-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.about-subtitle {
    font-size: clamp(0.875rem, 1.2vw, 1rem);
    color: #666;
    font-weight: 400;
    margin: -8px 0 0 0;
    line-height: 1.5;
}

.about-intro {
    font-size: clamp(1rem, 1.5vw, 1.125rem);
    line-height: 1.7;
}

/* Улучшенная типографика для описания Om mig */
.header-grid-left .about-intro p {
    line-height: 1.7;
    color: #1a1a1a;
    margin-bottom: 1.25em;
}

/* Первое предложение абзаца - semi-bold (используем span в HTML) */
.header-grid-left .about-intro p .first-sentence {
    font-weight: 600;
}

.about-intro p {
    margin: 0;
}

.about-intro p:last-child {
    margin-bottom: 0;
}

/* Mobile Sidebar Section - скрыта по умолчанию (показывается только на мобильных) */
.mobile-sidebar-section {
    display: none;
}

.mobile-sidebar-container {
    max-width: var(--page-max-width);
    margin: 0 auto;
    padding: 0 var(--page-padding-x);
}

/* Header Contacts, Work, Reading, Projects, Notes */
.header-contacts,
.header-work,
.header-reading,
.header-projects,
.header-notes {
    font-size: 0.75rem;
}

.header-notes .sidebar-content {
    font-size: 0.8125rem;
    line-height: 1.6;
    color: #666;
}

.header-notes .sidebar-content p {
    margin-bottom: 0.75rem;
    font-size: 0.8125rem;
}

.header-notes .sidebar-content p:last-child {
    margin-bottom: 0;
}

/* Обратная совместимость для других страниц */
.about-hero {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 24px;
    align-items: center;
    margin-bottom: 32px;
}

/* Обратная совместимость для других страниц */
.about-with-photo {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.about-text {
    flex: 1;
}

.about-text p {
    font-size: 0.9375rem;
    line-height: 1.6;
}

.about-links {
    margin-top: 24px;
    margin-bottom: 40px;
    font-size: 0.8125rem;
    color: #666;
}

.about-links a {
    color: #2d7d3a;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

.about-links a:hover {
    color: #1f5a28;
}

/* Projects List — Clean Editorial */
.projects {
    margin-top: 56px;
}

.projects-list {
    margin-top: 1rem;
}

.project-item {
    padding: 20px 0;
    border-top: 1px solid #e4e4e4;
}

.project-item:first-child {
    border-top: none;
    padding-top: 0;
}

.project-item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.5rem;
    gap: 1rem;
}

.project-title {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 1.125rem;
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.3;
    flex: 1;
}

.project-item h3 {
    font-size: 1.125rem;
    margin: 0;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.3;
    flex: 1;
}

.project-item h3 a {
    color: #0a0a0a;
    transition: color 0.15s ease;
    display: block;
    text-decoration: none;
}

.project-item h3 a:hover {
    color: #2d7d3a;
}

.project-meta {
    font-size: 0.8125rem;
    /* 13px */
    color: #999;
    /* Лёгкий серый для метадаты */
    font-weight: 400;
    margin-bottom: 0.6em;
    /* Отступ перед лидом */
    line-height: 1.5;
}

.project-years {
    font-size: 0.8125rem;
    color: #888;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.project-item>p {
    color: #3a3a3a;
    font-size: 0.9375rem;
    line-height: 1.6;
    margin: 0;
    margin-top: 0.5rem;
}

.projects-more {
    margin-top: 2rem;
    padding-top: 2rem;
}

.projects-more-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #2d7d3a;
    text-decoration: none;
    transition: color 0.15s ease, gap 0.15s ease;
}

.projects-more-link::after {
    content: ' →';
    font-size: 1em;
}

.projects-more-link:hover {
    color: #1f5a28;
    gap: 0.75rem;
}

/* Projects Grid - Clean 3-column layout */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin-top: 24px;
    margin-bottom: 80px;
}

@media (max-width: 900px) {
    .projects-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

.projects-grid .project-item {
    padding: 16px 18px 14px;
    border-radius: 14px;
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
    border: none;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.projects-grid .project-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* Заголовок: максимум 2 строки */
.projects-grid .project-item h3 {
    font-weight: 600;
    font-size: 16px;
    line-height: 1.3;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.projects-grid .project-item h3 a {
    color: #0a0a0a;
    text-decoration: none;
    transition: color 0.15s ease;
}

.projects-grid .project-item h3 a:hover {
    color: #2d7d3a;
}

/* Описание: максимум 3 строки */
.project-description {
    font-size: 14px;
    line-height: 1.5;
    color: #444;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Годы / статус */
.projects-grid .project-years {
    display: block;
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: auto;
    font-weight: 400;
}

/* Проекты с изображениями */
.project-item-with-image {
    padding: 0 !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 14px;
    border-radius: 14px;
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.project-item-with-image:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.project-image-wrapper {
    width: 100%;
    height: 300px;
    overflow: hidden;
    position: relative;
    background: #f5f5f5;
    border-radius: 14px 14px 0 0;
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: grayscale(15%) contrast(1.03);
    display: block;
}

.project-image-bottom {
    object-position: center bottom;
}

.project-content {
    padding: 16px 18px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.project-item-with-image .project-years {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: auto;
    font-weight: 400;
    margin-bottom: 0;
}

.project-item-with-image h3 {
    font-weight: 600;
    font-size: 16px;
    line-height: 1.3;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-item-with-image .project-description {
    font-size: 14px;
    line-height: 1.5;
    color: #444;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Internet Finds */
.finds-list {
    margin-top: 1.5rem;
}

.find-item {
    padding: 1.5rem 0;
    border-bottom: 1px solid #e8e8e8;
}

.find-item:first-child {
    padding-top: 0.5rem;
}

.find-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.find-item h3 {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.find-item h3 a {
    color: #0a0a0a;
    transition: color 0.15s ease;
}

.find-item h3 a:hover {
    color: #2d7d3a;
}

.find-url {
    font-size: 0.8125rem;
    color: #888;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.find-item>p:last-child {
    color: #3a3a3a;
    font-size: 0.9375rem;
    line-height: 1.6;
    margin: 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.5rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn.primary {
    background: #0a0a0a;
    color: #fff;
}

.btn.primary:hover {
    background: #2d7d3a;
}

/* Journal — Modern News Layout */
.journal-section {
    padding: 3rem 0 2.5rem;
}

/* Увеличить отступ перед блоком журнала на главной */
body.home .journal-section {
    margin-top: 2.5rem;
    padding-top: 0;
}

/* Header Block - Typography Hierarchy */
.journal-header-block {
    margin-bottom: 2.5rem;
    max-width: 680px;
}

.journal-eyebrow {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #d46a1f;
    margin-bottom: 0.75rem;
}

.journal-eyebrow:empty {
    display: block;
    width: 48px;
    height: 3px;
    background: #d46a1f;
    margin-bottom: 0.75rem;
    border-radius: 2px;
}

.journal-title {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.035em;
    color: #0a0a0a;
    margin: 0 0 1rem 0;
}

.journal-description {
    font-size: 1.0625rem;
    line-height: 1.6;
    color: #3a3a3a;
    margin: 0;
}

/* News Grid - Adaptive Layout */
.journal-news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2.5rem;
}

/* На главной используем home-posts вместо journal-news-grid */
body.home #journal-entries-container {
    display: block;
}

/* Individual News Card */
.journal-news-grid .journal-entry {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0;
    border: none;
    background: transparent;
    transition: transform 0.2s ease;
}

.journal-news-grid .journal-entry:hover {
    transform: translateY(-2px);
}

/* Date - Small & Subtle */
.journal-news-grid .entry-date {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #999;
    margin: 0;
}

/* Title - Strong Hierarchy */
.journal-news-grid .journal-entry h3 {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
    margin: 0;
}

.journal-news-grid .journal-entry h3 a {
    color: #0a0a0a;
    text-decoration: none;
    transition: color 0.15s ease;
}

.journal-news-grid .journal-entry h3 a:hover {
    color: #2d7d3a;
}

/* Excerpt - Readable Body Text */
.journal-news-grid .journal-entry p {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #4a4a4a;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Entry Image */
.journal-news-grid .journal-entry .entry-image {
    display: none;
    /* Hide by default for smaller entries */
    filter: grayscale(100%) contrast(1.05);
    transition: filter 0.3s ease;
}

/* Make all article images black and white on homepage */
.journal-news-grid .entry-image {
    filter: grayscale(100%) contrast(1.05) !important;
}

.journal-news-grid .entry-image:hover {
    filter: grayscale(100%) contrast(1.1) !important;
}

/* Footer Block - Call to Action */
.journal-footer-block {
    padding-top: 2rem;
}

.journal-cta-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 10px 18px;
    background: transparent;
    color: #1e7b3b;
    text-decoration: none;
    border-radius: 999px;
    border: 1px solid #1e7b3b;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
}

.journal-cta-link:hover {
    background: rgba(30, 123, 59, 0.08);
    color: #1e7b3b;
    border-color: #1e7b3b;
}

/* Mobile: outline-кнопка уже применена выше, но убедимся что стиль правильный */
@media (max-width: 768px) {
    .journal-cta-link {
        display: inline-flex;
        padding: 10px 18px;
        border-radius: 999px;
        border: 1px solid #1e7b3b;
        color: #1e7b3b;
        font-size: 14px;
        background: transparent;
    }
}

/* Responsive Adjustments */
@media (min-width: 768px) and (max-width: 1023px) {
    .journal-news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem 1.5rem;
    }
}

@media (min-width: 1024px) {
    .journal-news-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2.5rem 2rem;
    }

    /* Не применяем к главной странице */
    body.home .journal-news-grid {
        display: block;
        grid-template-columns: none;
        gap: 0;
    }

    .journal-news-grid .journal-entry:first-child {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 400px 1fr;
        grid-template-rows: auto auto 1fr;
        gap: 1rem 2rem;
        padding-bottom: 2rem;
        border-bottom: 1px solid #e8e8e8;
        margin-bottom: 0.5rem;
    }

    /* Не применяем к главной странице */
    body.home .journal-news-grid .journal-entry:first-child {
        grid-column: auto;
        display: block;
        grid-template-columns: none;
        grid-template-rows: none;
        gap: 0;
    }

    .journal-news-grid .journal-entry:first-child .entry-date {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .journal-news-grid .journal-entry:first-child .entry-image {
        display: block;
        width: 100%;
        height: auto;
        grid-column: 1;
        grid-row: 2 / 4;
        border-radius: 4px;
        object-fit: cover;
        filter: grayscale(100%) contrast(1.05);
    }

    .journal-news-grid .journal-entry:first-child .entry-image:hover {
        filter: grayscale(100%) contrast(1.1);
    }

    .journal-news-grid .journal-entry:first-child h3 {
        font-size: 1.75rem;
        line-height: 1.2;
        grid-column: 2;
        grid-row: 2;
    }

    .journal-news-grid .journal-entry:first-child p {
        grid-column: 2;
        grid-row: 3;
        -webkit-line-clamp: 4;
        line-clamp: 4;
        font-size: 1rem;
        align-self: start;
    }
}

/* ===========================
   Journal Page - Unique Editorial Layout
   =========================== */

/* Journal Page Hero Section */
.journal-page-hero {
    margin-bottom: 4rem;
    padding-bottom: 3rem;
    border-bottom: 2px solid #0a0a0a;
    position: sticky;
    top: 0;
    background: radial-gradient(circle at top, #fdf8f1 0%, #fff 55%, #f7faf3 100%);
    z-index: 10;
    padding-top: 2rem;
    margin-top: -2rem;
}


.journal-hero-content {
    max-width: 720px;
}

.journal-hero-eyebrow {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #d46a1f;
    margin-bottom: 1rem;
    display: block;
}

.journal-hero-eyebrow:empty {
    display: block;
    width: 56px;
    height: 4px;
    background: #d46a1f;
    margin-bottom: 1rem;
    border-radius: 2px;
}

.journal-hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.04em;
    color: #0a0a0a;
    margin: 0 0 1.5rem 0;
}

.journal-hero-description {
    font-size: 1.1875rem;
    line-height: 1.65;
    color: #2a2a2a;
    margin: 0;
    max-width: 600px;
}

/* Journal Entries Section */
.journal-entries-section {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 4rem;
}

/* Full Journal Entry */
.journal-entry-full {
    position: relative;
    padding: 2.5rem;
    margin-bottom: 2rem;
    background: #fbfbf8;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.3s ease;
}

.journal-entry-full:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.journal-entry-full:last-child {
    margin-bottom: 0;
}

/* Entry Header - Date + Title */
.journal-entry-header {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    padding-left: 16px;
    border-left: 1px solid #e7ece7;
}

.journal-entry-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    order: 1;
}

.journal-entry-date {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #7A857E;
}

.journal-entry-reading-time {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #7A857E;
}

.journal-entry-title {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.03em;
    margin: 0;
    order: 2;
}

.journal-entry-title a {
    color: #0a0a0a;
    text-decoration: none;
    transition: color 0.2s ease, border-bottom 0.2s ease;
    display: inline-block;
    padding-bottom: 2px;
    border-bottom: 1px solid transparent;
}

.journal-entry-title a:hover {
    color: #2d7d3a;
    border-bottom-color: #2d7d3a;
}

/* Entry Body - Image + Content */
.journal-entry-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

/* Entry with Image - Two Column Layout */
/* Fallback for browsers without :has() support */
.journal-entry-image-wrapper+.journal-entry-content {
    max-width: 640px;
}

.journal-entry-full:has(.journal-entry-image-wrapper) .journal-entry-body {
    grid-template-columns: 1fr;
}

/* Alternating layout: even entries have image on right, odd on left */
.journal-entry-full:nth-child(even):has(.journal-entry-image-wrapper) .journal-entry-body {
    grid-template-columns: 1fr;
}

.journal-entry-full:nth-child(odd):has(.journal-entry-image-wrapper) .journal-entry-body {
    grid-template-columns: 1fr;
}

@media (min-width: 900px) {
    .journal-entry-full:has(.journal-entry-image-wrapper) .journal-entry-body {
        grid-template-columns: 320px 1fr;
        gap: 3rem;
    }

    /* Even entries: image on right */
    .journal-entry-full:nth-child(even):has(.journal-entry-image-wrapper) .journal-entry-body {
        grid-template-columns: 1fr 320px;
    }

    .journal-entry-full:nth-child(even):has(.journal-entry-image-wrapper) .journal-entry-image-wrapper {
        order: 2;
    }

    .journal-entry-full:nth-child(even):has(.journal-entry-image-wrapper) .journal-entry-content {
        order: 1;
    }
}

@media (min-width: 1024px) {
    .journal-entry-full:has(.journal-entry-image-wrapper) .journal-entry-body {
        grid-template-columns: 400px 1fr;
        gap: 4rem;
    }

    .journal-entry-full:nth-child(even):has(.journal-entry-image-wrapper) .journal-entry-body {
        grid-template-columns: 1fr 400px;
    }
}

/* Entry Image */
.journal-entry-image-wrapper {
    order: 1;
    width: 100%;
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
    border-radius: 4px;
    aspect-ratio: 16 / 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.journal-entry-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    filter: grayscale(20%) contrast(1.05);
    transition: transform 0.4s ease, filter 0.4s ease, opacity 0.4s ease;
    opacity: 1;
}

/* Mobile: Show full images without cropping */
@media (max-width: 768px) {
    .journal-entry-image-wrapper {
        aspect-ratio: unset;
        height: auto;
        overflow: visible;
    }

    .journal-entry-image {
        width: 100%;
        height: auto;
        object-fit: contain;
    }
}

.journal-entry-image-wrapper:hover .journal-entry-image {
    transform: scale(1.02);
    filter: grayscale(0%) contrast(1.1);
    opacity: 0.95;
}

/* Black and white image */
.image-bw {
    filter: grayscale(100%) !important;
}

.journal-entry-image-wrapper:hover .image-bw {
    filter: grayscale(100%) contrast(1.1) !important;
}

/* Base styles for article images */
.article-image {
    width: 100%;
    max-width: 800px;
    margin: 2rem auto;
    display: block;
}

.article-image img {
    width: 100%;
    height: auto;
    display: block;
}

.image-caption {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #666;
    line-height: 1.5;
    text-align: left;
}

.image-caption a {
    color: #666;
    text-decoration: underline;
}

.image-caption a:hover {
    color: #2d7d3a;
}

.image-source {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #999;
}

.article-image .image-bw {
    filter: grayscale(100%) contrast(1.05) !important;
}

.article-image:hover .image-bw {
    filter: grayscale(100%) contrast(1.1) !important;
}

/* Mobile: Article image adjustments */
@media (max-width: 768px) {
    body.article .article-image {
        margin: 1.5rem auto;
        width: 100%;
        max-width: 100%;
    }

    body.article .article-image img {
        width: 100%;
        height: auto;
        display: block;
    }

    body.article .image-caption {
        font-size: 0.8rem;
        margin-top: 0.75rem;
    }

    body.article .image-source {
        margin-top: 0.25rem;
    }
}

/* Desktop: Article image improvements */
@media (min-width: 1024px) {

    /* Limit image width to text column width */
    body.article .personal-section.first-section .article-image {
        max-width: 720px;
        margin: 3rem auto;
    }

    /* Add subtle styling: rounded corners, thin border, equal margins */
    body.article .personal-section.first-section .article-image img {
        border-radius: 6px;
        border: 1px solid rgba(0, 0, 0, 0.08);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    }
}

/* Entry Content */
.journal-entry-content {
    order: 2;
    display: flex;
    flex-direction: column;
}

.journal-entry-lead {
    font-size: 1.125rem;
    line-height: 1.7em;
    color: #2a2a2a;
    margin: 0;
    font-weight: 400;
    max-width: 640px;
}

/* Entry without Image - Full Width */
.journal-entry-full:not(:has(.journal-entry-image-wrapper)) .journal-entry-content {
    max-width: 640px;
}

/* Back Link */
.journal-back-link {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #e8e8e8;
}

.journal-back-link a {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #2d7d3a;
    text-decoration: none;
    transition: color 0.15s ease, gap 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.journal-back-link a:hover {
    color: #1f5a28;
    gap: 0.75rem;
}

/* Responsive Adjustments for Journal Page */
@media (max-width: 900px) {
    .journal-entry-full:has(.journal-entry-image-wrapper) .journal-entry-body {
        grid-template-columns: 1fr !important;
    }

    .journal-entry-full:nth-child(even):has(.journal-entry-image-wrapper) .journal-entry-image-wrapper {
        order: 1 !important;
    }

    .journal-entry-full:nth-child(even):has(.journal-entry-image-wrapper) .journal-entry-content {
        order: 2 !important;
    }

    /* Keep asymmetric margins for journal feel */
    .journal-entry-full {
        padding-left: 1.5rem;
        padding-right: 1rem;
    }
}

@media (max-width: 768px) {
    .journal-page-hero {
        position: relative;
        margin-bottom: 3rem;
        padding-bottom: 2rem;
        border-bottom: 1px solid rgba(0, 0, 0, 0.12);
        padding-top: 0;
        margin-top: 0;
    }

    /* Тонкий цветной штрих + Dmitri Journal + 1 строка описания */
    .journal-hero-eyebrow {
        display: block;
        width: 32px;
        height: 2px;
        background: #d46a1f;
        margin-bottom: 0.75rem;
        border-radius: 1px;
    }

    .journal-hero-eyebrow:empty {
        display: block;
        width: 32px;
        height: 2px;
        background: #d46a1f;
        margin-bottom: 0.75rem;
        border-radius: 1px;
    }

    .journal-hero-title {
        margin-bottom: 0.75rem;
        font-size: 1.75rem;
    }

    .journal-hero-description {
        font-size: 0.9375rem;
        line-height: 1.5;
        max-height: 3em;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .journal-entries-section {
        gap: 0;
        margin-bottom: 3rem;
    }

    .journal-entry-full {
        padding: 1.5rem 1rem 1.5rem 1.25rem;
        margin-bottom: 1.5rem;
    }

    .journal-entry-header {
        margin-bottom: 1.5rem;
        gap: 0.75rem;
        padding-left: 12px;
    }

    .journal-entry-title {
        font-size: 1.625rem;
    }

    .journal-entry-body {
        gap: 1.5rem;
    }

    .journal-entry-lead {
        font-size: 1.0625rem;
        line-height: 1.7;
    }

    .journal-back-link {
        margin-top: 3rem;
        padding-top: 1.5rem;
        border-top: 0.5px solid rgba(0, 0, 0, 0.08);
    }
}

@media (max-width: 480px) {
    .journal-page-hero {
        margin-bottom: 2.5rem;
        padding-bottom: 1.5rem;
        border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
    }

    .journal-hero-title {
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    .journal-hero-description {
        font-size: 1rem;
    }

    .journal-entries-section {
        gap: 0;
        margin-bottom: 2.5rem;
    }

    .journal-entry-full {
        padding: 1.25rem 0.875rem 1.25rem 1rem;
        margin-bottom: 1.25rem;
    }

    .journal-entry-header {
        margin-bottom: 1.25rem;
        gap: 0.625rem;
        padding-left: 10px;
    }

    .journal-entry-meta {
        gap: 0.75rem;
    }

    .journal-entry-date {
        font-size: 0.6875rem;
    }

    .journal-entry-reading-time {
        font-size: 0.6875rem;
    }

    .journal-entry-title {
        font-size: 1.5rem;
        line-height: 1.25;
    }

    .journal-entry-body {
        gap: 1.25rem;
    }

    .journal-entry-lead {
        font-size: 1rem;
        line-height: 1.65;
    }

    .journal-back-link {
        margin-top: 2.5rem;
        padding-top: 1.25rem;
        border-top: 0.5px solid rgba(0, 0, 0, 0.08);
    }
}

/* Sidebar — Compact */
.sidebar {
    font-size: 0.75rem;
}

.sidebar-section {
    margin-bottom: 24px;
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.sidebar-title {
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #bbb;
    margin-bottom: 6px;
    font-weight: 600;
}

.sidebar-subtitle {
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #bbb;
    margin-top: 8px;
    margin-bottom: 6px;
    font-weight: 600;
}

.sidebar-heading {
    font-size: 0.8125rem;
    font-weight: 700;
    margin-bottom: 0.625rem;
    color: #0a0a0a;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-list a {
    display: block;
    margin-bottom: 4px;
    color: #256530;
    text-decoration: none;
    font-weight: 400;
    transition: color 0.2s ease;
    font-size: 0.875rem;
    line-height: 1.5;
}

.sidebar-list a:hover {
    color: #1a4d1f;
    font-weight: 500;
}

.sidebar-content p {
    margin-bottom: 0.5rem;
    line-height: 1.5;
    color: #2a2a2a;
}

.sidebar-content a {
    color: #256530;
    font-weight: 500;
    transition: color 0.2s ease;
}

.sidebar-content a:hover {
    color: #1a4d1f;
    font-weight: 600;
}

/* Desktop: Sidebar alignment and typography improvements for articles */
@media (min-width: 1024px) {

    /* Align sidebar top with bottom of title/lead */
    body.article .layout .sidebar {
        padding-top: calc(2rem + 2rem + 1.5rem);
        /* title height + margin + lead approximate height */
        align-self: start;
    }

    /* Improve sidebar typography: smaller headings, reduced tracking */
    body.article .layout .sidebar-heading {
        font-size: 0.75rem;
        letter-spacing: 0.01em;
        margin-bottom: 0.5rem;
        color: #666;
        /* Softer color */
    }

    /* Consistent line-height for sidebar links */
    body.article .layout .sidebar-content p {
        line-height: 1.5;
        margin-bottom: 0.5rem;
    }

    /* Article meta in sidebar - single line format */
    body.article .sidebar-section.article-info-section .sidebar-content {
        font-size: 0.8125rem;
        color: #999;
    }

    /* Projects page sidebar - align with top, make less prominent */
    body:not(.home):not(.article) .layout .sidebar {
        padding-top: 0;
        align-self: start;
    }

    body:not(.home):not(.article) .layout .sidebar-heading {
        font-size: 0.75rem;
        color: #666;
        letter-spacing: 0.01em;
        margin-bottom: 0.5rem;
    }

    body:not(.home):not(.article) .layout .sidebar-content {
        font-size: 0.8125rem;
    }
}

/* Минимальный футер */
.footer {
    border-top: 1px solid #E6ECE4;
    background: #FAFCF7;
    color: #465147;
    font-size: 14px;
}

.fm-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.fm-left {
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #0a0a0a;
    font-family: 'Montserrat', 'Poppins', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    text-transform: uppercase;
}

.fm-nav {
    display: flex;
    gap: 16px;
    margin-left: auto;
    margin-right: auto;
}

.fm-nav a {
    color: #21703A;
    text-decoration: none;
    transition: text-decoration 0.15s ease;
}

.fm-nav a:hover {
    text-decoration: underline;
}

.fm-right {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.fm-right a {
    color: #21703A;
    text-decoration: none;
    transition: text-decoration 0.15s ease;
}

.fm-right a:hover {
    text-decoration: underline;
}

.fm-right .dot {
    opacity: 0.5;
}

.fm-right small {
    color: #465147;
    font-size: 14px;
}

/* На главной странице футер с обычной шириной */
@media (min-width: 969px) {
    body.home .fm-wrap {
        max-width: 1040px;
    }
}

/* Мобильная версия */
@media (max-width: 800px) {
    .footer {
        font-size: 13px;
    }

    .fm-wrap {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 14px 16px;
    }

    .fm-nav {
        margin: 0;
    }
}

/* Responsive Design */
@media (max-width: 968px) {
    .layout {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        column-gap: 2.5rem;
    }

    body.home .home-layout {
        display: block;
        gap: 2.5rem;
    }

    /* На мобильных header-grid в одну колонку */
    .header-grid {
        grid-template-columns: 1fr;
        column-gap: 0;
        gap: 2rem;
    }

    .header-grid-left {
        grid-template-columns: 120px minmax(0, 1fr);
        gap: 20px;
    }

    .about-photo {
        width: 120px;
        height: 120px;
    }

    /* Скрыть header-grid-right на мобильных в его текущем месте */
    .header-grid-right {
        display: none;
    }

    body.article .layout {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .sidebar {
        border-top: 1px solid #d0d0d0;
        padding-top: 2.5rem;
    }

    .sidebar-section {
        margin-bottom: 24px;
    }

    .sidebar-title {
        font-size: 11px;
        margin-bottom: 6px;
    }

    .sidebar-list {
        gap: 4px;
    }

    .sidebar-list a {
        font-size: 0.875rem;
    }

    /* Hide article info section in sidebar on mobile */
    .sidebar-section.article-info-section {
        display: none;
    }

    /* Show article meta above heading on mobile */
    .article-meta-mobile {
        display: block;
    }

    /* Projects Grid - already handled by main media query */
}

@media (max-width: 768px) {
    html {
        font-size: 16px;
    }

    .header-inner {
        padding: 0 1.25rem;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .lang-switcher {
        order: 3;
        width: 100%;
        justify-content: flex-end;
    }

    .header {
        padding: 0;
        border-bottom: 0.5px solid rgba(0, 0, 0, 0.12);
    }

    .header-inner {
        min-height: 56px;
        padding: 0 1.25rem;
    }

    .site-header-inner {
        min-height: 56px;
        padding: 12px 20px;
    }

    .layout {
        padding: 1.5rem 1.25rem;
        gap: 2rem;
    }

    .site-title {
        font-size: 1.125rem;
        letter-spacing: 0.02em;
    }

    .observer-eye {
        max-width: 32px;
    }

    .section-heading {
        font-size: 1.25rem;
    }

    /* Fix heading hierarchy: make first h2 in section-content a subheading */
    /* Note: Article-specific styles override this */
    .section-content h2:first-of-type {
        font-size: 1.125rem;
        font-weight: 600;
        margin-top: 0.875rem;
        padding-top: 0;
        letter-spacing: -0.015em;
        color: #2a2a2a;
    }

    .personal-section {
        margin-bottom: 2rem;
        padding-bottom: 1.5rem;
    }

    .project-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .project-item h3 {
        font-size: 1.0625rem;
    }

    /* Projects Grid responsive - already handled by main media query */

    .project-image-wrapper {
        height: auto;
        min-height: 250px;
    }

    .project-image {
        height: auto;
        object-fit: contain;
    }

    .project-content {
        padding: 16px 18px 14px;
    }

    /* Header Grid на мобильных */
    .header-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* На мобильных фото и текст снова вертикально */
    .header-grid-left {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Скрыть header-grid-right на мобильных в его текущем месте */
    .header-grid-right {
        display: none;
    }

    /* Скрыть мобильную секцию на мобильных устройствах */
    .mobile-sidebar-section {
        display: none;
    }

    .mobile-sidebar-container {
        max-width: 1040px;
        margin: 0 auto;
        padding: 0 24px;
    }

    .header-grid-right-mobile {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .header-grid-right-mobile .header-contacts,
    .header-grid-right-mobile .header-work,
    .header-grid-right-mobile .header-reading,
    .header-grid-right-mobile .header-projects,
    .header-grid-right-mobile .header-notes {
        font-size: 0.8125rem;
    }

    .header-grid-right-mobile .sidebar-title {
        font-size: 11px;
        letter-spacing: 1px;
        text-transform: uppercase;
        color: #bbb;
        margin-bottom: 8px;
        font-weight: 600;
    }

    .header-grid-right-mobile .sidebar-list {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .header-grid-right-mobile .sidebar-list a {
        display: block;
        color: #256530;
        text-decoration: none;
        font-weight: 400;
        transition: color 0.2s ease;
        font-size: 0.875rem;
        line-height: 1.5;
    }

    .header-grid-right-mobile .sidebar-list a:hover {
        color: #1a4d1f;
        font-weight: 500;
    }

    .header-grid-right-mobile .sidebar-content {
        font-size: 0.8125rem;
        line-height: 1.6;
        color: #666;
    }

    .header-grid-right-mobile .sidebar-content p {
        margin-bottom: 0.75rem;
        font-size: 0.8125rem;
    }

    .header-grid-right-mobile .sidebar-content p:last-child {
        margin-bottom: 0;
    }

    .header-grid-right-mobile .sidebar-content a {
        color: #256530;
        font-weight: 500;
        transition: color 0.2s ease;
    }

    .header-grid-right-mobile .sidebar-content a:hover {
        color: #1a4d1f;
        font-weight: 600;
    }

    .about-photo {
        width: 120px;
        height: 120px;
    }

    /* Футер на мобильных - центрировать */
    body.home .footer {
        padding-left: 1.5rem;
        text-align: center;
    }

    .about-intro {
        font-size: clamp(0.9375rem, 4vw, 1rem);
    }

    /* Уменьшить размер шрифта в контактах на мобильных */
    .header-contacts,
    .header-work,
    .header-reading,
    .header-projects,
    .header-notes {
        font-size: 0.8125rem;
    }

    .header-notes .sidebar-content {
        font-size: 0.8125rem;
    }

    .header-notes .sidebar-content p {
        font-size: 0.8125rem;
    }

    /* Обратная совместимость */
    .about-hero {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-bottom: 24px;
    }

    .about-with-photo {
        flex-direction: column;
        gap: 1rem;
    }

    .about-links {
        margin-top: 16px;
        margin-bottom: 24px;
    }

    /* Journal responsive */
    .journal-section {
        padding: 2rem 0 2rem;
    }

    /* Адаптивные стили для блока журнала на главной */
    body.home .journal-wrapper {
        padding: 24px 20px;
    }

    body.home .journal-title {
        font-size: 20px;
        padding-left: 32px;
    }

    body.home .journal-title::before {
        width: 24px;
    }

    body.home .journal-title::after {
        width: 32px;
    }

    body.home .journal-description {
        font-size: 0.8125rem;
        line-height: 1.5;
    }

    body.home .journal-list-container .journal-entry h3 {
        font-size: 14px;
    }

    body.home .journal-header-block {
        margin-bottom: 20px;
    }

    body.home .journal-footer-block {
        padding-top: 16px;
    }

    .journal-header-block {
        margin-bottom: 2rem;
    }

    .journal-title {
        font-size: 1.75rem;
    }

    .journal-description {
        font-size: 1rem;
    }

    .journal-news-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        margin-bottom: 2rem;
    }

    /* Главная на мобильных */
    body.home .journal-section {
        margin-top: 2rem;
    }

    /* Разделитель перед Journal на мобильных */
    .journal-divider {
        margin: 1.5rem 0;
    }

    /* Обертка блока журнала с фоном и рамкой */
    body.home .journal-wrapper {
        background: #FAFCF9;
        border: 1px solid #E7ECE6;
        border-radius: 12px;
        padding: 32px 24px;
        box-shadow: 0 1px 6px rgba(0, 0, 0, 0.03);
    }

    body.home .journal-header-block {
        margin-bottom: 24px;
    }

    /* Заголовок Dmitri Journal с зеленой чертой перед ним */
    body.home .journal-title {
        font-size: 24px;
        font-weight: 700;
        letter-spacing: 0.01em;
        margin-bottom: 4px;
        position: relative;
        padding-left: 36px;
    }

    body.home .journal-title::before {
        content: "";
        display: inline-block;
        width: 28px;
        height: 2px;
        background: #2d7d3a;
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        vertical-align: middle;
    }

    /* Тонкая зеленая линия под заголовком */
    body.home .journal-title::after {
        content: "";
        display: block;
        width: 40px;
        height: 2px;
        background: #2d7d3a;
        margin-top: 4px;
    }

    /* Подзаголовок курсивом с улучшенной читаемостью */
    body.home .journal-description {
        font-size: 0.875rem;
        margin-bottom: 0;
        line-height: 1.6;
        font-style: italic;
        opacity: 0.8;
        max-height: 3em;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    body.home .home-posts.journal-list-container {
        margin-top: 20px;
    }

    /* Список статей с вертикальной линией слева */
    body.home .journal-list-container {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    body.home .journal-list-container .journal-entry {
        border-left: 2px solid #2d7d3a;
        padding-left: 12px;
        margin-bottom: 0;
        margin-top: 0;
        margin-left: 0;
        display: block;
        transition: border-color 0.3s ease;
    }

    body.home .journal-list-container .journal-entry+.journal-entry {
        margin-top: 6px;
    }

    body.home .journal-list-container .journal-entry:last-child {
        margin-bottom: 0;
    }

    body.home .journal-list-container .journal-entry:hover {
        border-left-color: #1C261C;
    }

    body.home .journal-list-container .journal-entry h3 {
        font-size: 15px;
        font-weight: 500;
        margin: 0;
        line-height: 1.5;
    }

    body.home .journal-list-container .journal-entry h3 a {
        color: #1C261C;
        font-weight: 500;
        text-decoration: none;
        transition: color 0.25s ease, text-decoration 0.25s ease;
    }

    body.home .journal-list-container .journal-entry h3 a:hover {
        text-decoration: underline;
        text-underline-offset: 3px;
        color: #1B4C2A;
    }

    body.home .journal-list-container .journal-entry .entry-image {
        display: none;
    }

    body.home .journal-list-container .journal-entry p {
        display: none;
    }

    body.home .journal-list-container .journal-entry .entry-date {
        display: none;
    }

    body.home .journal-footer-block {
        padding-top: 20px;
        margin-top: 8px;
    }

    /* Кнопка "Читать все записи" - редакторский стиль */
    body.home .journal-cta-link {
        background: transparent;
        border: 1px solid #2d7d3a;
        border-radius: 999px;
        padding: 8px 16px;
        font-weight: 600;
        color: #2d7d3a;
        font-size: 14px;
        text-transform: none;
        transition: all 0.25s ease;
        display: inline-flex;
        align-items: center;
        text-decoration: none;
    }

    body.home .journal-cta-link:hover {
        background: #2d7d3a;
        color: white;
        border-color: #2d7d3a;
    }

    /* Карточки постов на странице журнала - улучшенный стиль для мобилки */
    .journal-entry-full {
        padding: 16px 20px 20px;
        border-bottom: 1px solid #eee2d2;
    }

    .journal-entry-full:last-child {
        border-bottom: none;
    }

    .journal-entry-header {
        margin-bottom: 12px;
    }

    .journal-entry-meta {
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: #9b9384;
        margin-bottom: 4px;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .journal-entry-date {
        font-size: 12px;
        color: #9b9384;
    }

    .journal-entry-reading-time {
        font-size: 12px;
        color: #9b9384;
    }

    /* Разделитель между датой и временем чтения - только если есть время чтения */
    .journal-entry-meta .journal-entry-date:not(:last-child)::after {
        content: ' • ';
        margin: 0 0.25rem;
        color: #9b9384;
    }

    .journal-entry-title {
        font-size: 22px;
        margin: 4px 0 6px;
        line-height: 1.3;
        font-weight: 700;
    }

    .journal-entry-lead {
        font-size: 15px;
        line-height: 1.6;
        color: #3c382f;
        margin-top: 8px;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .journal-entry-image-wrapper {
        margin-top: 10px;
        aspect-ratio: unset;
        height: auto;
    }

    .journal-entry-image {
        width: 100%;
        height: auto;
        object-fit: contain;
        border-radius: 8px;
    }

    /* First entry with image on mobile */
    .journal-news-grid .journal-entry:first-child {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
        gap: 1rem;
    }

    .journal-news-grid .journal-entry:first-child .entry-date {
        grid-column: 1;
        grid-row: 1;
    }

    .journal-news-grid .journal-entry:first-child h3 {
        grid-column: 1;
        grid-row: 2;
        font-size: 1.375rem;
    }

    .journal-news-grid .journal-entry:first-child .entry-image {
        grid-column: 1;
        grid-row: 3;
        filter: grayscale(100%) contrast(1.05);
    }

    .journal-news-grid .journal-entry:first-child .entry-image:hover {
        filter: grayscale(100%) contrast(1.1);
    }

    .journal-news-grid .journal-entry:first-child p {
        grid-column: 1;
        grid-row: 4;
    }
}

@media (max-width: 640px) {
    .journal-news-grid {
        gap: 1.75rem;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 15px;
    }

    .header-inner {
        padding: 0 1rem;
    }

    .header {
        padding: 0;
        border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
    }

    .header-inner {
        min-height: 56px;
        padding: 0 1rem;
    }

    .site-header-inner {
        min-height: 56px;
        padding: 12px 20px;
    }

    .layout {
        padding: 1.25rem 1rem;
        gap: 1.75rem;
    }

    .site-title {
        font-size: 1.0625rem;
        letter-spacing: 0.015em;
    }

    .observer-eye {
        max-width: 28px;
    }

    .section-heading {
        font-size: 1.125rem;
    }

    /* Fix heading hierarchy: make first h2 in section-content a subheading */
    /* Note: Article-specific styles override this */
    .section-content h2:first-of-type {
        font-size: 1rem;
        font-weight: 600;
        margin-top: 0.75rem;
        padding-top: 0;
        letter-spacing: -0.01em;
        color: #3a3a3a;
    }

    .personal-section.first-section .section-heading {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
        padding-left: 0;
    }

    .section-subtitle {
        font-size: 0.9375rem;
        margin-bottom: 1.25rem;
    }

    .project-item {
        padding: 1rem 0;
    }

    .project-item:first-child {
        padding-top: 0.25rem;
    }

    /* Projects Grid на маленьких экранах */
    .projects-grid .project-item {
        padding: 16px 18px 14px;
    }

    .project-image-wrapper {
        height: auto;
        min-height: 200px;
    }

    .project-image {
        height: auto;
        object-fit: contain;
    }

    .project-content {
        padding: 16px 18px 14px;
    }

    .find-item {
        padding: 1.25rem 0;
    }

    .find-item:first-child {
        padding-top: 0.25rem;
    }

    /* Блок журнала на очень маленьких экранах */
    body.home .journal-wrapper {
        padding: 20px 16px;
    }

    body.home .journal-title {
        font-size: 18px;
        padding-left: 28px;
    }

    body.home .journal-title::before {
        width: 20px;
    }

    body.home .journal-title::after {
        width: 28px;
    }

    body.home .journal-description {
        font-size: 0.75rem;
        line-height: 1.5;
    }

    body.home .journal-list-container .journal-entry h3 {
        font-size: 13px;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    /* Journal mobile */
    .journal-title {
        font-size: 1.5rem;
    }

    .journal-description {
        font-size: 0.9375rem;
    }

    .journal-news-grid {
        gap: 1.5rem;
    }

    .journal-cta-link {
        width: 100%;
        justify-content: center;
        padding: 10px 18px;
        font-size: 14px;
    }
}

/* Print Styles */
@media print {
    body {
        font-size: 12pt;
    }

    .header {
        border-bottom: 1px solid #000;
    }

    .footer {
        border-top: 1px solid #000;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    .layout {
        display: block;
    }

    .sidebar {
        margin-top: 2rem;
        page-break-before: always;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    body {
        background: #fff;
        color: #000;
    }

    a {
        color: #1f5a28;
        text-decoration: underline;
    }

    .header,
    .footer {
        border-color: #000;
    }
}

/* Selection color */
::selection {
    background: #d4edda;
    color: #000;
}

::-moz-selection {
    background: #d4edda;
    color: #000;
}

/* ===========================
   Reading Progress Indicator
   =========================== */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: #2d7d3a;
    z-index: 9999;
    transition: width 0.1s ease-out;
    box-shadow: 0 2px 4px rgba(45, 125, 58, 0.3);
}

/* ===========================
   Expandable Content Blocks
   =========================== */
.expandable-trigger {
    display: inline;
    color: #2d7d3a;
    text-decoration: none;
    cursor: pointer;
    border-bottom: 1px dotted #2d7d3a;
    transition: color 0.15s ease, border-color 0.15s ease;
    font-weight: 500;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    padding: 0;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

.expandable-trigger:hover {
    color: #1f5a28;
    border-bottom-color: #1f5a28;
}

.expandable-trigger:focus {
    outline: 2px solid #2d7d3a;
    outline-offset: 2px;
    border-radius: 2px;
}

.expandable-content {
    display: none;
    margin-top: 0.75rem;
    margin-bottom: 1rem;
    padding: 1rem 1.25rem;
    background: #f8f9fa;
    border-left: 3px solid #2d7d3a;
    border-radius: 0 4px 4px 0;
    font-size: 0.9375rem;
    line-height: 1.65;
    color: #2a2a2a;
    animation: expandFadeIn 0.3s ease-out;
}

.expandable-content.expanded {
    display: block;
}

.expandable-trigger.expanded::after {
    content: ' ▲';
    font-size: 0.75em;
    vertical-align: super;
    margin-left: 0.25em;
}

.expandable-trigger:not(.expanded)::after {
    content: ' ▼';
    font-size: 0.75em;
    vertical-align: super;
    margin-left: 0.25em;
}

@keyframes expandFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments for expandable content */
@media (max-width: 768px) {
    .expandable-content {
        padding: 0.875rem 1rem;
        font-size: 0.9375rem;
    }
}

/* Modeling Gallery */
.modeling-project {
    margin-bottom: 4rem;
    padding-top: 1rem;
}

.modeling-project .section-content {
    max-width: none;
}

.modeling-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem 2rem;
    margin-top: 3.5rem;
    margin-bottom: 3rem;
}

.gallery-item {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.gallery-image {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04),
        0 4px 12px rgba(0, 0, 0, 0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    background-color: #fafafa;
}

.gallery-image:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08),
        0 8px 24px rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.1);
}

.gallery-caption {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.8125rem;
    line-height: 1.7;
    color: #4a4a4a;
    letter-spacing: -0.011em;
    font-weight: 400;
    max-width: 42em;
    margin-top: 0.25rem;
    font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.gallery-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    grid-column: 1 / -1;
    margin: 1rem 0;
}

.gallery-pair .gallery-item {
    gap: 0.75rem;
}

.gallery-pair .gallery-caption {
    font-size: 0.75rem;
    color: #5a5a5a;
    line-height: 1.6;
    letter-spacing: -0.005em;
}

@media (max-width: 768px) {
    .modeling-gallery {
        gap: 2rem 1.5rem;
        margin-top: 2.5rem;
    }

    .gallery-pair {
        gap: 1.5rem;
    }
}

@media (max-width: 640px) {
    .modeling-gallery {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .gallery-pair {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    display: block;
}

.lightbox-close {
    position: absolute;
    top: -2.5rem;
    right: 0;
    color: #fff;
    font-size: 2.5rem;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    transition: opacity 0.2s ease;
}

.lightbox-close:hover {
    opacity: 0.7;
}

/* Modeling Hero Section - Two Column Layout with Unique Typography */
.modeling-hero {
    max-width: 1400px;
    margin: 0 auto;
    padding: 6rem 3rem 8rem;
    background: linear-gradient(to bottom, #fcfbf9, #ffffff);
}

.modeling-hero-content {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 6rem;
    align-items: center;
}

.modeling-hero-text {
    padding-right: 2rem;
}

.modeling-hero-title {
    font-size: clamp(2.75rem, 5vw, 4.5rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: #161a0d;
    margin: 0 0 2.5rem 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.modeling-hero-intro {
    font-size: clamp(1.125rem, 2vw, 1.375rem);
    line-height: 1.65;
    color: #3d3935;
    margin-bottom: 2rem;
    max-width: 42rem;
}

.modeling-hero-intro p {
    margin: 0;
}

.modeling-hero-video {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Add spacing after hero section */
.modeling-hero+.layout {
    margin-top: 3rem;
}

/* Modeling Videos - Artistic Placement */
.modeling-video-artistic {
    position: relative;
    width: 100%;
    max-width: 360px;
    aspect-ratio: 9 / 16;
    border-radius: 1rem;
    overflow: hidden;
    background: #0a0a0a;
    box-shadow: 0 20px 60px rgba(22, 26, 13, 0.15),
        0 8px 24px rgba(22, 26, 13, 0.1);
}

.modeling-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.8s ease;
    filter: saturate(0.95) contrast(1.05);
    background: #000;
}

.modeling-video.is-visible {
    opacity: 1;
}

/* Responsive Design for Modeling Hero */
@media (max-width: 1024px) {
    .modeling-hero {
        padding: 4rem 2.5rem 5rem;
    }

    .modeling-hero-content {
        gap: 4rem;
    }
}

@media (max-width: 768px) {
    .modeling-hero {
        padding: 3rem 2rem 4rem;
    }

    .modeling-hero-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .modeling-hero-text {
        padding-right: 0;
        text-align: center;
    }

    .modeling-hero-title {
        margin-bottom: 2rem;
    }

    .modeling-hero-intro {
        max-width: 100%;
    }

    .modeling-video-artistic {
        max-width: 320px;
    }
}

@media (max-width: 480px) {
    .modeling-hero {
        padding: 2rem 1.25rem 3rem;
    }

    .modeling-hero-content {
        gap: 2.5rem;
    }

    .modeling-video-artistic {
        max-width: 280px;
    }
}

/* ===========================
   Worldview Game - Card Swipe
   =========================== */

/* Сетка страницы */
.verdenssyn-layout {
    max-width: 1200px;
    margin: 40px auto 80px;
    padding: 0 24px;
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(260px, 1fr);
    column-gap: 48px;
    align-items: flex-start;
}

.verdenssyn-main {
    max-width: 760px;
}

@media (max-width: 900px) {
    .verdenssyn-layout {
        grid-template-columns: 1fr;
        row-gap: 32px;
    }
}

/* Заголовок страницы */
.verdenssyn-main h1 {
    font-size: clamp(22px, 4vw, 32px);
    font-weight: 700;
    margin-bottom: 1rem;
    color: #0a0a0a;
}

.verdenssyn-main p {
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 1rem;
    max-width: 42rem;
}

/* Score Display */
.worldview-score {
    margin: 16px 0 8px;
    text-align: center;
    font-size: 12px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #777;
}

.worldview-score span:first-of-type {
    margin-right: 0.5rem;
}

.worldview-score #matches {
    font-weight: 700;
    color: #2d7d3a;
    font-size: 14px;
}

/* Стек карточек: фиксированная зона */
.worldview-stack {
    position: relative;
    margin: 32px 0 24px;
    height: clamp(220px, 40vh, 320px);
    width: 100%;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
    overflow: hidden;
    /* важно: спрятать улетающие карты */
}

/* Одна или несколько карточек внутри */
.worldview-card {
    position: absolute;
    inset: 0;
    margin: 0 auto;
    max-width: 640px;
    padding: 28px 24px 32px;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1.4;
    border: 1px solid rgba(0, 0, 0, 0.08);
    cursor: grab;
    transition: transform 0.22s ease-out, opacity 0.22s ease-out;
    will-change: transform;
    user-select: none;
    touch-action: pan-y;
    flex-direction: column;
    text-align: center;
}

.worldview-card.is-leaving {
    opacity: 0;
}

.worldview-card:active {
    cursor: grabbing;
}

.worldview-card.dragging {
    transition: none;
    z-index: 10;
}

.worldview-card.swiped-left {
    transform: translateX(-150%) rotate(-15deg);
    opacity: 0;
}

.worldview-card.swiped-right {
    transform: translateX(150%) rotate(15deg);
    opacity: 0;
}

/* Card Content */
.card-statement {
    font-size: clamp(18px, 2.2vw, 22px);
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -0.02em;
    color: #0a0a0a;
    margin: 0;
    margin-top: 1.5rem;
    padding: 0;
    text-align: center;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 6px;
    text-decoration-color: rgba(45, 125, 58, 0.3);
    max-width: 100%;
}

.card-number {
    position: absolute;
    top: 1.25rem;
    right: 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    z-index: 5;
}

/* Controls */
.controls {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 40px;
}

.control-btn {
    width: 80px;
    height: 80px;
    border-radius: 24px;
    border: 2px solid currentColor;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.control-btn:focus {
    outline: 2px solid currentColor;
    outline-offset: 4px;
}

.control-btn:active {
    transform: scale(0.95);
}

.control-btn.game-btn-no {
    border-color: #dc3545;
    color: #dc3545;
}

.control-btn.game-btn-no:hover {
    background: #dc3545;
    color: #fff;
}

.control-btn.game-btn-yes {
    border-color: #2d7d3a;
    color: #2d7d3a;
}

.control-btn.game-btn-yes:hover {
    background: #2d7d3a;
    color: #fff;
}

.game-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid;
    background: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.game-btn:focus {
    outline: 2px solid #2d7d3a;
    outline-offset: 4px;
}

.game-btn:active {
    transform: scale(0.95);
}

.game-btn-no {
    border-color: #dc3545;
    color: #dc3545;
}

.game-btn-no:hover {
    background: #dc3545;
    color: #fff;
}

.game-btn-yes {
    border-color: #2d7d3a;
    color: #2d7d3a;
}

.game-btn-yes:hover {
    background: #2d7d3a;
    color: #fff;
}

.control-btn .btn-icon {
    font-size: 28px;
    line-height: 1;
    font-weight: 300;
}

.btn-icon {
    font-size: 1.75rem;
    line-height: 1;
    font-weight: 300;
}

.btn-icon-desktop {
    display: block;
}

.btn-icon-mobile {
    display: none;
}

.btn-label {
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.game-btn-next,
.game-btn-restart {
    width: auto;
    height: auto;
    padding: 0.875rem 2rem;
    border-radius: 0.75rem;
    border: 2px solid #0a0a0a;
    background: #0a0a0a;
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    flex-direction: row;
    gap: 0;
}

.game-btn-next:hover,
.game-btn-restart:hover {
    background: #333;
    border-color: #333;
    color: #fff;
}

/* Mobile-specific styling for next button */
@media (max-width: 768px) {

    .result-overlay .game-btn-next,
    .game-complete .game-btn-restart {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        font-weight: 600;
        margin-top: 1.5rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        border-width: 2px;
        min-height: 52px;
        width: 100%;
        max-width: 100%;
        align-self: stretch;
        border-radius: 0.875rem;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
        white-space: normal;
        word-wrap: break-word;
        text-align: center;
        line-height: 1.4;
        background: #0a0a0a;
        border-color: #0a0a0a;
        color: #fff;
    }

    .result-overlay .game-btn-next:hover,
    .game-complete .game-btn-restart:hover {
        background: #333;
        border-color: #333;
        color: #fff;
    }

    .result-overlay .game-btn-next:active,
    .game-complete .game-btn-restart:active {
        transform: scale(0.98);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
        background: #333;
        border-color: #333;
    }
}

@media (max-width: 480px) {

    .result-overlay .game-btn-next,
    .game-complete .game-btn-restart {
        padding: 0.875rem 1.25rem;
        font-size: 0.9375rem;
        font-weight: 600;
        margin-top: 1.25rem;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
        min-height: 48px;
        border-radius: 0.75rem;
        background: #0a0a0a;
        border-color: #0a0a0a;
        color: #fff;
    }

    .result-overlay .game-btn-next:hover,
    .game-complete .game-btn-restart:hover {
        background: #333;
        border-color: #333;
        color: #fff;
    }

    .result-overlay .game-btn-next:active,
    .game-complete .game-btn-restart:active {
        background: #333;
        border-color: #333;
    }
}

/* Result Overlay */
.result-overlay {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    min-height: 320px;
    aspect-ratio: 5 / 7;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(8px);
    border-radius: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 20;
    padding: 1.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.result-overlay.active {
    display: flex;
}

.result-content {
    text-align: center;
    max-width: 100%;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e8e8e8;
}

.result-label {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #666;
    font-weight: 600;
}

.result-user-answer,
.result-author-answer {
    font-size: 1.125rem;
    font-weight: 700;
}

.result-user-answer {
    color: #666;
}

.result-author-answer {
    color: #0a0a0a;
}

.result-match {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 1.5rem 0;
    padding: 1rem;
    border-radius: 0.75rem;
}

.result-match.match {
    color: #2d7d3a;
    background: rgba(45, 125, 58, 0.1);
}

.result-match.no-match {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
}

.result-explanation {
    font-size: 1rem;
    line-height: 1.7;
    color: #3a3a3a;
    margin-top: 16px;
    text-align: left;
    max-width: 640px;
}

/* Результат после свайпа: на месте карточки */
.worldview-result-card {
    position: absolute;
    inset: 0;
    margin: 0 auto;
    max-width: 640px;
    padding: 28px 24px 32px;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.08);
    overflow-y: auto;
}

.worldview-result-status {
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 1.125rem;
    width: 100%;
}

.worldview-result-status.match {
    background: #e4f2e4;
    color: #1f7a2f;
}

.worldview-result-status.no-match {
    background: #ffe5e5;
    color: #b63636;
}

.worldview-result-text {
    font-size: 15px;
    line-height: 1.6;
    color: #3a3a3a;
    text-align: left;
    width: 100%;
    margin-bottom: 20px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* Старый блок результата (оставляем для совместимости, но не используем) */
.worldview-result {
    max-width: 640px;
    margin: 0 auto 40px;
    scroll-margin-top: 20px;
}

.worldview-result-text a {
    color: #2d7d3a;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.15s ease;
}

.worldview-result-text a:hover {
    color: #1f5a28;
    text-decoration-thickness: 2px;
}

/* Кнопка "Далее" в блоке результата */
.worldview-result-card .game-btn-next {
    margin-top: auto;
    width: auto;
    height: auto;
    padding: 0.875rem 2rem;
    border-radius: 0.75rem;
    border: 2px solid #0a0a0a;
    background: #0a0a0a;
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    flex-direction: row;
    gap: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.worldview-result-card .game-btn-next:hover {
    background: #333;
    border-color: #333;
    color: #fff;
}

/* Старая кнопка в .worldview-result (для совместимости) */
.worldview-result .game-btn-next {
    margin-top: 16px;
    width: auto;
    height: auto;
    padding: 0.875rem 2rem;
    border-radius: 0.75rem;
    border: 2px solid #0a0a0a;
    background: #0a0a0a;
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    flex-direction: row;
    gap: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.worldview-result .game-btn-next:hover {
    background: #333;
    border-color: #333;
    color: #fff;
}

/* Ссылка "Назад" */
.worldview-back {
    display: inline-block;
    margin-top: 3rem;
    color: rgba(45, 125, 58, 0.9);
    text-decoration: none;
    transition: color 0.15s ease;
}

.worldview-back:hover {
    color: rgba(45, 125, 58, 1);
}

/* Game Complete Screen */
.game-complete {
    display: none;
    margin-top: 32px;
    padding: 3rem 2rem;
    background: #fff;
    border-radius: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.game-complete.active {
    display: block;
}

.complete-content {
    text-align: center;
    max-width: 480px;
    margin: 0 auto;
}

.complete-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #0a0a0a;
}

.complete-score {
    font-size: 1.5rem;
    font-weight: 600;
    color: #3a3a3a;
    margin-bottom: 1.5rem;
}

.complete-score span {
    color: #2d7d3a;
    font-weight: 700;
}

.complete-message {
    font-size: 1.125rem;
    line-height: 1.7;
    color: #3a3a3a;
    margin-bottom: 2rem;
}

/* Responsive Design for Game */
@media (max-width: 768px) {
    .worldview-game {
        padding: 12px 12px 24px;
    }

    .card-wrapper {
        min-height: 350px;
    }

    .cards-stack {
        max-width: 100%;
        height: 350px;
        min-height: 350px;
    }

    .worldview-card {
        max-width: 100%;
        min-height: 350px;
        padding: 24px 20px;
    }

    .card-statement {
        font-size: clamp(18px, 2.6vw, 24px);
    }

    .result-overlay {
        min-height: 350px;
    }

    .controls {
        gap: 24px;
    }

    .control-btn {
        width: 70px;
        height: 70px;
        border-radius: 20px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        border-width: 2.5px;
    }

    .control-btn .btn-icon {
        font-size: 24px;
    }

    .control-btn.game-btn-no {
        background: #fff;
        border-color: #dc3545;
        color: #dc3545;
    }

    .control-btn.game-btn-no:active {
        background: #dc3545;
        color: #fff;
        transform: scale(0.95);
    }

    .control-btn.game-btn-yes {
        background: #fff;
        border-color: #2d7d3a;
        color: #2d7d3a;
    }

    .control-btn.game-btn-yes:active {
        background: #2d7d3a;
        color: #fff;
        transform: scale(0.95);
    }

    .game-btn {
        width: 70px;
        height: 70px;
        border-radius: 1rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        border-width: 2.5px;
    }

    .game-btn-no {
        background: #fff;
        border-color: #dc3545;
        color: #dc3545;
    }

    .game-btn-no:active {
        background: #dc3545;
        color: #fff;
        transform: scale(0.95);
    }

    .game-btn-yes {
        background: #fff;
        border-color: #2d7d3a;
        color: #2d7d3a;
    }

    .game-btn-yes:active {
        background: #2d7d3a;
        color: #fff;
        transform: scale(0.95);
    }

    .btn-icon-desktop {
        display: none;
    }

    .btn-icon-mobile {
        display: block;
        font-size: 1.75rem;
        font-weight: 400;
    }

    .btn-label {
        display: none;
    }

    .result-overlay {
        padding: 1.5rem;
        padding-bottom: 5rem;
        /* Space for next button */
    }

    .result-content {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .result-header {
        margin-bottom: 1.25rem;
        padding-bottom: 0.875rem;
    }

    .result-header:first-of-type {
        margin-top: 0;
    }

    .result-header:last-of-type {
        margin-bottom: 1.5rem;
    }

    .result-match {
        margin: 1.75rem 0;
    }

    .result-explanation {
        margin-top: 1.75rem;
        margin-bottom: 0;
        padding-bottom: 0;
    }

    .complete-title {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .worldview-game {
        padding: 8px 8px 20px;
    }

    .card-wrapper {
        min-height: 320px;
    }

    .cards-stack {
        height: 320px;
        min-height: 320px;
    }

    .worldview-card {
        padding: 20px 16px;
        border-radius: 20px;
        min-height: 320px;
    }

    .card-statement {
        font-size: clamp(18px, 2.6vw, 24px);
    }

    .result-overlay {
        min-height: 320px;
        padding: 1.5rem;
    }

    .card-number {
        top: 1rem;
        right: 1.5rem;
    }

    .controls {
        gap: 20px;
    }

    .control-btn {
        width: 64px;
        height: 64px;
        border-radius: 16px;
    }

    .control-btn .btn-icon {
        font-size: 22px;
    }

    .game-btn {
        width: 70px;
        height: 70px;
        border-radius: 1rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        border-width: 2.5px;
    }

    .game-btn-no {
        background: #fff;
        border-color: #dc3545;
        color: #dc3545;
    }

    .game-btn-no:active {
        background: #dc3545;
        color: #fff;
        transform: scale(0.95);
    }

    .game-btn-yes {
        background: #fff;
        border-color: #2d7d3a;
        color: #2d7d3a;
    }

    .game-btn-yes:active {
        background: #2d7d3a;
        color: #fff;
        transform: scale(0.95);
    }

    .btn-icon-desktop {
        display: none;
    }

    .btn-icon-mobile {
        display: block;
        font-size: 1.75rem;
        font-weight: 400;
    }

    .btn-label {
        display: none;
    }

    .result-overlay {
        padding: 1.25rem;
        padding-bottom: 4.5rem;
        /* Space for next button */
    }

    .result-content {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .result-header {
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .result-header:first-of-type {
        margin-top: 0;
    }

    .result-header:last-of-type {
        margin-bottom: 2rem;
    }

    .result-label {
        font-size: 0.8125rem;
        line-height: 1.4;
    }

    .result-user-answer,
    .result-author-answer {
        font-size: 1rem;
        line-height: 1.4;
    }

    .result-match {
        margin: 2rem 0;
        padding: 1.25rem 1rem;
        font-size: 1.25rem;
    }

    .result-explanation {
        margin-top: 2rem;
        margin-bottom: 0;
        padding-bottom: 0;
        font-size: 0.9375rem;
        line-height: 1.75;
    }
}

/* ===========================
   Article Footer Sections
   Источники, похожие материалы и т.д.
   =========================== */

.article-footer-section {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 0.5px solid rgba(0, 0, 0, 0.1);
    /* Thinner, lighter line */
}

.article-footer-section:first-of-type {
    margin-top: 3rem;
}

.article-footer-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
}

.article-footer-section .footer-content {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: #2a2a2a;
}

.article-footer-section .footer-content p {
    margin-bottom: 0.75rem;
}

.article-footer-section .footer-content p:last-child {
    margin-bottom: 0;
}

.article-footer-section .footer-content a {
    color: #2d7d3a;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.article-footer-section .footer-content a:hover {
    color: #1f5a28;
    text-decoration: underline;
}

.article-footer-section .footer-content small {
    display: block;
    font-size: 0.8125rem;
    color: #666;
    margin-top: 0.25rem;
    font-weight: 400;
}

.article-footer-section .footer-content .source-item {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.article-footer-section .footer-content .source-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.article-footer-section .footer-content .source-title {
    font-weight: 600;
    color: #0a0a0a;
    margin-bottom: 0.25rem;
}

.article-footer-section .footer-content .source-description {
    font-size: 0.875rem;
    color: #666;
    line-height: 1.6;
}

.article-footer-section .footer-content h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #0a0a0a;
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.article-footer-section .footer-content h4:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.article-footer-section .footer-content>p:first-of-type {
    margin-bottom: 1.5rem;
    color: #666;
    font-size: 0.9375rem;
}

@media (max-width: 768px) {
    .article-footer-section {
        margin-top: 3rem;
        padding-top: 2rem;
    }

    .article-footer-section h3 {
        font-size: 0.9375rem;
        margin-bottom: 1rem;
    }

    .article-footer-section .footer-content {
        font-size: 0.875rem;
    }
}

/* ===========================
   Journal Editorial Elements
   Единая система оформления журнальных статей
   =========================== */

/* Pull Quotes - большие цитаты (эмоциональный акцент)
   
   Пример использования:
   <div class="pullquote">
       <p class="pullquote-text">Текст цитаты</p>
   </div>
*/
.pullquote {
    margin: 32px 0;
    padding: 16px 24px;
    border-left: 3px solid var(--accent, #2d7d3a);
    position: relative;
    max-width: 70%;
}

.pullquote-text {
    font-style: italic;
    font-size: 1.125rem;
    line-height: 1.6;
    color: #0a0a0a;
    margin: 0;
    padding-left: 0;
    position: relative;
}

/* Маленькие зеленые кавычки в начале строки */
.pullquote-text::before {
    content: '"';
    position: absolute;
    left: -0.5em;
    color: #2d7d3a;
    opacity: 0.4;
    font-size: 1.2em;
    font-family: Georgia, serif;
    line-height: 1;
}

/* Info Boxes - информационные плашки (фактологическая справка)
   
   Пример использования:
   <div class="infobox">
       <div class="infobox-title">ЗАГОЛОВОК</div>
       <div class="infobox-content">Текст справки</div>
   </div>
*/
.infobox {
    margin: 32px 0;
    padding: 20px 24px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.95em;
    line-height: 1.6;
    max-width: 100%;
}

.infobox-title {
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 8px;
    font-size: 0.875rem;
    color: #2d7d3a;
}

.infobox-content {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: #2a2a2a;
    margin: 0;
}

.infobox-content p {
    margin-bottom: 0.75rem;
}

.infobox-content p:last-child {
    margin-bottom: 0;
}

.infobox-content a {
    color: #2d7d3a;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

.infobox-content a:hover {
    color: #1f5a28;
    text-decoration: underline;
}

/* Captions / Epigraphs - подписи и эпиграфы
   
   Пример использования:
   <p class="note">Подпись к цитате или пояснение</p>
*/
.note,
.caption {
    margin-top: 4px;
    font-size: 0.8em;
    color: #8a8a8a;
    line-height: 1.5;
    font-style: normal;
}

/* Section Dividers - разделители секций
   
   Пример использования:
   <div class="section-divider">
       <span class="section-divider-dots">···</span>
   </div>
*/
.section-divider {
    margin: 4rem 0;
    text-align: center;
    position: relative;
}

.section-divider-dots {
    display: inline-block;
    color: #ccc;
    font-size: 1rem;
    letter-spacing: 0.5em;
    font-weight: 300;
}

/* Обратная совместимость со старым классом */
.section-divider-icon {
    display: inline-block;
    color: #ccc;
    font-size: 0.875rem;
    letter-spacing: 0.5em;
    font-weight: 300;
}

.section-divider-icon::before {
    content: '···';
}

/* Footnotes - сноски
   
   Пример использования в тексте:
   <span class="footnote-ref" data-footnote="1">1</span>
   
   Пример списка сносок внизу статьи:
   <div class="footnotes">
       <div class="footnote-item" id="footnote-1">
           <span class="footnote-number">1</span>
           <span class="footnote-text">Текст сноски</span>
       </div>
   </div>
*/
.footnote-ref {
    font-size: 0.75em;
    vertical-align: super;
    line-height: 0;
    color: #2d7d3a;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s ease;
}

.footnote-ref:hover {
    color: #1f5a28;
    text-decoration: underline;
}

.footnotes {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e5e5;
}

.footnote-item {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    position: relative;
    font-size: 0.9375rem;
    line-height: 1.7;
    color: #2a2a2a;
}

.footnote-item:last-child {
    margin-bottom: 0;
}

.footnote-number {
    position: absolute;
    left: 0;
    font-weight: 600;
    color: #2d7d3a;
}

.footnote-text {
    display: block;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .pullquote {
        max-width: 85%;
        margin: 24px 0;
        padding: 12px 20px;
    }

    .pullquote-text {
        font-size: 1.0625rem;
    }

    .infobox {
        margin: 24px 0;
        padding: 16px 20px;
    }

    .section-divider {
        margin: 3rem 0;
    }

    .footnotes {
        margin-top: 3rem;
        padding-top: 1.5rem;
    }
}

@media (max-width: 480px) {
    .pullquote {
        max-width: 100%;
        margin: 20px 0;
        padding: 12px 16px;
    }

    .pullquote-text {
        font-size: 1rem;
    }

    .infobox {
        margin: 20px 0;
        padding: 14px 18px;
    }

    .section-divider {
        margin: 2.5rem 0;
    }
}

/* ===========================
   Field Notes / Журнал наблюдателя
   =========================== */

/* Hero Section */
.fn-hero {
    margin-bottom: 3rem;
}

.fn-hero .section-content {
    max-width: 720px;
}

/* Лента наблюдений */
.fn-notes {
    margin-bottom: 4rem;
}

.fn-note {
    margin-bottom: 3rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.fn-note:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.fn-note__header {
    margin-bottom: 1rem;
}

.fn-note__title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #0a0a0a;
    line-height: 1.3;
    letter-spacing: -0.015em;
}

.fn-note__meta {
    font-size: 0.8125rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0;
    line-height: 1.5;
}

.fn-note__meta time {
    font-weight: 500;
}

.fn-note__location {
    color: #888;
    font-weight: 400;
}

.fn-note__location::before {
    content: '•';
    margin-right: 0.5rem;
    color: #999;
}

.fn-note__text {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: #1a1a1a;
    margin-bottom: 1rem;
    max-width: 720px;
}

.fn-note__aside {
    font-size: 0.875rem;
    line-height: 1.6;
    color: #555;
    font-style: italic;
    margin-top: 1rem;
    padding-left: 1.25rem;
    border-left: 2px solid rgba(45, 125, 58, 0.2);
    max-width: 680px;
}

/* Мини-кейсы */
.fn-microcases {
    margin-bottom: 4rem;
}

.fn-microcases__intro {
    margin-bottom: 2rem;
}

.fn-microcase {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.fn-microcase:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.fn-microcase__title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #0a0a0a;
    letter-spacing: -0.01em;
}

.fn-microcase__text {
    font-size: 0.9375rem;
    line-height: 1.65;
    color: #2a2a2a;
    margin-bottom: 1rem;
    max-width: 720px;
}

.fn-microcase__demo {
    margin-top: 1rem;
    padding: 1rem 1.25rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow-x: auto;
}

.fn-microcase__demo pre {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.6;
    color: #2a2a2a;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.fn-microcase__demo code {
    font-family: inherit;
    font-size: inherit;
}

.fn-microcase__demo .fn-sources-demo {
    font-size: 0.9375rem;
    line-height: 1.6;
}

.fn-microcase__demo .fn-sources-demo h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #0a0a0a;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.fn-microcase__demo .fn-sources-demo ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.fn-microcase__demo .fn-sources-demo li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.fn-microcase__demo .fn-sources-demo a {
    color: #2d7d3a;
    text-decoration: none;
    font-weight: 500;
}

.fn-microcase__demo .fn-sources-demo small {
    color: #666;
    font-size: 0.875rem;
}

/* Секция «Метод» */
.fn-method {
    margin-bottom: 4rem;
}

.fn-method .section-content {
    max-width: 720px;
}

/* Футер */
.fn-footer {
    margin-bottom: 0;
    padding-bottom: 2rem;
}

.fn-footer .section-content {
    font-size: 0.875rem;
    color: #666;
    max-width: 720px;
}

.fn-footer p {
    margin-bottom: 0.5rem;
}

.fn-footer p:last-child {
    margin-bottom: 0;
}

/* Адаптивность */
@media (max-width: 768px) {
    .fn-note {
        margin-bottom: 2.5rem;
        padding-bottom: 2rem;
    }

    .fn-note__title {
        font-size: 1.125rem;
    }

    .fn-note__text {
        font-size: 0.9375rem;
        line-height: 1.65;
    }

    .fn-note__aside {
        font-size: 0.8125rem;
        padding-left: 1rem;
        margin-top: 0.875rem;
    }

    .fn-microcase {
        margin-bottom: 2rem;
        padding-bottom: 1.5rem;
    }

    .fn-microcase__title {
        font-size: 1.0625rem;
    }

    .fn-microcase__text {
        font-size: 0.9375rem;
    }

    .fn-microcase__demo {
        padding: 0.875rem 1rem;
    }

    .fn-microcase__demo pre {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .fn-note {
        margin-bottom: 2rem;
        padding-bottom: 1.5rem;
    }

    .fn-note__meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .fn-note__location::before {
        display: none;
    }

    .fn-note__aside {
        padding-left: 0.875rem;
        border-left-width: 1.5px;
    }

    .fn-microcase {
        margin-bottom: 1.5rem;
        padding-bottom: 1.25rem;
    }

    .fn-microcase__demo {
        padding: 0.75rem;
    }
}

/* Background Still Life Elements - бейджик в углу */
.background-still-life {
    display: none !important;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    min-height: 100vh;
    pointer-events: none;
    z-index: 0;
    overflow: visible;
    visibility: hidden;
}

.still-life-badge {
    display: none !important;
    position: absolute;
    top: 0;
    right: 0;
    width: 160px;
    height: 220px;
    margin: 0;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transform: rotate(12deg) translate(-10%, 10%);
    transform-origin: top right;
}

.still-life-badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: grayscale(30%) contrast(1.05);
    display: block;
}

/* Hide on mobile and tablets */
@media (max-width: 1024px) {
    .background-still-life {
        display: none !important;
    }

    .still-life-badge {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }

    .still-life-badge img {
        display: none !important;
    }
}

/* Subtle hover effect on desktop */
@media (min-width: 1025px) {
    .background-still-life:hover .still-life-badge {
        opacity: 0.15;
    }
}

/* Ensure content is above background elements */
.page-inner,
.header,
.footer {
    position: relative;
    z-index: 10;
}

/* Team Search Banner */
.team-search-banner {
    margin: 2.5rem 0;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, #2d7d3a 0%, #1f5a2a 100%);
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(45, 125, 58, 0.2);
}

.team-search-banner-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

.team-search-text {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 800;
    letter-spacing: 0.05em;
    color: #ffffff;
    text-transform: uppercase;
    line-height: 1.1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .team-search-banner {
        margin: 2rem 0;
        padding: 2rem 1.5rem;
    }

    .team-search-text {
        font-size: clamp(2rem, 10vw, 3.5rem);
    }
}

@media (max-width: 480px) {
    .team-search-banner {
        margin: 1.5rem 0;
        padding: 1.5rem 1rem;
    }

    .team-search-text {
        font-size: clamp(1.75rem, 12vw, 2.5rem);
        letter-spacing: 0.03em;
    }
}

/* =========================================
   Evolution of Memes mini-game
   ========================================= */
.memetics-page {
    background: #fdfdfc;
    color: #1b1f2a;
}

.memetics-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1.5rem 4rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.memetics-hero {
    background: #fffefd;
    border: 1px solid #ece6d8;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 18px 45px rgba(27, 31, 42, 0.08);
}

.memetics-eyebrow {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #ad7e2f;
    margin-bottom: 0.75rem;
    display: inline-block;
}

.memetics-hero h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 1rem;
}

.memetics-lead {
    font-size: 1.125rem;
    line-height: 1.7;
    color: #3c3f42;
    max-width: 720px;
}

.memetics-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.memetics-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.75rem;
    border-radius: 999px;
    border: 1px solid #1f2435;
    background: #1f2435;
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.memetics-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(31, 36, 53, 0.2);
}

.memetics-btn.hidden {
    display: none;
}

.memetics-btn.secondary {
    background: transparent;
    color: #1f2435;
}

.memetics-btn.ghost {
    background: #fff;
    color: #1f2435;
    border-style: dashed;
}

.memetics-status {
    margin-top: 2rem;
}

.memetics-status-heading {
    font-size: 0.95rem;
    color: #6b6f7b;
    display: block;
    margin-bottom: 0.75rem;
}

.memetics-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.memetics-status-chip {
    border: 1px solid #e0d7c3;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.95rem;
}

.memetics-status-chip strong {
    font-size: 1.35rem;
    font-weight: 700;
}

.memetics-lab {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.memetics-panel,
.memetics-simulation,
.memetics-card {
    border: 1px solid #ece6d8;
    border-radius: 16px;
    padding: 1.75rem;
    background: #fff;
    box-shadow: 0 12px 24px rgba(27, 31, 42, 0.05);
}

.memetics-panel-head {
    margin-bottom: 1.25rem;
}

.memetics-points {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 1rem;
    color: #3c3f42;
}

.memetics-points strong {
    font-size: 1.5rem;
}

.memetics-note {
    font-size: 0.9rem;
    color: #6b6f7b;
    margin: 0.5rem 0 1.5rem;
    transition: color 0.2s ease;
}

.memetics-note-warning {
    color: #b85c3a;
}

.memetics-archetype {
    margin: 1rem 0 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.memetics-archetype select {
    border: 1px solid #dcd3bf;
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
    font-size: 1rem;
    background: #fff;
}

.memetics-archetype-note {
    margin: 0;
    font-size: 0.9rem;
    color: #6c6c6c;
}

.memetics-sliders {
    display: grid;
    gap: 1.25rem;
}

.memetics-slider label {
    font-weight: 600;
    display: block;
}

.memetics-slider-hint {
    font-size: 0.85rem;
    color: #7c7f8c;
    display: block;
    margin-bottom: 0.35rem;
}

.memetics-slider-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.memetics-slider-control input[type=\"range\"] {
    flex: 1;
    accent-color: #1f2435;
}

.memetics-slider-control output {
    min-width: 2.5rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.memetics-slider-error {
    outline: 2px solid #b85c3a;
}

.memetics-allocation {
    margin-top: 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
}

.memetics-allocation div {
    border: 1px solid #ede8dd;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.9rem;
}

.memetics-allocation strong {
    font-size: 1.25rem;
}

.memetics-panel-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.memetics-sim-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}

.memetics-sim-grid div {
    border: 1px solid #f0eadc;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    background: #fffdf8;
}

.memetics-sim-grid span {
    font-size: 0.85rem;
    color: #6b6f7b;
    display: block;
}

.memetics-sim-grid strong {
    font-size: 1.5rem;
}

.memetics-log {
    border: 1px dashed #e0d7c3;
    border-radius: 12px;
    padding: 1rem;
    min-height: 140px;
    background: #fffdf8;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.memetics-log p {
    margin: 0;
    color: #666;
}

.memetics-log-entry header {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #7a7d8a;
    margin-bottom: 0.4rem;
}

.memetics-log-entry strong {
    font-size: 1rem;
    color: #1f2435;
}

.memetics-goal {
    border: 1px solid #e8dec9;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    background: #fffef7;
    margin-bottom: 1rem;
}

.memetics-goal strong {
    display: block;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8b6b3f;
    margin-bottom: 0.25rem;
}

.memetics-goal p {
    margin: 0;
    font-size: 0.95rem;
}

.memetics-goal.win {
    border-color: #3f8d4c;
    background: #f0fff3;
}

.memetics-goal.lose {
    border-color: #b0483d;
    background: #fff6f4;
}

.memetics-events {
    margin-top: 1.5rem;
}

.memetics-event-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.memetics-tag {
    border: 1px solid #1f2435;
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    font-size: 0.85rem;
    background: #1f2435;
    color: #fff;
}

.memetics-events-panel {
    border: 1px dashed #decfb9;
    border-radius: 12px;
    padding: 1rem;
    background: #fffdf8;
}

.memetics-events-hint {
    font-size: 0.9rem;
    color: #6b6b6b;
    margin-top: 0.75rem;
}

.memetics-visuals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.memetics-card h2 {
    margin-top: 0;
}

.memetics-card canvas {
    width: 100%;
    height: 240px;
    border: 1px dashed #d6c9b1;
    border-radius: 12px;
    background: #fffef8;
}

.memetics-placeholder {
    font-size: 0.9rem;
    color: #6f6f6f;
    margin-top: 0.85rem;
}

.memetics-tree {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 0.5rem;
    margin: 1rem 0;
}

.memetics-node {
    border: 1px solid #d7cab4;
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    text-align: center;
    font-weight: 600;
    background: #fffdf5;
}

.memetics-roadmap ul {
    padding-left: 1.25rem;
    margin: 0.75rem 0 0;
}

.memetics-roadmap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

.memetics-roadmap article {
    border: 1px solid #e7decc;
    border-radius: 16px;
    padding: 1.25rem;
    background: #fff;
}

.memetics-roadmap h3 {
    margin-bottom: 0.5rem;
}

.memetics-docs {
    border: 1px solid #e0d7c3;
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.memetics-docs code {
    background: #f5efe2;
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
    font-size: 0.95rem;
}

.memetics-hints {
    margin: 2rem 0;
}

.memetics-hints ul {
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
    line-height: 1.5;
}

.memetics-context {
    border: 1px solid #ede1cc;
    border-radius: 16px;
    padding: 2rem;
    background: #fffef9;
}

.memetics-context-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.memetics-context-grid article {
    border: 1px solid #dfd0b9;
    border-radius: 14px;
    padding: 1rem;
    background: #fff;
}

.memetics-dashboard {
    padding: 2rem 1.5rem 4rem;
    background: #f9f7f1;
}

.dashboard-hero {
    margin-bottom: 2rem;
}

.dashboard-stepper {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0 1.5rem;
}

.dashboard-stepper button {
    border: 1px solid #d6c6ad;
    background: #fffef8;
    border-radius: 999px;
    padding: 0.4rem 1.25rem;
    font-weight: 600;
    color: #6b4b1f;
    cursor: pointer;
}

.dashboard-stepper button.is-active {
    background: #6b4b1f;
    color: #fff;
}

.dashboard-grid {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 1100px) {
    .dashboard-grid {
        grid-template-areas:
            "builder status"
            "control status"
            "log log";
        grid-template-columns: 1.1fr 0.9fr;
    }

    .dashboard-panel.builder {
        grid-area: builder;
    }

    .dashboard-panel.status {
        grid-area: status;
    }

    .dashboard-panel.control {
        grid-area: control;
    }

    .dashboard-panel.log {
        grid-area: log;
    }
}

.dashboard-panel {
    background: #fff;
    border: 1px solid #e6dcc6;
    border-radius: 18px;
    padding: 1.5rem;
    box-shadow: 0 24px 45px rgba(27, 31, 42, 0.08);
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.panel-head h2 {
    margin: 0;
    font-size: 1.15rem;
}

.panel-link {
    border: none;
    background: none;
    color: #8b6b3f;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.panel-link.danger {
    color: #b54838;
}

.dashboard-panel.stage-hidden {
    display: none;
}

.builder-hints {
    margin-top: 1.5rem;
    border-top: 1px dashed #e0d2bb;
    padding-top: 1rem;
}

.builder-hints-title {
    margin: 0 0 0.35rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.builder-hints-list {
    margin: 0 0 0.75rem;
    padding-left: 1.25rem;
    color: #6b6b6b;
    font-size: 0.9rem;
}

.dashboard-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.dashboard-tabs button {
    border: 1px solid #d8c7ad;
    border-radius: 999px;
    padding: 0.5rem 1.25rem;
    background: #fdfaf3;
    cursor: pointer;
    font-weight: 600;
    color: #6b5122;
}

.dashboard-tabs button.is-active {
    background: #6b5122;
    color: #fff;
}

.dashboard-tab-content {
    display: none;
}

.dashboard-tab-content.is-active {
    display: block;
}

.status-actions {
    margin-top: 1rem;
}

.memetics-toasts {
    margin-top: 1rem;
    min-height: 48px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.memetics-toasts p {
    margin: 0;
    font-size: 0.9rem;
    color: #a69780;
}

.memetics-toast {
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    background: #f1ede4;
    color: #4a3c25;
    font-size: 0.9rem;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.memetics-toast.alert {
    background: #ffe8e0;
    color: #853c2c;
}

.memetics-toast.success {
    background: #e3f5e5;
    color: #2a6a38;
}

.memetics-toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.dashboard-visuals {
    margin-top: 1rem;
    font-size: 0.95rem;
}

.dashboard-visuals summary {
    cursor: pointer;
    color: #71542c;
    font-weight: 600;
}

.dashboard-visuals[open] {
    padding-top: 0.5rem;
}

.memetics-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 999;
}

.memetics-modal.is-open {
    display: block;
}

.memetics-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 14, 20, 0.6);
}

.memetics-modal__dialog {
    position: relative;
    margin: 4vh auto;
    max-width: 960px;
    background: #fffef9;
    border-radius: 18px;
    padding: 2rem;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 40px 90px rgba(0, 0, 0, 0.25);
}

.memetics-modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.memetics-modal__body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.memetics-section-head {
    margin-bottom: 1.5rem;
    max-width: 720px;
}

.memetics-guide {
    border: 1px solid #ece6d8;
    border-radius: 16px;
    padding: 2rem;
    background: #fffefc;
    box-shadow: 0 10px 25px rgba(31, 36, 53, 0.05);
}

.memetics-guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.memetics-guide-grid article {
    border: 1px solid #efe6d8;
    border-radius: 12px;
    padding: 1rem;
    background: #fff;
}

.memetics-cycle {
    border: 1px solid #e8dfcc;
    border-radius: 16px;
    padding: 2rem;
    background: #fff;
}

.memetics-cycle-list {
    list-style: decimal;
    padding-left: 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.memetics-cycle-list strong {
    display: block;
    margin-bottom: 0.25rem;
}

.memetics-examples {
    border: 1px solid #efe1cc;
    border-radius: 16px;
    padding: 2rem;
    background: #fffdf8;
}

.memetics-examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.memetics-examples-grid article {
    border: 1px solid #eadfc9;
    border-radius: 14px;
    padding: 1rem 1.25rem;
    background: #fff;
}

.memetics-chip {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    background: #f5ede0;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.memetics-examples-meta {
    font-size: 0.85rem;
    color: #6a6a6a;
}

.memetics-name-field {
    margin: 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.memetics-name-field input {
    border: 1px solid #d6ccb7;
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    font-size: 1rem;
}

.memetics-name-field input:focus {
    outline: 2px solid #1f2435;
}

.memetics-name-hint {
    font-size: 0.85rem;
    color: #7c7c7c;
    margin: 0;
}

.memetics-faq {
    border: 1px solid #e4dcc7;
    border-radius: 16px;
    padding: 2rem;
    background: #fffefc;
}

.memetics-faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.memetics-faq-grid article {
    border: 1px solid #f0e7d4;
    border-radius: 12px;
    padding: 1rem;
    background: #fff;
}

.memetics-sources {
    border: 1px solid #ece2cf;
    border-radius: 16px;
    padding: 1.5rem;
    background: #fff;
}

.memetics-sources-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.memetics-sources-list a {
    color: #1f2435;
    text-decoration: underline;
}

.memetics-ops {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.memetics-shop,
.memetics-rivals {
    border: 1px solid #ece1cf;
    border-radius: 16px;
    padding: 1.75rem;
    background: #fffefc;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.04);
}

.memetics-shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.memetics-shop-card {
    border: 1px solid #ded2be;
    border-radius: 14px;
    padding: 1rem;
    text-align: left;
    background: #fff;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font: inherit;
    color: inherit;
}

.memetics-shop-card:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.08);
}

.memetics-shop-card:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.memetics-shop-cost {
    font-weight: 700;
    font-size: 0.95rem;
    color: #7a5f2c;
}

.memetics-shop-meta {
    font-size: 0.85rem;
    color: #6f6f6f;
}

.memetics-shop-hint {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #666;
}

.memetics-competitors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.memetics-competitor {
    border: 1px solid #dfd3c1;
    border-radius: 12px;
    padding: 1rem;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.memetics-competitor header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
}

.memetics-competitor h4 {
    margin: 0;
    font-size: 1.1rem;
}

.memetics-competitor-arch {
    margin: 0;
    font-size: 0.85rem;
    color: #8b6b3f;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.memetics-competitor-persona {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #7c7c7c;
}

.memetics-competitor dl {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    font-size: 0.9rem;
}

.memetics-competitor dl dt {
    font-weight: 600;
    color: #6b6b6b;
}

.memetics-competitor dl dd {
    margin: 0;
    font-weight: 700;
}

.memetics-competitor-status {
    font-size: 0.85rem;
    color: #555;
}

.memetics-competitor.placeholder {
    border-style: dashed;
    text-align: center;
    color: #7c7c7c;
}

@media (max-width: 768px) {
    .memetics-layout {
        padding: 2rem 1rem 3rem;
    }

    .memetics-hero {
        padding: 2rem 1.5rem;
    }

    .memetics-panel,
    .memetics-simulation,
    .memetics-card {
        padding: 1.5rem;
    }
}

/* =============================
   Evolution v2 Board Styles
   ============================= */
.evo-page {
    font-family: 'Inter', sans-serif;
    background: radial-gradient(circle at top, #f5efe3, #e6dac7);
    color: #1c1c1c;
    min-height: 100vh;
    position: relative;
}

.evo-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        linear-gradient(120deg, rgba(255, 255, 255, 0.04), transparent 60%);
    background-size: 120px 120px, 100% 100%;
    pointer-events: none;
    z-index: 0;
}

.evo-stage {
    width: min(1400px, 100%);
    margin: 0 auto;
    padding: 1.2rem 1.2rem 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    position: relative;
    z-index: 1;
}

.evo-hero {
    background: #fff9f1;
    border: 1px solid #eddcc5;
    border-radius: 20px;
    padding: 1.75rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    box-shadow: 0 30px 60px rgba(148, 117, 87, 0.15);
}

.evo-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.85rem;
    color: #a26c2c;
    margin-bottom: 0.25rem;
}

.hero-pill {
    max-width: 360px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid #ead6ba;
    border-radius: 16px;
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
    line-height: 1.4;
}

.resource-panel,
.tutorial-guide {
    background: #fff8ee;
    border: 1px solid #f1dfcb;
    border-radius: 18px;
    padding: 1rem 1.25rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.resource-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: stretch;
}

.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    flex: 2;
}

.resource-card {
    background: #fff;
    border: 1px solid #f0d8be;
    border-radius: 12px;
    padding: 0.65rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    position: relative;
    overflow: hidden;
}

.resource-card::before {
    content: attr(data-icon);
    position: absolute;
    right: 0.5rem;
    top: 0.4rem;
    font-size: 1.1rem;
    opacity: 0.6;
}

.resource-card p {
    margin: 0;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9a7955;
}

.resource-card strong {
    font-size: 1.45rem;
    color: #412711;
}

.resource-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.phase-mini {
    font-size: 0.9rem;
    color: #5a4530;
    display: flex;
    flex-direction: column;
}

.primary-large {
    padding: 0.9rem 2.5rem;
    font-size: 1rem;
}

.primary.is-pulsing {
    animation: pulseButton 1.4s ease-in-out infinite;
    box-shadow: 0 0 0 rgba(179, 98, 50, 0.4);
}

@keyframes pulseButton {
    0% {
        box-shadow: 0 0 0 0 rgba(179, 98, 50, 0.55);
    }

    70% {
        box-shadow: 0 0 0 16px rgba(179, 98, 50, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(179, 98, 50, 0);
    }
}

.progress-stack {
    display: flex;
    gap: 0.75rem;
    flex-direction: column;
    justify-content: space-between;
    min-width: 140px;
}

.progress-card {
    background: linear-gradient(135deg, #fdf3e6, #f7ead6);
    border: 1px solid #d9b38d;
    border-radius: 14px;
    padding: 0.65rem 0.9rem;
    position: relative;
}

.progress-card::before {
    content: attr(data-icon);
    position: absolute;
    top: 0.45rem;
    right: 0.6rem;
    opacity: 0.65;
}

.progress-card p {
    margin: 0;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #8c643a;
}

.progress-card strong {
    font-size: 1.25rem;
    color: #3a210f;
}

.tutorial-steps {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.6rem;
}

.tutorial-steps button {
    border: 1px solid #d9b38d;
    border-radius: 999px;
    background: #fff;
    padding: 0.45rem 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
}

.tutorial-steps button.is-active {
    background: #b26232;
    color: #fff;
    border-color: #b26232;
}

.tutorial-steps button.is-locked {
    opacity: 0.4;
    border-style: dashed;
    cursor: not-allowed;
}

.tutorial-hint {
    font-size: 0.95rem;
    color: #5a4530;
    margin: 0;
}

.evo-board-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 1.25rem;
    align-items: start;
}

.evo-column {
    background: transparent;
    border: none;
    border-radius: 18px;
    padding: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.column-main,
.column-right {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.column-main {
    gap: 1.5rem;
}

.panel,
.phase-digest,
.event-ledger,
.status-strip,
.rival-panel {
    background: #fffdf9;
    border: 1px solid #f1dfcb;
    border-radius: 16px;
    padding: 1rem 1.25rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.panel-head,
.board-head,
.phase-track-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-head h3,
.board-head h2,
.phase-track-head h2 {
    margin: 0;
}

.panel-note {
    font-size: 0.95rem;
    color: #6a5c48;
    margin-bottom: 0.5rem;
}

.phase-digest header h2 {
    margin: 0;
}

.phase-tracker ol {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 0;
}

.phase-digest .phase-hint {
    margin-top: 0.75rem;
}

.phase-steps li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
    font-weight: 600;
    color: #b79a78;
}

.phase-steps li::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #c09b6e;
}

.phase-steps li.is-active {
    color: #7d4b1b;
}

.phase-steps li.is-active::before {
    background: #c09b6e;
}

.phase-hint {
    margin-top: 0.75rem;
    font-size: 0.95rem;
    color: #503820;
}

.token-tray ul {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.token-tray li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.token-tray li strong {
    font-size: 1.1rem;
    color: #3f2b19;
}

.token-tray li small {
    display: block;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    color: #8b6c4a;
}

.token {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
}

.token-red {
    background: #d4513c;
}

.token-blue {
    background: #4a7fd3;
}

.token-yellow {
    background: #f1c93c;
}

.token-note {
    font-size: 0.85rem;
    color: #6b5d4d;
    margin-top: 0.5rem;
}

.victory-meter .meter {
    margin-bottom: 0.75rem;
}

.meter-label {
    font-size: 0.85rem;
    color: #8c6c46;
}

.meter-track {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: #f2e1cd;
    overflow: hidden;
    margin: 0.35rem 0;
}

.meter-track span {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #b36f32, #f1a24d);
    transition: width 0.3s ease;
}

.meter-track.is-inline {
    margin-top: 0.35rem;
    margin-bottom: 0;
}

.meter-value {
    font-size: 0.85rem;
    color: #6a4e31;
}

.victory-status {
    font-size: 0.95rem;
    color: #4b3824;
    margin-top: 0.5rem;
}
/* ===========================
   Modeling Page Redesign
   Mature, Artistic, Masonry
   =========================== */

/* Masonry Grid Layout */
.modeling-grid-mature {
    column-count: 3;
    column-gap: 2rem;
    width: 100%;
}

/* Base Item Style */
.modeling-grid-mature .gallery-item {
    break-inside: avoid;
    margin-bottom: 2rem;
    position: relative;
    border-radius: 2px;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    /* Subtle initial border/frame */
    border: 4px solid #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    background: #fff;
}

/* Hover Lift */
.modeling-grid-mature .gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
    z-index: 2;
}

/* Image Styling - Grayscale to Color */
.modeling-grid-mature .gallery-image {
    display: block;
    width: 100%;
    height: auto;
    filter: grayscale(100%) contrast(1.05);
    transition: filter 0.6s ease, transform 0.6s ease;
    /* Slight zoom on hover for depth */
    transform: scale(1.01);
}

.modeling-grid-mature .gallery-item:hover .gallery-image {
    filter: grayscale(0%) contrast(1);
    transform: scale(1.03);
}

/* Caption Styling - Elegant & Minimal */
.modeling-grid-mature .gallery-caption {
    padding: 12px 16px;
    font-family: 'Inter', serif;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #444;
    background: #fff;
    border-top: 1px solid rgba(0,0,0,0.03);
}

/* Responsive Columns */
@media (max-width: 1024px) {
    .modeling-grid-mature {
        column-count: 2;
        column-gap: 1.5rem;
    }
}

@media (max-width: 600px) {
    .modeling-grid-mature {
        column-count: 1;
    }
    
    .modeling-grid-mature .gallery-item {
        margin-bottom: 1.5rem;
    }
}

/* Gallery Pair Handling in Masonry */
.modeling-grid-mature .gallery-pair {
    break-inside: avoid;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modeling-grid-mature .gallery-pair .gallery-item {
    margin-bottom: 0;
}

/* ===========================
   Projects Page Redesign
   Bento Grid / Mature Style
   =========================== */

.projects-bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: minmax(180px, auto);
    gap: 1.5rem;
    width: 100%;
}

/* Bento Item Base */
.bento-item {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.bento-item:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(255, 255, 255, 0.8);
    z-index: 2;
}

/* Spans */
.bento-item.span-2 {
    grid-column: span 2;
}

.bento-item.row-2 {
    grid-row: span 2;
}

/* Content Styling */
.bento-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.bento-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.project-year {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.75rem;
    color: #888;
    background: rgba(0, 0, 0, 0.04);
    padding: 4px 8px;
    border-radius: 4px;
}

.project-tag {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #2d7d3a;
}

.bento-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.bento-title a {
    color: #1a1a1a;
    text-decoration: none;
}

.bento-title a::after {
    content: '';
    position: absolute;
    inset: 0;
}

.bento-description {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
    flex-grow: 1;
}

/* Visual Items (Image Backgrounds) */
.bento-item.visual-item {
    padding: 0;
    border: none;
}

.bento-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease, filter 0.6s ease;
    filter: grayscale(100%) brightness(0.9);
}

.bento-item.visual-item:hover .bento-bg-image {
    transform: scale(1.05);
    filter: grayscale(0%) brightness(1);
}

.bento-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    z-index: 2;
    transform: translateY(0);
    transition: transform 0.4s ease;
}

.bento-item.visual-item .bento-title a {
    color: white;
}

.bento-item.visual-item .project-year {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
}

.bento-description-overlay {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 0.5rem;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s ease;
    height: 0;
    overflow: hidden;
}

.bento-item.visual-item:hover .bento-description-overlay {
    opacity: 1;
    transform: translateY(0);
    height: auto;
}

/* Background Decoration */
.bento-bg-decor {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Featured Item Styling */
.bento-item.featured-item {
    border: 2px solid rgba(45, 125, 58, 0.15);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.04);
}

.bento-item.featured-item:hover {
    border-color: rgba(45, 125, 58, 0.25);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

/* Responsive */
@media (max-width: 1024px) {
    .projects-bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .bento-item.span-2 {
        grid-column: span 2;
    }
    
    .bento-item.row-2 {
        grid-row: span 2;
    }
}

@media (max-width: 768px) {
    .projects-bento-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 1.25rem;
        grid-auto-rows: auto;
    }
    
    .projects-bento-grid > *,
    .projects-bento-grid > article,
    .projects-bento-grid .bento-item {
        grid-column: 1 / -1 !important;
        grid-row: auto !important;
        width: 100% !important;
        display: flex !important;
        min-height: auto;
        visibility: visible !important;
        opacity: 1 !important;
        height: auto !important;
    }
    
    .bento-item.span-2 {
        grid-column: 1 / -1 !important;
    }
    
    .bento-item.row-2 {
        grid-row: auto !important;
    }
    
    .bento-item {
        min-height: auto;
        padding: 1.25rem;
    }
    
    .bento-item.visual-item {
        min-height: 250px;
        aspect-ratio: 16/9;
        padding: 0;
    }
    
    .bento-item.visual-item.span-2 {
        min-height: 250px;
    }
    
    .bento-item.visual-item.row-2 {
        min-height: 250px;
    }
    
    .bento-title {
        font-size: 1.125rem;
    }
    
    .bento-description {
        font-size: 0.875rem;
    }
}

@media (max-width: 600px) {
    .projects-bento-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 1rem;
        grid-auto-rows: auto;
    }
    
    .projects-bento-grid > article,
    .projects-bento-grid .bento-item {
        grid-column: 1 / -1 !important;
        grid-row: auto !important;
        width: 100% !important;
        display: flex !important;
        min-height: auto;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .bento-item.span-2, 
    .bento-item.row-2 {
        grid-column: 1 / -1 !important;
        grid-row: auto !important;
        width: 100% !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .bento-item {
        padding: 1rem;
        border-radius: 16px;
        min-height: 180px;
    }
    
    .bento-item.visual-item {
        min-height: 220px;
        aspect-ratio: 16/9;
        padding: 0;
    }
    
    .bento-item.visual-item.span-2 {
        min-height: 220px;
    }
    
    .bento-item.visual-item.row-2 {
        min-height: 220px;
    }
    
    .bento-overlay {
        padding: 1rem;
    }
    
    .bento-title {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .bento-description,
    .bento-description-overlay {
        font-size: 0.8125rem;
    }
    
    .bento-bg-image {
        height: 100%;
        min-height: 220px;
    }
}
