:root {
    --primary: #000000;
    --secondary: #1a1a1a;
    --text: #f0f0f0;
    --highlight: #38bdf8;
    --glass: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.1);
    --error-color: #f87171;
    --loading-color: #60a5fa;
    --header-height: 4rem; /* Примерная высота шапки для отступа */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

/* Focus styles */
a:focus-visible, .modal-related-link:focus-visible, .modal-related-poem:focus-visible, .collection-link:focus-visible, #modalBackButton:focus-visible, .poem-card:focus-visible, button:focus-visible, .btn:focus-visible, .hamburger:focus-visible {
    outline: 2px solid var(--highlight);
    outline-offset: 2px;
    border-radius: 2px;
}
/* Убираем стандартный outline для кнопок, так как есть focus-visible */
button {
     outline: none;
}


html {
    scroll-behavior: smooth;
    /* --- IMPROVEMENT: CSS Scroll Padding --- */
    scroll-padding-top: calc(var(--header-height) + 1rem); /* Отступ для плавной прокрутки к якорям */
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    background-color: var(--primary);
    color: var(--text);
    min-height: 100vh;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(56, 189, 248, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(244, 114, 182, 0.15) 0%, transparent 50%);
    overflow-x: hidden;
}

.frosted-glass {
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    height: var(--header-height);
}

.logo {
    font-weight: 600;
    font-size: 1.2rem;
    letter-spacing: -0.5px;
    /* --- IMPROVEMENT: Logo Link Style --- */
    text-decoration: none;
    color: inherit;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 1rem;
}

header nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

nav a {
    color: var(--text);
    text-decoration: none;
    font-weight: 400;
    font-size: 0.9rem;
    position: relative;
    opacity: 0.9;
    transition: all 0.2s ease;
}

nav a:hover {
    opacity: 1;
    color: var(--highlight);
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--highlight);
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
}

 .hamburger {
    display: none;
    cursor: pointer;
    width: 24px;
    height: 16px;
    position: relative;
    z-index: 101;
    background: none;
    border: none;
    padding: 0;
}

.hamburger span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: var(--text);
    transition: all 0.3s ease;
    position: absolute;
    left: 0;
}

.hamburger span:nth-child(1) { top: 0; }
.hamburger span:nth-child(2) { top: 7px; }
.hamburger span:nth-child(3) { top: 14px; }

.hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.hamburger.active span:nth-child(2) {
    opacity: 0;
}
.hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    max-width: 300px;
    height: 100vh;
    z-index: 100;
    transition: right 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    display: block;
}

.mobile-menu.active {
    right: 0;
}

.mobile-nav {
    list-style: none;
    padding: 6rem 2rem;
}

.mobile-nav li {
    margin-bottom: 1.5rem;
}

.mobile-nav a {
    color: var(--text);
    text-decoration: none;
    font-size: 1.1rem;
    display: block;
    padding: 0.5rem 0;
    transition: color 0.2s ease;
}
.mobile-nav a:hover {
    color: var(--highlight);
}

.theme-switcher {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
}

.theme-option {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.9rem;
    background: transparent;
    border: none;
    border-radius: 999px;
    color: var(--text);
    font: inherit;
    font-size: 0.82rem;
    text-decoration: none;
    opacity: 0.75;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.theme-option:hover,
.theme-option.active {
    background: rgba(56, 189, 248, 0.14);
    color: var(--highlight);
    opacity: 1;
}

 main {
    padding: calc(var(--header-height) + 2rem) 1rem 4rem; /* Учитываем высоту шапки */
    max-width: 1200px;
    margin: 0 auto;
}

#about {
     padding: 2rem;
     margin-bottom: 2rem;
}
@media (max-width: 768px) {
    #about {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.8rem;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-top: 1.5rem;
}

.btn:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: var(--highlight);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.2);
}
@media (max-width: 768px) {
    #about .btn {
        display: flex;
        margin-left: auto;
        margin-right: auto;
        max-width: fit-content;
    }
}
/* --- IMPROVEMENT: Try Again Button Style --- */
.try-again-btn {
    margin-top: 1rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}


#poems h2 {
    font-weight: 500;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    letter-spacing: -0.5px;
    text-align: center;
}

.collections-list-container {
    text-align: center;
    margin-bottom: 2.5rem;
    padding: 0 1rem;
}

.collections-list-container h3 {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 1rem;
    opacity: 0.9;
    color: var(--highlight);
}

.collections-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem 1.5rem;
}

.collection-link {
    color: var(--text);
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    background: var(--glass);
    font-size: 0.9rem;
    transition: all 0.2s ease;
    opacity: 0.85;
    display: inline-block;
    cursor: pointer;
    /* Button reset */
    font-family: inherit;
}

.collection-link:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: var(--highlight);
    color: var(--highlight);
    opacity: 1;
    transform: translateY(-1px);
}

.collections-list-container .status-message {
    font-size: 0.95rem;
    opacity: 0.7;
    margin-top: 0.5rem;
}

.poems-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.poems-container .status-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    font-size: 1.1rem;
    opacity: 0.8;
}
.poems-container .loading { color: var(--loading-color); }
.poems-container .error { color: var(--error-color); }

/* --- IMPROVEMENT: Poem Card as Button --- */
.poem-card {
    /* Inherit from .frosted-glass */
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    /* Card specific */
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    min-height: 240px;
    justify-content: space-between;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    will-change: opacity, transform;
    transition: opacity 0.7s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1),
                border-color 0.3s ease,
                box-shadow 0.3s ease;
    /* Button Resets */
    text-align: left;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    width: 100%; /* Ensure button takes full grid width */
}

.poem-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.poem-card.visible:hover,
.poem-card:focus-visible { /* Combine hover and focus-visible for visual consistency */
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-color: var(--highlight);
}
/* Specific focus style from global rules still applies */


.poem-title {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--text);
}

.poem-excerpt {
    font-size: 0.95rem;
    line-height: 1.4;
    opacity: 0.8;
    overflow: hidden;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    white-space: pre-line;
}

.poem-meta {
    font-size: 0.85rem;
    opacity: 0.6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}
.poem-meta span {
     display: inline-flex;
     align-items: center;
     gap: 0.3rem;
}
.poem-meta .likes {
    color: var(--highlight);
}

section h2 {
    font-weight: 500;
    font-size: 1.5rem;
    margin-bottom: 1.2rem;
    letter-spacing: -0.5px;
}
#poems h2 {
     font-size: 1.8rem;
     margin-bottom: 1.5rem;
     text-align: center;
}
#contact h2 {
     font-size: 1.5rem;
     margin-bottom: 1.5rem;
}

main > section.frosted-glass {
     padding: 2rem;
     margin-top: 3rem;
}
main > section:first-child {
     margin-top: 0;
}

@media (max-width: 768px) {
    main > section.frosted-glass {
        padding: 1.5rem;
        margin-top: 2rem;
    }
     main > section:first-child {
         margin-top: 0;
     }
}


.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    padding: 1rem;
    overflow-y: hidden; /* Prevent body scroll when modal is open */
}

.modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content-wrapper {
    max-width: 650px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    opacity: 0;
    transform: scale(0.95) translateY(10px);
    transition: opacity 0.3s ease 0.1s, transform 0.3s ease 0.1s;
    position: relative;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.modal-content-wrapper::-webkit-scrollbar {
    display: none;
}

.modal.active .modal-content-wrapper {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.modal-content {
    padding: 2rem;
    position: relative;
}

.modal-content.related-view-active .modal-title,
.modal-content.related-view-active .modal-poem,
.modal-content.related-view-active .modal-meta {
    display: none;
}
#modalRelatedContent {
    display: none;
    margin-top: 1rem;
}
.modal-content.related-view-active #modalRelatedContent {
    display: block;
}


.modal-title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
    line-height: 1.3;
}

.modal-poem {
    line-height: 1.3;
    white-space: pre-line;
    margin-bottom: 2rem;
    font-size: 1rem;
    opacity: 0.95;
}

.modal-meta {
     font-size: 0.9rem;
     opacity: 0.7;
     display: flex;
     justify-content: space-between;
     flex-wrap: wrap;
     gap: 0.8rem;
     margin-top: 1.5rem;
     padding-top: 1rem;
     border-top: 1px solid var(--glass-border);
}
 .modal-meta span, .modal-meta a {
     display: inline-flex;
     align-items: center;
     gap: 0.4rem;
     color: inherit;
     text-decoration: none;
     cursor: default;
     opacity: 0.7;
 }
 .modal-meta a {
     cursor: pointer;
     transition: color 0.2s ease, opacity 0.2s ease;
     opacity: 0.8;
 }
 .modal-meta a:hover {
     color: var(--highlight);
     opacity: 1;
 }
 .modal-meta .likes {
     color: var(--highlight);
     opacity: 1;
     cursor: default;
 }

.modal-close {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.6rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 1001;
    padding: 0.5rem;
    line-height: 1;
}

.modal-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

.modal-back-button {
    background: none;
    border: 1px solid var(--glass-border);
    color: var(--text);
    padding: 0.4rem 0.8rem;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.modal-back-button:hover {
    background-color: var(--glass);
    border-color: var(--highlight);
}
#modalRelatedContent h3 {
    font-size: 1.3rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--highlight);
}
#modalRelatedContent h4 {
    font-size: 1.1rem;
    font-weight: 500;
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    border-top: 1px solid var(--glass-border);
    padding-top: 1rem;
    opacity: 0.9;
}
#modalRelatedContent ul {
    list-style: none;
    padding-left: 0.5rem;
}
#modalRelatedContent li {
    margin-bottom: 0.6rem;
}
.modal-related-poem, .modal-related-link {
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
    display: block;
    padding: 0.2rem 0;
    font-size: 0.95rem;
    opacity: 0.9;
}
.modal-related-poem:hover, .modal-related-link:hover {
    color: var(--highlight);
    opacity: 1;
}
.modal-related-poem i {
    margin-right: 0.5rem;
    opacity: 0.6;
}

.about-container {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    flex-wrap: wrap;
    justify-content: center;
}

.about-text {
    flex: 1;
    min-width: 250px;
}
.about-text p {
    margin-bottom: 1rem;
    line-height: 1.7;
    opacity: 0.9;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
}
.about-text #authorDescriptionPlaceholder {
    min-height: 5em;
}
.about-text #authorDescriptionPlaceholder p:last-child {
     margin-bottom: 0;
}


.about-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--secondary);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    border: 2px solid var(--glass-border);
    margin-bottom: 1rem;
    overflow: hidden;
}
 @media (min-width: 769px) {
     .about-container:not([style*="flex-wrap: wrap"]) .about-avatar {
        margin-bottom: 0;
     }
 }

.about-avatar i {
    font-size: 3rem;
    opacity: 0.4;
}
.about-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#contact h2 { margin-bottom: 1.5rem; }
#contact p {
    margin-bottom: 1.5rem;
    line-height: 1.6;
    opacity: 0.9;
}
.contact-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.contact-links a {
    color: var(--highlight);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: opacity 0.2s ease;
}
.contact-links a:hover {
    opacity: 0.8;
}

footer {
    text-align: center;
    padding: 3rem 1rem 2rem;
    opacity: 0.6;
    font-size: 0.9rem;
    margin-top: 3rem;
    border-top: 1px solid var(--glass-border);
}
footer a {
    color: var(--text);
    text-decoration: underline;
    text-decoration-color: var(--glass-border);
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
footer a:hover {
    color: var(--highlight);
    text-decoration-color: var(--highlight);
}
footer .footer-links {
    margin-top: 0.5rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    :root {
        --header-height: 3.5rem; /* Adjust header height for mobile */
    }
    html {
         scroll-padding-top: calc(var(--header-height) + 1rem);
    }
    header {
        padding: 0.8rem 1rem; /* Adjust padding */
    }

    nav ul.desktop-nav {
        display: none;
    }

    .desktop-theme-switcher {
        display: none;
    }

    .mobile-theme-switcher {
        width: calc(100% - 4rem);
        margin: 0 2rem 2rem;
        justify-content: center;
    }

    .hamburger {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    main {
        padding: calc(var(--header-height) + 1.5rem) 1rem 3rem; /* Adjust main padding */
    }

    #poems h2 { font-size: 1.5rem; }
    .collections-list-container { margin-bottom: 2rem; }
    .collections-list { gap: 0.6rem 1rem; }
    .collection-link { font-size: 0.85rem; padding: 0.3rem 0.6rem; }

    .poems-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .poem-card { min-height: 200px; }

    .modal-content-wrapper {
         max-height: 85vh;
    }
    .modal-content { padding: 1.5rem; }
    .modal-title { font-size: 1.4rem; }
    .modal-poem { font-size: 0.95rem; line-height: 1.35; }
    .modal-close {
        top: 0.5rem;
        right: 0.5rem;
        font-size: 1.5rem;
    }
    #modalRelatedContent h3 { font-size: 1.2rem; }
    #modalRelatedContent h4 { font-size: 1rem; }
    .modal-related-poem, .modal-related-link { font-size: 0.9rem; }


    .about-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
     .about-avatar {
         margin-bottom: 1.5rem;
         margin-right: 0;
     }
     .about-text {
         min-width: auto;
     }
     .about-text p {
          font-size: 0.95rem;
     }

    .contact-links { justify-content: center; }

    footer { padding: 2rem 1rem; }
}

@media (min-width: 769px) {
    .mobile-theme-switcher {
        display: none;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    main { padding: calc(var(--header-height) + 2rem) 2rem 4rem; }
    .poems-container {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
     .poem-card { min-height: 220px; }

    .about-text p {
        font-size: clamp(0.95rem, 1.8vw, 1rem);
    }
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.overlay.active {
    opacity: 1;
    pointer-events: all;
}

body.no-scroll {
    overflow: hidden;
}

/* Diary theme */
html[data-theme="diary"] {
    --primary: #f7eee4;
    --secondary: #f3e2d7;
    --text: #5f4337;
    --highlight: #c26051;
    --glass: rgba(255, 249, 242, 0.82);
    --glass-border: rgba(196, 148, 125, 0.28);
    --error-color: #b24b4b;
    --loading-color: #bc6554;
    color-scheme: light;
}

html[data-theme="diary"] body {
    font-family: Georgia, "Times New Roman", serif;
    color: #5f4337;
    background-color: #f7eee4;
    background-image:
        radial-gradient(circle at 12% 18%, rgba(241, 184, 171, 0.45) 0%, transparent 28%),
        radial-gradient(circle at 88% 12%, rgba(245, 209, 163, 0.42) 0%, transparent 32%),
        radial-gradient(circle at 50% 95%, rgba(196, 144, 124, 0.15) 0%, transparent 40%),
        repeating-linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.35) 0 38px,
            rgba(185, 142, 121, 0.1) 39px 40px
        );
}

html[data-theme="diary"] .frosted-glass {
    background: rgba(255, 249, 242, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(196, 148, 125, 0.28);
    border-radius: 28px;
    box-shadow: 0 24px 60px rgba(145, 93, 70, 0.14);
}

html[data-theme="diary"] header {
    top: 1rem;
    left: 1rem;
    right: 1rem;
    width: auto;
    border-radius: 999px;
    padding-inline: 1.4rem;
}

html[data-theme="diary"] .logo,
html[data-theme="diary"] #poems h2,
html[data-theme="diary"] section h2,
html[data-theme="diary"] .poem-title,
html[data-theme="diary"] .modal-title,
html[data-theme="diary"] .collections-list-container h3 {
    font-family: Georgia, "Times New Roman", serif;
    letter-spacing: 0.01em;
}

html[data-theme="diary"] .logo {
    font-size: 1.35rem;
    font-style: italic;
    color: #7e4a3d;
}

html[data-theme="diary"] nav a,
html[data-theme="diary"] .mobile-nav a {
    color: #6d4c40;
    font-size: 0.96rem;
}

html[data-theme="diary"] nav a:hover,
html[data-theme="diary"] .mobile-nav a:hover {
    color: #c56a5b;
}

html[data-theme="diary"] nav a::after {
    background-color: #c56a5b;
}

html[data-theme="diary"] .hamburger span {
    background-color: #7b5749;
}

html[data-theme="diary"] .theme-switcher {
    background: rgba(255, 245, 235, 0.84);
    border-color: rgba(191, 143, 119, 0.24);
}

html[data-theme="diary"] .theme-option {
    color: #755445;
    font-size: 0.84rem;
}

html[data-theme="diary"] .theme-option:hover,
html[data-theme="diary"] .theme-option.active {
    background: linear-gradient(135deg, rgba(240, 176, 160, 0.36), rgba(247, 218, 177, 0.4));
    color: #b85e4f;
    box-shadow: 0 8px 20px rgba(203, 129, 105, 0.16);
}

html[data-theme="diary"] main {
    max-width: 1180px;
    padding-top: calc(var(--header-height) + 3rem);
}

html[data-theme="diary"] #about {
    position: relative;
    overflow: hidden;
    padding: 3rem;
}

html[data-theme="diary"] #about::before {
    content: "letters for Sasha";
    position: absolute;
    top: 1.6rem;
    right: 2rem;
    font-size: 0.72rem;
    line-height: 1;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: rgba(174, 126, 105, 0.48);
}

html[data-theme="diary"] .about-avatar {
    width: 176px;
    height: 176px;
    border-radius: 34px;
    border: 10px solid rgba(255, 255, 255, 0.72);
    background: #f3e2d7;
    box-shadow: 0 22px 44px rgba(161, 104, 80, 0.18);
}

html[data-theme="diary"] .about-text p {
    color: #6b4c3e;
    opacity: 1;
    line-height: 1.9;
    font-size: clamp(1rem, 1.6vw, 1.2rem);
}

html[data-theme="diary"] .about-text b {
    color: #b65f50;
    font-style: italic;
}

html[data-theme="diary"] .btn {
    background: linear-gradient(135deg, rgba(250, 220, 193, 0.92), rgba(241, 178, 171, 0.88));
    border-color: rgba(193, 135, 113, 0.24);
    border-radius: 999px;
    color: #7d4f42;
    box-shadow: 0 18px 36px rgba(196, 121, 95, 0.16);
}

html[data-theme="diary"] .btn:hover {
    background: linear-gradient(135deg, rgba(247, 193, 175, 0.98), rgba(244, 170, 160, 0.94));
    border-color: rgba(192, 99, 83, 0.35);
    color: #a84d41;
    box-shadow: 0 24px 48px rgba(196, 121, 95, 0.24);
}

html[data-theme="diary"] #poems h2,
html[data-theme="diary"] #contact h2 {
    color: #7b4d40;
    font-size: 2.4rem;
    font-style: italic;
    font-weight: 500;
}

html[data-theme="diary"] .collections-list-container h3 {
    color: #bc6554;
    font-size: 1.25rem;
    font-style: italic;
}

html[data-theme="diary"] .collection-link {
    background: rgba(255, 250, 245, 0.8);
    border-color: rgba(199, 146, 123, 0.28);
    border-radius: 999px;
    color: #7a5548;
    opacity: 1;
}

html[data-theme="diary"] .collection-link:hover {
    background: rgba(248, 225, 209, 0.8);
    border-color: rgba(191, 106, 89, 0.34);
    color: #bc6554;
}

html[data-theme="diary"] .poems-container {
    gap: 1.8rem;
}

html[data-theme="diary"] .poem-card {
    position: relative;
    min-height: 290px;
    padding: 2.5rem 1.8rem 1.7rem;
    border-radius: 26px;
    background:
        linear-gradient(180deg, rgba(255, 252, 248, 0.95), rgba(251, 238, 226, 0.9)),
        rgba(255, 249, 242, 0.88);
    border-color: rgba(196, 148, 125, 0.24);
    box-shadow: 0 20px 42px rgba(141, 85, 61, 0.13);
}

html[data-theme="diary"] .poem-card::before {
    content: "";
    position: absolute;
    top: 0.9rem;
    left: 50%;
    width: 4rem;
    height: 1rem;
    border-radius: 999px;
    background: rgba(237, 194, 170, 0.6);
    transform: translateX(-50%) rotate(-2deg);
}

html[data-theme="diary"] .poem-card.visible:nth-child(odd) {
    transform: translateY(0) rotate(-0.8deg);
}

html[data-theme="diary"] .poem-card.visible:nth-child(even) {
    transform: translateY(0) rotate(0.8deg);
}

html[data-theme="diary"] .poem-card.visible:hover,
html[data-theme="diary"] .poem-card:focus-visible {
    transform: translateY(-8px) rotate(0deg);
    border-color: rgba(189, 100, 84, 0.42);
    box-shadow: 0 30px 54px rgba(141, 85, 61, 0.2);
}

html[data-theme="diary"] .poem-title {
    color: #7e4a3d;
    font-size: 1.4rem;
    font-style: italic;
    line-height: 1.25;
}

html[data-theme="diary"] .poem-excerpt {
    color: #6d4d40;
    opacity: 1;
    line-height: 1.8;
}

html[data-theme="diary"] .poem-meta,
html[data-theme="diary"] .modal-meta {
    color: #8a6556;
    opacity: 1;
    border-top-color: rgba(195, 144, 121, 0.22);
}

html[data-theme="diary"] .poem-meta .likes,
html[data-theme="diary"] .modal-meta .likes,
html[data-theme="diary"] .modal-meta a:hover,
html[data-theme="diary"] .modal-related-poem:hover,
html[data-theme="diary"] .modal-related-link:hover {
    color: #c26051;
}

html[data-theme="diary"] .poems-container .loading {
    color: #bc6554;
}

html[data-theme="diary"] .poems-container .error {
    color: #b24b4b;
}

html[data-theme="diary"] .modal {
    background: rgba(90, 57, 44, 0.22);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

html[data-theme="diary"] .modal-content-wrapper {
    border-radius: 34px;
}

html[data-theme="diary"] .modal-content {
    padding: 2.4rem;
}

html[data-theme="diary"] .modal-title {
    color: #7b4d40;
    font-size: 2rem;
    font-style: italic;
}

html[data-theme="diary"] .modal-poem {
    color: #65483c;
    opacity: 1;
    line-height: 1.9;
    font-size: 1.08rem;
}

html[data-theme="diary"] .modal-close,
html[data-theme="diary"] .modal-back-button,
html[data-theme="diary"] .modal-meta span,
html[data-theme="diary"] .modal-meta a,
html[data-theme="diary"] .modal-related-poem,
html[data-theme="diary"] .modal-related-link {
    color: #7a5548;
}

html[data-theme="diary"] .modal-back-button {
    border-color: rgba(195, 144, 121, 0.24);
    border-radius: 999px;
    background: rgba(255, 249, 242, 0.52);
}

html[data-theme="diary"] .modal-back-button:hover {
    background: rgba(248, 225, 209, 0.75);
    border-color: rgba(191, 106, 89, 0.28);
}

html[data-theme="diary"] #modalRelatedContent h3,
html[data-theme="diary"] #modalRelatedContent h4 {
    color: #b85e4f;
}

html[data-theme="diary"] #contact p,
html[data-theme="diary"] .contact-links a {
    color: #6d4d40;
    opacity: 1;
}

html[data-theme="diary"] .contact-links a:hover {
    color: #c26051;
}

html[data-theme="diary"] footer {
    color: #8e6c5d;
    opacity: 1;
    border-top-color: rgba(195, 144, 121, 0.22);
}

html[data-theme="diary"] footer a:hover {
    color: #c26051;
    text-decoration-color: rgba(194, 96, 81, 0.5);
}

html[data-theme="diary"] .overlay {
    background: rgba(83, 51, 39, 0.24);
}

@media (max-width: 768px) {
    html[data-theme="diary"] header {
        top: 0.75rem;
        left: 0.75rem;
        right: 0.75rem;
        padding-inline: 1rem;
    }

    html[data-theme="diary"] #about {
        padding: 2.2rem 1.4rem 1.8rem;
    }

    html[data-theme="diary"] #about::before {
        top: 1.1rem;
        right: 1.3rem;
        font-size: 0.64rem;
    }

    html[data-theme="diary"] .about-avatar {
        width: 148px;
        height: 148px;
        border-radius: 28px;
    }

    html[data-theme="diary"] #poems h2,
    html[data-theme="diary"] #contact h2 {
        font-size: 1.95rem;
    }

    html[data-theme="diary"] .poem-card {
        min-height: 250px;
    }

    html[data-theme="diary"] .modal-content {
        padding: 2rem 1.4rem 1.6rem;
    }
}
