/* css/style.css */

/* --- ROOT VARIABLES --- */
:root {
    --bg-color: #0f0f0f;
    --card-bg: #181818;
    --text-main: #e0e0e0;
    --text-muted: #a0a0a0;
    --border: #333;
    --accent: #40c4ff;
}

/* --- EROTIC THEME OVERRIDES --- */
body.theme-erotic {
    --bg-color: #0b0709;
    --card-bg: #140c10;
    --text-main: #f0e7ea;
    --text-muted: #b39aa5;
    --border: #3a1f2b;
    --accent: #c03a5b; /* Crimson */
    background-image: none; /* Remove the grey radial gradient */
    background-color: var(--bg-color);
}

/* --- EXPERIMENTAL THEME (The Negative) --- */
body.theme-experimental {
    /* The "Room" color (Light) - This is the bottom/edges of the page */
    --bg-color: #e0e0e0;
    /* The "Shadow" color - This is the dark spot at the top */
    --shadow-color: #666666;
    --card-bg: #ffffff;
    --text-main: #000000;
    --text-muted: #444444;
    --border: #bfbfbf;
    --accent: #bf3b00;
    /* Gradient: Starts Dark (Top Center) -> Fades to Light (Edges) */
    background-image: radial-gradient(circle at 50% 0%, var(--shadow-color) 0%, var(--bg-color) 85%);
    background-color: var(--bg-color);
}

    /* Force specific elements to adapt to the light theme */
    /* Force headings to Black */
    body.theme-experimental h1,
    body.theme-experimental h2,
    body.theme-experimental h3 {
        color: #000000;
        text-shadow: none; /* Removes the white glow so the black text is crisp */
    }

    /* Force subheadings to Black */
    body.theme-experimental .section-subhead {
        color: #000000;
        font-weight: 600; /* Making them slightly bolder helps readability */
    }
    

    body.theme-experimental .card {
        box-shadow: 0 4px 12px rgba(0,0,0,0.05); /* Soft shadow for depth */
        border-color: #d1d1d1;
    }

    /* Invert the social buttons so they don't look washed out */
    body.theme-experimental .social-btn {
        background: #f5f5f5;
        border-color: #ccc;
        color: #333;
    }

        /* Invert specific social hovers to Black for this theme */
        body.theme-experimental .social-btn.github:hover,
        body.theme-experimental .social-btn.blcklst:hover {
            border-color: #000000 !important;
            color: #000000 !important;
            box-shadow: 0 0 10px rgba(0,0,0,0.5); /* Dark shadow instead of light glow */
        }


/* --- GLOBAL LAYOUT --- */
* { box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at 50% 0%, #252525 0%, #0f0f0f 60%);
    background-repeat: no-repeat;
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.theme-erotic {
     background-image: radial-gradient(circle at 50% 0%, #2b141f 0%, #0b0709 60%);
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
    flex: 1; /* Pushes footer down */
    width: 100%;
}

.main-divider {
    max-width: 900px;
    margin: 0 auto;
    border-top: 1px solid var(--border);
    width: 100%;
    height: 1px;
    display: block;
}

/* --- HEADER --- */
header {
    padding: 100px 0 60px;
    text-align: center;
    position: relative;
    z-index: 2;
}

h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin: 0 0 10px 0;
    letter-spacing: -2px;
    color: #ffffff;
    text-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 50px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* --- SOCIAL BUTTONS --- */
.social-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.social-btn {
    position: relative;
    text-decoration: none;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 160px;
    height: 48px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    color: var(--text-muted);
}

.btn-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.social-btn:hover .btn-content { transform: translateY(-48px); }

.btn-face {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.95rem;
}

.btn-face.handle {
    font-family: monospace;
    font-size: 0.85rem;
    color: inherit;
}

.btn-icon-img {
    height: 18px;
    width: auto;
    filter: grayscale(100%) brightness(1.5);
    transition: filter 0.2s;
}

.btn-icon-svg {
    height: 18px;
    width: 18px;
    fill: currentColor;
    transition: fill 0.2s;
}

/* Social Hover Colors */
.social-btn.bsky:hover { border-color: #0085ff !important; color: #0085ff !important; box-shadow: 0 0 12px rgba(0, 133, 255, 0.3); }
.social-btn.bsky:hover .btn-icon-img { filter: none; }
.social-btn.substack:hover { border-color: #ff6719 !important; color: #ff6719 !important; box-shadow: 0 0 12px rgba(255, 103, 25, 0.3); }
.social-btn.github:hover { border-color: #ffffff !important; color: #ffffff !important; box-shadow: 0 0 8px rgba(255,255,255,0.4); }
.social-btn.blcklst:hover { border-color: #444 !important; color: #444 !important; box-shadow: 0 0 8px #444; }
.social-btn.discord:hover { border-color: #5865F2 !important; color: #5865F2 !important; box-shadow: 0 0 12px rgba(88, 101, 242, 0.3); }
.social-btn:hover i { color: inherit !important; }

/* --- CONTENT SECTIONS --- */
section { margin-top: 60px; margin-bottom: 60px; }

h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

h2::before {
    content: '';
    display: block;
    width: 6px;
    height: 24px;
    background: var(--accent);
    border-radius: 2px;
}

.section-subhead {
    color: var(--text-muted);
    margin-bottom: 30px;
    margin-top: 0;
    font-size: 0.95rem;
    padding-left: 20px;
}

/* --- GRID & CARDS --- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    align-items: start;
}

.card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 16px;
    border: 1px solid var(--border);
    transition: transform 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
}

.card:hover { transform: translateY(-5px); border-color: #444; }

.card-type {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 15px;
}

.card h3 { margin: 0 0 10px 0; font-size: 1.5rem; font-weight: 700; }
.card p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 25px; flex-grow: 1; }

.btn-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    color: #0f0f0f;
    background: var(--accent);
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: opacity 0.2s;
    margin-top: auto; /* Pushes button to bottom of card */
}

.btn-download:hover { opacity: 0.9; }

/* Stacked Buttons for Poetry */
.btn-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
    width: 100%;
}

.btn-stack .btn-download {
    width: 100%;
}

/* --- WIDGETS (Bluesky/Substack) --- */
.widget-wrapper {
    background: #161616;
    border-radius: 16px;
    border: 1px solid var(--border);
    max-width: 600px;
    margin: 0 auto 30px auto;
    overflow: hidden;
}
.widget-header { background: #000; padding: 15px 20px; border-bottom: 1px solid #333; display: flex; align-items: center; gap: 10px; font-weight: 700; color: #fff; }
.widget-logo-img { height: 20px; width: auto; }
.substack-placeholder { padding: 40px; text-align: center; color: #666; font-style: italic; }
.bsky-post { padding: 20px; border-bottom: 1px solid #2a2a2a; }
.bsky-post:last-child { border-bottom: none; }
.reply-root { margin-bottom: 12px; padding-left: 12px; border-left: 2px solid #333; color: #888; font-size: 0.85rem; }
.post-main { display: flex; gap: 15px; }
.avatar { width: 45px; height: 45px; border-radius: 50%; background: #333; object-fit: cover; }
.post-content { flex: 1; }
.user-line { display: flex; align-items: baseline; gap: 6px; margin-bottom: 4px; }
.u-name { font-weight: 700; color: #fff; }
.u-handle { color: #888; font-size: 0.9rem; }
.p-text { margin: 0; color: #eee; font-size: 0.95rem; white-space: pre-wrap; }
.bsky-img { width: 100%; border-radius: 8px; margin-top: 10px; border: 1px solid #333; }
.post-link { display: block; margin-top: 10px; font-size: 0.8rem; color: #0085ff; text-decoration: none; }

/* --- FOOTER --- */
footer {
    text-align: center;
    padding: 60px 20px 40px;
    color: var(--text-muted);
    font-size: 0.9rem;
}
footer a { color: var(--text-muted); }

/* --- ARTIFICTION CARD --- */
.artifiction-card {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 40px 30px;
    text-align: center;
    max-width: 450px;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: transform 0.3s;
}
.artifiction-card:hover { transform: scale(1.02); border-color: #555; }
.art-icon { font-size: 2.5rem; color: #fff; margin-bottom: 20px; }
.art-author { font-size: 0.8rem; letter-spacing: 1px; text-transform: uppercase; color: #aaa; margin-bottom: 10px; }
.art-title { font-size: 2rem; font-weight: 900; text-transform: uppercase; color: #fff; margin: 0 0 30px 0; letter-spacing: 1px; text-shadow: 0 0 10px rgba(255,255,255,0.2); }
.art-logline { font-size: 1rem; line-height: 1.6; color: #ccc; margin-bottom: 40px; font-weight: 400; }
.art-meta { font-size: 0.8rem; letter-spacing: 1px; color: #e6b17e; text-transform: uppercase; font-weight: 700; margin-bottom: 20px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.art-tags { display: flex; justify-content: center; gap: 10px; }
.tag-pill { background: transparent; border: 1px solid #444; color: #fff; padding: 6px 16px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; }

/* --- POETRY PAGE STYLES --- */

/* The Title Area */
.poem-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

    .poem-header h2 {
        margin: 0;
        font-size: 2rem;
        text-transform: lowercase; /* Optional: keeps the 'what you are' vibe */
        letter-spacing: -1px;
    }

/* The Black Box */
.poem-panel {
    background: #000;
    border: 1px solid #333;
    padding: 40px;
    border-radius: 4px;
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
    margin-bottom: 30px;
}

/* The Poem Text */
.poem-text pre {
    white-space: pre-wrap; /* Allows wrapping on small screens */
    font-family: 'Courier New', Courier, monospace;
    font-size: 1rem;
    color: #ccc;
    line-height: 1.4;
    margin: 0;
}

/* Tighten the lines for poetry paragraphs */
.poem-text p {
    line-height: 1.2; /* Makes lines sit closer together */
    margin-bottom: 1.5rem; /* Keeps the gap between Stanzas (paragraphs) */
}

/* --- SPECIAL POEM FORMATTING --- */

/* Constrains the width so right-aligned text stays close to the center */
.poem-narrow {
    max-width: 380px; /* Adjust this number to make the column wider/thinner */
    margin: 0 auto; /* Keeps the column centered in the black box */
}

/* Helper to push stanzas to the right */
.text-right {
    text-align: right;
}

/* Styling for poems that are images */
.poem-img {
    width: 100%; /* Forces image to fit the container width */
    height: auto; /* Keeps the aspect ratio correct */
    display: block; /* Removes tiny gaps underneath images */
    border-radius: 4px; /* Optional: smooths the corners slightly */
}

.back-link {
    display: inline-block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    border-bottom: 1px solid transparent;
    transition: all 0.2s;
}

    .back-link:hover {
        color: var(--accent);
        border-bottom-color: var(--accent);
    }

/* --- BLUESKY WIDGET EXTRAS --- */
/* Replies */
.reply-meta {
    display: flex;
    gap: 6px;
    font-size: 0.8rem;
    margin-bottom: 4px;
}

.reply-author {
    font-weight: 700;
    color: #bbb;
}

.reply-text {
    font-style: italic;
    color: #666;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Quoted Posts */
.quote-box {
    margin-top: 12px;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 12px;
    background: #111;
}

.quote-header {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.quote-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.quote-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff;
}

.quote-handle {
    color: #777;
    font-size: 0.85rem;
}

.quote-text {
    font-size: 0.9rem;
    color: #ccc;
    margin-bottom: 8px;
}

/* --- BLUESKY MEDIA FIXES --- */

/* Force all widget images to fit inside the card */
.bsky-img {
    width: 100%; /* Forces image to match container width */
    max-width: 100%; /* Prevents it from ever getting bigger than the box */
    height: auto; /* Maintains aspect ratio */
    border-radius: 8px;
    margin-top: 10px;
    border: 1px solid #333;
    object-fit: cover; /* clean cropping */
    display: block;
}

/* Safety: Ensure the quote box cuts off anything that tries to escape */
.quote-box {
    max-width: 100%;
    overflow: hidden; /* The "safety scissors" */
    word-wrap: break-word; /* Breaks super long URLs if needed */
}

/* Ensure the quoted post header doesn't get squished */
.quote-header {
    flex-wrap: wrap;
}