/* ============================================================
   Custom CSS — extends Tailwind utility classes
   ============================================================ */

/* ----- Backgrounds ----- */
.ivory-bg {
    background-image:
        radial-gradient(ellipse at 20% 10%, rgba(180,140,80,0.10), transparent 50%),
        radial-gradient(ellipse at 80% 90%, rgba(160,120,60,0.12), transparent 55%),
        radial-gradient(circle at 50% 50%, rgba(245,232,200,1) 0%, rgba(232,215,175,1) 100%);
    min-height: 100vh;
}

/* ----- Antique manor side atmosphere ----- */
.mansion-side-bg {
    position: fixed;
    top: 0;
    bottom: 0;
    width: clamp(220px, 26vw, 430px);
    pointer-events: none;
    background-repeat: no-repeat;
    background-size: cover;
    opacity: 0.34;
    z-index: 0;
}

.mansion-side-bg-left {
    left: 0;
    background-image: url("images/bg-mansion-left.png");
    background-position: left center;
    -webkit-mask-image: linear-gradient(to right, #000 0%, #000 48%, rgba(0,0,0,0.72) 66%, transparent 100%);
    mask-image: linear-gradient(to right, #000 0%, #000 48%, rgba(0,0,0,0.72) 66%, transparent 100%);
}

.mansion-side-bg-right {
    right: 0;
    background-image: url("images/bg-mansion-right.png");
    background-position: right center;
    -webkit-mask-image: linear-gradient(to left, #000 0%, #000 48%, rgba(0,0,0,0.72) 66%, transparent 100%);
    mask-image: linear-gradient(to left, #000 0%, #000 48%, rgba(0,0,0,0.72) 66%, transparent 100%);
}

@media (max-width: 900px) {
    .mansion-side-bg {
        display: none;
    }
}

@media (max-width: 768px) {
    .mansion-side-bg {
        display: block;
        top: 0;
        bottom: auto;
        width: 64vw;
        height: 100dvh;
        min-height: 100vh;
        opacity: 0.30;
        background-size: cover;
    }
}

.parchment-bg {
    background-image:
        radial-gradient(ellipse at 20% 10%, rgba(180,140,80,0.10), transparent 50%),
        radial-gradient(ellipse at 80% 90%, rgba(160,120,60,0.12), transparent 55%),
        radial-gradient(circle at 50% 50%, rgba(252,244,220,1) 0%, rgba(238,222,188,1) 100%);
    box-shadow: inset 0 0 40px rgba(120,80,30,0.25);
}

/* ----- Oak wood frame ----- */
.oak-frame {
    border-radius: 4px;
    background-image:
        repeating-linear-gradient(90deg,
            rgba(74,47,22,0.18) 0px,
            rgba(110,75,38,0.06) 1px,
            rgba(74,47,22,0.20) 2px,
            rgba(140,95,50,0.04) 4px,
            rgba(74,47,22,0.14) 7px),
        repeating-linear-gradient(88deg,
            rgba(60,38,18,0.10) 0px,
            rgba(120,80,42,0.02) 14px,
            rgba(60,38,18,0.12) 28px),
        radial-gradient(ellipse at 18% 30%, rgba(50,30,14,0.55), transparent 35%),
        radial-gradient(ellipse at 78% 70%, rgba(50,30,14,0.45), transparent 40%),
        linear-gradient(180deg, #8b5a2b 0%, #6d4520 50%, #4a2f16 100%);
    box-shadow:
        inset 0 0 0 2px rgba(40,24,8,0.6),
        inset 0 0 0 6px rgba(180,140,80,0.25),
        inset 0 0 22px rgba(20,10,0,0.55),
        0 8px 28px rgba(40,22,8,0.35);
}

/* ----- Brass corner bolts ----- */
.corner-deco {
    position: absolute;
    width: 38px;
    height: 38px;
    background: radial-gradient(circle at 30% 30%, #f5d98a, #8b6914 70%);
    border: 1.5px solid #4a2f16;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5), inset 0 -2px 4px rgba(0,0,0,0.4);
    z-index: 5;
}

/* ----- Award inner background ----- */
.award-inner-bg {
    background: radial-gradient(ellipse at center, rgba(252,244,220,0.95) 0%, rgba(238,222,188,0.85) 100%);
}

/* ----- Award certificate images ----- */
.award-image-card img {
    display: block;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 14px 24px rgba(70, 38, 10, 0.18));
}

/* ----- Author name gradient ----- */
.author-name-grad {
    font-family: 'Yuji Syuku', 'Shippori Mincho', serif;
    background: linear-gradient(180deg, #6b3f1a 0%, #4a2811 45%, #2a1608 80%, #5a3216 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 1px 0 rgba(255,230,180,0.35);
    filter: drop-shadow(0 2px 3px rgba(40,20,8,0.45));
}

/* ----- Hero name board ----- */
.hero-sign-header {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-bottom: 2.5rem;
    overflow: hidden;
    text-align: center;
}

.hero-name-board {
    display: block;
    width: min(100%, 1120px);
    max-width: none;
    height: auto;
    margin: 0 auto;
    filter: drop-shadow(0 18px 28px rgba(54, 30, 12, 0.22));
}

@media (max-width: 640px) {
    .hero-sign-header {
        margin-top: -0.5rem;
        margin-bottom: 1.75rem;
    }

    .hero-name-board {
        width: 100%;
    }
}

/* ----- Nouveau gold gradient text ----- */
.nouveau-text {
    background: linear-gradient(180deg, #f5d98a 0%, #c9a14a 45%, #8b6914 75%, #d9b366 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 1px 0 rgba(255,240,200,0.4);
}

/* ----- Bookshelf interior ----- */
.shelf-bg {
    background: linear-gradient(180deg,
        rgba(50,30,15,0.55) 0%,
        rgba(80,50,25,0.35) 50%,
        rgba(50,30,15,0.55) 100%);
    box-shadow: inset 0 0 60px rgba(0,0,0,0.6);
}

/* ----- Shelf board (wooden plank) ----- */
.shelf-board {
    background-image:
        repeating-linear-gradient(90deg,
            rgba(74,47,22,0.18) 0px,
            rgba(110,75,38,0.06) 1px,
            rgba(74,47,22,0.20) 2px,
            rgba(140,95,50,0.04) 4px,
            rgba(74,47,22,0.14) 7px),
        linear-gradient(180deg, #8b5a2b 0%, #6d4520 50%, #4a2f16 100%);
    box-shadow:
        0 4px 12px rgba(0,0,0,0.6),
        inset 0 -2px 4px rgba(0,0,0,0.5),
        inset 0 1px 1px rgba(255,220,160,0.2);
}

/* ----- Book caption ----- */
.caption-bg {
    background: linear-gradient(180deg, rgba(252,244,220,0.95), rgba(238,222,188,0.92));
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* ----- Book 3D effect ----- */
.book-3d {
    transform-style: preserve-3d;
    transition: all 0.5s cubic-bezier(.2, .8, .2, 1);
    box-shadow:
        8px 6px 18px rgba(20,10,4,0.55),
        inset -6px 0 12px rgba(0,0,0,0.35),
        inset 4px 0 4px rgba(255,240,200,0.25);
}
.book-3d:hover {
    transform: translateY(-14px) rotate(-1.2deg);
}

/* ----- Cat button hover ----- */
.cat-btn {
    transition: all 0.4s cubic-bezier(.2, .9, .3, 1);
}
.cat-btn:hover {
    transform: translateY(-6px) scale(1.05);
}

@keyframes cat-blink {
    0%, 92%, 100% { transform: scaleY(1); }
    95% { transform: scaleY(0.1); }
}
.cat-btn:hover .cat-eye {
    transform-origin: center;
    animation: cat-blink 0.5s;
}

/* ----- Link image buttons ----- */
.link-image-btn {
    display: block;
    border-radius: 18px;
    outline-offset: 5px;
    transition: transform 0.35s cubic-bezier(.2,.9,.3,1);
}

.link-image-btn img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 18px;
    filter: drop-shadow(0 12px 18px rgba(70, 38, 10, 0.18));
    transition: transform 0.35s cubic-bezier(.2,.9,.3,1), filter 0.35s ease;
}

.link-image-btn:hover img,
.link-image-btn:focus-visible img {
    transform: translateY(-5px);
    filter: drop-shadow(0 16px 24px rgba(70, 38, 10, 0.24));
}

.link-image-btn:focus-visible {
    outline: 2px solid rgba(139, 94, 52, 0.72);
}

/* ----- Contact image card ----- */
.contact-image-link {
    display: block;
    width: min(100%, 680px);
    margin: 0 auto;
    text-decoration: none;
    border-radius: 28px;
    outline-offset: 6px;
}

.contact-card-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 28px;
    box-shadow: 0 18px 34px rgba(70, 38, 10, 0.20);
    transition: transform 0.35s cubic-bezier(.2,.9,.3,1), box-shadow 0.35s ease;
}

.contact-image-link:hover img,
.contact-image-link:focus-visible img {
    transform: translateY(-6px);
    box-shadow: 0 24px 42px rgba(70, 38, 10, 0.26);
}

.contact-image-link:focus-visible {
    outline: 2px solid rgba(139, 94, 52, 0.72);
}

/* ----- Works title image ----- */
.section-title-logo,
.works-title-logo {
    display: block;
    height: auto;
}

.section-title-logo-awards {
    width: min(100%, 680px);
}

.section-title-logo-links {
    width: min(100%, 640px);
}

.section-title-logo-contact {
    width: min(100%, 720px);
}

.section-title-logo-author {
    width: min(100%, 700px);
    filter: drop-shadow(0 14px 24px rgba(54, 30, 12, 0.20));
}

.works-title-logo {
    width: min(100%, 820px);
}

.author-info-book-image {
    display: block;
    width: min(100%, 820px);
    height: auto;
    filter: drop-shadow(0 16px 28px rgba(54, 30, 12, 0.18));
}

@media (max-width: 768px) {
    .section-title-logo-author {
        width: min(100%, 580px);
    }

    .author-info-book-image {
        width: min(100%, 680px);
    }
}

/* ----- Garden footer ----- */
.site-footer-garden {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    overflow: hidden;
}

.site-footer-garden .footer-divider,
.site-footer-garden .footer-copyright {
    width: min(100%, 64rem);
    margin-left: auto;
    margin-right: auto;
}

.footer-garden-scene {
    width: 100%;
    margin: 0 auto;
    overflow: hidden;
}

.footer-garden-scene img {
    display: block;
    width: 100%;
    min-height: 320px;
    max-height: 560px;
    object-fit: cover;
    object-position: center bottom;
    filter: drop-shadow(0 -12px 24px rgba(54, 30, 12, 0.12));
}

.footer-copyright {
    position: relative;
    z-index: 1;
    margin-top: 1.25rem;
    padding: 0 1.25rem 2rem;
}

@media (max-width: 768px) {
    .footer-garden-scene img {
        min-height: 280px;
        object-position: center bottom;
    }

    .footer-copyright {
        letter-spacing: 0.22em;
    }
}

/* ----- Floating paw animation ----- */
@keyframes paw-walk {
    0%, 100% { opacity: 0.15; transform: translateY(0); }
    50%       { opacity: 0.35; transform: translateY(-3px); }
}
.paw-anim {
    animation: paw-walk 3s ease-in-out infinite;
}

/* ----- Scroll fade-in ----- */
.fade-up {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.85s ease, transform 0.85s ease;
}
.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}
