* {
    box-sizing: border-box;
}

:root {
    --page-bg: #e5e9f0;
    --bg-pattern: #dce0e8;
    --doc-bg: #fdfdfb;
    --text-dark: #111827;
    --border-heavy: #1e293b;
    --accent-red: #b91c1c;
    --accent-blue: #1d4ed8;
    --link-blue: #1d4ed8;
    --paper-tint: #fefce8;
}

/* Dark Theme Overrides */
body.dark-theme {
    --page-bg: #0f172a;
    --bg-pattern: #1e293b;
    --doc-bg: #1e293b;
    --text-dark: #f8fafc;
    --border-heavy: #64748b;
    --accent-red: #f87171;
    --accent-blue: #2563eb;
    --link-blue: #60a5fa;
    --paper-tint: #273449;
}

body {
    background-color: var(--page-bg);
    color: var(--text-dark);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: flex;
    justify-content: center;
    padding: 20px;
    margin: 0;
}



.container {
    max-width: 850px;
    width: 100%;
    background-color: var(--doc-bg);
    padding: 40px;
    border: 2px solid var(--border-heavy);
    box-shadow: 8px 8px 0px rgba(30, 41, 59, 0.15);
    position: relative;
}

/* Top dossier binding aesthetic */
.container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 12px;
    background-color: var(--border-heavy);
}

.header {
    text-align: center;
    border-bottom: 3px double var(--border-heavy);
    padding-bottom: 20px;
    margin-bottom: 30px;
    margin-top: 10px;
}

h1 {
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 1px;
    margin: 0 0 8px 0;
}

.subtitle {
    font-size: 0.95rem;
    font-weight: bold;
    color: #475569;
    margin: 0;
    letter-spacing: 2px;
}

.director-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 40px;
}

.plaque {
    font-weight: bold;
    font-size: 0.9rem;
    padding: 8px 15px;
    background: var(--border-heavy);
    color: #fff;
    border-radius: 2px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.directive-box {
    border: 3px solid var(--border-heavy);
    padding: 30px 20px;
    position: relative;
    background-color: var(--paper-tint);
    min-height: 140px;
    margin-bottom: 30px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
    text-align: center;
}

.director-portrait {
    width: 420px;
    max-width: 100%;
    height: auto;
    border: 4px solid var(--border-heavy);
    padding: 4px;
    background: #fff;
    filter: grayscale(100%) contrast(120%);
    margin: 15px auto 25px auto; /* Centers the image and adds spacing below */
    display: block;
}

.stamp {
    position: absolute;
    top: -14px;
    left: 20px;
    background: var(--accent-red);
    color: white;
    padding: 4px 10px;
    font-size: 0.85rem;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-radius: 2px;
}

/* Keep stamp red dark in dark theme so white text stays legible */
body.dark-theme .stamp {
    background: #b91c1c;
}

#directive-id {
    font-size: 1.1rem;
    font-weight: bold;
    margin: 0 0 15px 0;
    color: var(--accent-red);
    border-bottom: 1px solid #d1d5db;
    padding-bottom: 5px;
}

#directive-text {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
}

.btn {
    display: block;
    width: 100%;
    padding: 16px;
    margin: 20px 0;
    background-color: var(--accent-blue);
    color: #fff;
    border: 2px solid #1e40af;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 4px 4px 0px rgba(29, 78, 216, 0.3);
    transition: all 0.1s;
}

.btn:hover {
    background-color: #1e40af;
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px rgba(29, 78, 216, 0.3);
}

.footer {
    border-top: 3px double var(--border-heavy);
    padding-top: 25px;
    text-align: center;
    font-size: 0.9rem;
}

.sponsor-box {
    background-color: var(--page-bg);
    border: 1px dashed var(--border-heavy);
    color: var(--text-dark);
    margin-bottom: 20px;
    padding: 12px;
}

.sponsor-link {
    font-weight: bold;
    color: var(--link-blue);
    text-decoration: none;
}

.sponsor-link:hover {
    text-decoration: underline;
}

.kofi-btn {
    background-color: var(--doc-bg); /* Switches with the theme */
    color: var(--text-dark);
    border: 2px solid var(--border-heavy);
    display: inline-block;
    padding: 12px 20px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.2s;
}

.kofi-btn:hover {
    background-color: var(--paper-tint);
}

.red-dont {
    color: var(--accent-red);
    font-weight: 900;
}

.typo-notice p {
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.typo-notice a {
    color: var(--link-blue);
    font-weight: bold;
    text-decoration: none;
}

.typo-notice a:hover {
    text-decoration: underline;
}

#close-notice {
    background: var(--border-heavy);
    color: white;
    border: none;
    padding: 8px;
    font-family: inherit;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    letter-spacing: 1px;
}

#close-notice:hover {
    background: #334155;
}


.typo-notice {
    background: var(--doc-bg); /* Switched from #fff */
    color: var(--text-dark);   /* Added to ensure text changes color */
    border: 3px solid var(--border-heavy);
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: none; /* Hidden on load */
    padding: 15px;
    width: 520px;
    box-shadow: 6px 6px 0px rgba(30, 41, 59, 0.2);
    font-size: 0.9rem;
    z-index: 1001;
}


.theme-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--doc-bg);
    color: var(--text-dark);
    border: 2px solid var(--border-heavy);
    padding: 8px 12px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 3px 3px 0px var(--border-heavy);
    text-transform: uppercase;
}

.theme-btn:hover {
    background: var(--paper-tint);
}

/* Move it to the top center on mobile so it doesn't block the screen edge */
@media (max-width: 850px) {
    .theme-btn {
        position: static;
        display: block;
        margin: 0 auto 20px auto;
    }
    .typo-notice {
        position: static;
        transform: none;
        width: auto;
        max-width: 100%;
        margin: 0 auto 20px auto;
    }
    body {
        flex-direction: column;
    }
}
