/******************************************************************************
 * 1. GLOBAL RESETS & BASE STYLES
 ******************************************************************************/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 
   Animated tiling texture (64×64px):
   Diagonal scroll over 240s from (0,0) to (1280px, -1280px).
*/
html,
body {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    background-color: #f8f8fb;
    color: #333;
    line-height: 1.6;
    min-height: 100%;

    background-image: url("/static/texture.png");
    background-repeat: repeat;
    background-size: 64px 64px;

    animation: scrollTexture 240s linear infinite;
}

a {
    color: #7269ef;
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

a:hover {
    color: #6058d4;
}

@keyframes scrollTexture {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 1280px -1280px;
    }
}

.hidden {
    display: none !important;
}

/******************************************************************************
 * 2. SHARED SITE STYLES
 ******************************************************************************/
.header-box,
.nav-box,
.content-box,
.footer-box {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    z-index: 1;
}

/* HEADER */
.header-box {
    text-align: center;
    padding: 1rem 0.5rem;
    margin-top: 1rem;
    margin-bottom: 0.75rem;
    background-color: #7269ef;
    border-radius: 4px;
    box-shadow: none;
    color: #fff;
}

.header-box h1 {
    font-size: 1.8rem;
    margin: 0.5rem 0;
    letter-spacing: 0.5px;
}

/* Make the site name a link without changing h1 style */
.header-box h1 a {
    color: inherit;
    text-decoration: none;
}

.header-box h1 a:hover {
    text-decoration: underline;
}

/******************************************************************************
 * 3. NAV BOX
 ******************************************************************************/
.nav-box {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #fff;
    border: 1px solid #e1e1e8;
    border-radius: 4px;
    padding: 0.25rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.nav-box a {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    text-decoration: none;
    color: #54546b;
    border-radius: 4px;
    margin: 0 0.25rem;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.nav-box a:hover {
    background-color: #f0efff;
    color: #333;
}

/******************************************************************************
 * 4. CONTENT AREA
 ******************************************************************************/
.content-box {
    position: relative;
    z-index: 1;
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
}

.content-box h2 {
    font-size: 1.6rem;
    color: #3a3a50;
    margin-bottom: 1rem;
}

.content-box p {
    margin-bottom: 1rem;
    color: #555;
}

.content-box ul {
    list-style-type: disc;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.content-box ol {
    list-style-type: decimal;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.content-box li {
    margin-bottom: 0.5rem;
}

.content-box pre:has(code) {
    font-family: "Courier New", Courier, monospace;
    background-color: #f8f8fb;
    padding: 0.1rem 0.25rem;
    border-radius: 4px;

    position: relative;
    margin: 1rem 0;
    padding: 1rem;
    overflow: auto;
    white-space: pre-wrap;
}

.content-box pre:has(code) button {
    position: absolute;
    top: 5px;
    right: 5px;
    border: none;

    padding: 0.25rem 0.5rem;
    text-align: center;
    font-size: 0.8rem;
    background-color: transparent;
    color: #7269ef;

}

.content-box pre:has(code) button:hover {
    color: #6058d4;
    background-color: #f0efff;
}

.content-box img {
    border-radius: 4px;
    display: block;
    max-width: 75%;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
    max-height: 60vh;
    object-fit: contain;
}

.content-box iframe {
    border-radius: 4px;
    display: block;
    max-width: 75%;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

.content-box hr {
    border: none;
    border-top: 1px solid #e1e1e8;
    margin: 1rem 0;
}

.content-box .toc {
    margin-bottom: 1rem;
}

.content-box .toc ul {
    list-style-type: none;
    margin-left: 0;
    padding-left: 1rem;
}

.content-box .toc li {
    margin-bottom: 0.25rem;
}

/******************************************************************************
 * 5. FOOTER
 ******************************************************************************/
.footer-box {
    text-align: center;
    padding: 0.5rem 0;
    background-color: #7269ef;
    border-radius: 4px;
    box-shadow: none;
    color: #fff;
    margin-bottom: 1rem;
}

.footer-nav {
    margin-top: 0.25rem;
}

.footer-nav a {
    text-decoration: none;
    color: #e0e0ff;
    font-size: 0.85rem;
    margin: 0 0.25rem;
    transition: color 0.2s ease-in-out;
}

.footer-nav a:hover {
    color: #fff;
}

.footer-icon {
    width: 16px;
    filter: invert(100%) sepia(99%) saturate(3422%) hue-rotate(180deg) brightness(101%) contrast(103%);
}

.footer-icon:hover {
    filter: invert(94%) sepia(47%) saturate(2%) hue-rotate(28deg) brightness(112%) contrast(101%);
}

/******************************************************************************
 * 6. LINKTREE-STYLE HOMEPAGE
 ******************************************************************************/
.linktree-nav.nav-thin {
    width: 100%;
    background-color: #f8f8fb;
    border-bottom: 1px solid #eee;
    margin-bottom: 0.75rem;
    text-align: center;
    padding: 0.5rem 0;
    box-shadow: none;
}

.linktree-nav.nav-thin .nav-box {
    width: 90%;
    margin: 0 auto;
    background: none;
    border: none;
    box-shadow: none;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
}

.linktree-nav.nav-thin .nav-box a {
    font-size: 0.9rem;
    color: #666;
    padding: 0.5rem 0.75rem;
    text-decoration: none;
    transition: color 0.2s ease-in-out;
    margin: 0 0.25rem;
    border-radius: 4px;
}

.linktree-nav.nav-thin .nav-box a:hover {
    color: #333;
    background: none;
}

.linktree-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 90%;
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    padding: 2rem 1rem;
}

/* Avatar & Profile */
.avatar-section {
    margin-bottom: 1rem;
}

.avatar-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
}

.username {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.tagline {
    font-size: 1rem;
    color: #555;
    margin-bottom: 1.5rem;
}

/* Link List */
.link-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 400px;
}

.linktree-btn {
    display: block;
    text-decoration: none;
    background-color: #7269ef;
    color: #fff;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 1rem;
    transition: background-color 0.2s ease-in-out;
}

.linktree-btn:hover {
    background-color: #6058d4;
    color: #fff;
}

/* Thin Footer */
.linktree-footer {
    width: 100%;
    background: none;
    margin-top: 1rem;
    text-align: center;
}

.footer-thin {
    display: inline-block;
    margin: 0 auto;
    border: none;
    box-shadow: none;
    padding: 0;
}

.footer-thin a {
    font-size: 0.8rem;
    color: #999;
    margin: 0 0.25rem;
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

.footer-thin a:hover {
    color: #666;
}

/* Section Heading */
.linktree-section-heading {
    font-size: 1.2rem;
    color: #333;
    text-align: center;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

/******************************************************************************
 * 7. RIGHT-SIDE DRAWER FOR LINKTREE
 ******************************************************************************/
.linktree-drawer {
    position: fixed;
    top: 7rem;
    right: 0;
    width: 250px;
    transition: transform 0.3s ease-in-out;
    z-index: 5;
    background-color: #fff;
    box-shadow: -2px 0 4px rgba(0, 0, 0, 0.15);
    border-left: 1px solid #e1e1e8;
    padding: 1rem;
    box-sizing: border-box;
}

.linktree-drawer:hover {
    transform: translateX(0);
}

/* Arrow “handle” */
.drawer-handle {
    position: absolute;
    top: 40%;
    left: -30px;
    width: 30px;
    height: 30px;
    background-color: #fff;
    border: 1px solid #e1e1e8;
    border-right: none;
    border-radius: 4px 0 0 4px;
    box-shadow: -2px 2px 4px rgba(0, 0, 0, 0.1);
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.drawer-handle::before {
    content: "›";
    color: #54546b;
    font-size: 1.2rem;
    transform: translateX(1px);
}

.drawer-small-text {
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

/* Adjust main content to avoid overlap */
.linktree-container {
    padding-right: 3rem;
}


.bottom-border-container {
    position: relative;
    bottom: 0;
    z-index: 0;
    width: 100%;
    height: calc(100vh - 85.5vh);
    min-height: 10vh;
    overflow: hidden;


    /* Fade out the container's contents (images) into transparency at the top */
    -webkit-mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        black 25%,
        black 100%
      );
      mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        black 25%,
        black 100%
      );

    /* Make sure the gradient stretches across the entire element */
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

.bottom-border-container img {
    position: absolute;
    overflow: visible;
    transform: translate(-50%, -50%);
    max-width: 250px;
    max-height: 250px;
    object-fit: contain;
    pointer-events: none;

    filter: url(#customGrayscale);
    -webkit-filter: url(#customGrayscale);

    /* Fade out the edges of the image */
    mask-image: radial-gradient(circle, transparent 0%, black 25%, black 100%);
    -webkit-mask-image: radial-gradient(circle, transparent 0%, black 25%, black 100%);
}

#bluesky-feed {
    position: fixed;
    top: 7rem;
    left: 0;
    background-color: #fff;
    padding: 1rem;

    width: 250px;

    max-height: 66%;
    overflow: scroll;

    transition: transform 0.3s ease-in-out;

    box-shadow: -2px 0 4px rgba(0, 0, 0, 0.15);
    border-right: 1px solid #e1e1e8;
}

#bluesky-feed img {
    width: 100%;
}

#bluesky-feed .post-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

#bluesky-feed .author {
    font-weight: 600;
    vertical-align: middle;
}

#bluesky-feed .avatar {
    width: 24px;
    height: 24px;
    border-radius: 25%;
    object-fit: cover;
    margin-right: 0.5rem;
}

#bluesky-feed .post-content {
    margin-bottom: 1rem;
}

/******************************************************************************
 * 8. RESPONSIVE DESIGN
 ******************************************************************************/


@media (max-width: 768px) {
    #bluesky-feed {
        transform: translateX(-250px);
    }

    .nav-box {
        flex-direction: column;
        align-items: center;
    }

    .nav-box a {
        border-bottom: 1px solid #e1e1e8;
        width: 100%;
        text-align: center;
        margin: 0;
        border-radius: 0;
    }

    .nav-box a:first-child {
        padding-top: 0 !important;
    }

    .nav-box a:last-child {
        border-bottom: none;
        padding-bottom: 0 !important;
    }

    .header-box h1 {
        font-size: 1.6rem;
    }

    .content-box {
        padding: 1rem;
    }

    .content-box h2 {
        font-size: 1.4rem;
    }

    .linktree-drawer {
        transform: translateX(248px);
    }

    .drawer-handle {
        display: flex;
    }
}

@media (min-width: 769px) {
    #bluesky-feed {
        transform: translateX(0px);
    }

    .linktree-drawer {
        transform: translateX(0px);
    }

    .drawer-handle {
        display: none;
    }
}


/******************************************************************************
 * 9. Blog
 ******************************************************************************/

.blog-post {
    display: block;
    text-decoration: none;
    color: #333;
    padding: 0rem;
    background-color: #e0e0f0;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    margin-bottom: 1rem;
    padding-top: 0.5rem;
    transition: background-color 0.2s ease-in-out;
    filter: brightness(99.99%);
}

.blog-post .blog-post-title {
    font-size: 1.4rem;
    padding: 1rem;
}

.blog-post-date {
    font-size: 0.8rem;
    color: #ccc;
    padding: 0.5rem;
    position: absolute;
    bottom: 0;
    right: 0;

    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

.blog-post img {
    padding: 0;
    margin-left: 0;
    margin-right: 0;

    border-radius: 0 0 4px 4px;

    /* Give a max height while cropping the height while keeping the width */
    max-width: 100%;
    min-width: 100%;
    max-height: 8rem;
    object-fit: cover;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

.blog-post:hover {
    filter: brightness(90%);
}

.rss-feed-link {
    display: block;
    text-decoration: none;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 0.9rem;
}
  