* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --paper: #faf8f3;
    --cream: #f5e6d3;
    --ink: #2a2a2a;
    --accent: #d35400;
    --highlight: #f39c12;
    --shadow: #7f8c8d;
    --fun: #e74c3c;
    --coffee: #8b6f47;
}

@font-face {
    font-family: sui;
    src: url(fonts/sui\ generis\ rg.otf);
}

body {
    font-family: 'Courier New', 'Georgia', monospace;
    background: var(--paper);
    color: var(--ink);
    overflow-x: hidden;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><path d="M6 2 L6 30 L14 24 L10 20 Z" fill="%232a2a2a"/></svg>') 4 2, auto;
}

/* Paper texture */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(139, 69, 19, 0.03) 2px,
            rgba(139, 69, 19, 0.03) 4px
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, .02) 2px,
            rgba(0, 0, 0, .02) 4px
        );
    pointer-events: none;
    z-index: 1;
}

/* Coffee stains */
.coffee-stain {
    position: fixed;
    width: 150px;
    height: 150px;
    background: radial-gradient(ellipse at center, 
        rgba(139, 90, 43, 0.15) 0%, 
        rgba(139, 90, 43, 0.08) 40%, 
        transparent 70%);
    border-radius: 50%;
    opacity: 0.6;
    pointer-events: none;
    animation: float 20s infinite ease-in-out;
    z-index: 0;
}

.coffee-stain:nth-child(2) {
    top: 60%;
    right: 10%;
    animation-delay: -5s;
    animation-duration: 25s;
    width: 120px;
    height: 120px;
}

.coffee-stain:nth-child(3) {
    top: 30%;
    left: 70%;
    animation-delay: -10s;
    animation-duration: 30s;
    width: 100px;
    height: 100px;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}

/* Header */
header {
    text-align: center;
    padding: 3rem 1rem;
    position: relative;
    z-index: 10;
    background: linear-gradient(180deg, var(--paper) 0%, transparent 100%);
}

h1 {
    font-family: sui, 'Courier New', monospace;
    font-size: clamp(2.5rem, 6vw, 4rem);
    color: var(--ink);
    text-shadow: 3px 3px 0 var(--highlight), 6px 6px 15px rgba(0,0,0,0.1);
    display: inline-block;
    position: relative;
    animation: typewriter 2s steps(20) forwards;
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid var(--ink);
    max-width: 100%;
}

@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    50% { border-color: transparent; }
}

h1 {
    animation: typewriter 2s steps(20) forwards, blink 1s infinite 2s;
}

.tagline {
    margin-top: 1rem;
    font-style: italic;
    color: var(--shadow);
    font-size: 1.2rem;
    opacity: 0;
    animation: fadeIn 0.5s forwards 2s;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* Navigation */
nav {
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--accent) 10%, 
        var(--accent) 90%, 
        transparent 100%);
    padding: 1px 0;
    margin: 2rem 0;
    position: relative;
    z-index: 10;
}

nav ul {
    background: var(--paper);
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
    padding: 1rem;
}

nav a {
    color: var(--ink);
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    position: relative;
    transition: all 0.3s;
    font-family: sui, 'Courier New', monospace;
}

nav a::before {
    content: '[ ';
    opacity: 0;
    transition: opacity 0.3s;
}

nav a::after {
    content: ' ]';
    opacity: 0;
    transition: opacity 0.3s;
}

nav a:hover::before,
nav a:hover::after {
    opacity: 1;
}

nav a:hover {
    color: var(--accent);
    transform: translateY(-2px);
}

/* Marquee */
.marquee {
    background: var(--ink);
    color: var(--highlight);
    padding: 0.5rem;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    margin: 2rem 0;
    font-family: 'Courier New', monospace;
    z-index: 10;
}

.marquee span {
    display: inline-block;
    padding-left: 100%;
    animation: marquee 20s linear infinite;
}

@keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-100%); }
}

/* Main container */
main {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 10;
}

/* Sections */
section {
    margin-bottom: 4rem;
}

h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--accent);
    font-family: sui, 'Courier New', monospace;
    position: relative;
    display: inline-block;
    width: 100%;
}

h2::before,
h2::after {
    content: '~';
    margin: 0 1rem;
    color: var(--highlight);
}

/* Book showcase */
.book-showcase {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.book {
    background: white;
    border: 3px solid var(--ink);
    padding: 1.5rem;
    position: relative;
    transform: rotate(-1deg);
    transition: all 0.3s;
    box-shadow: 5px 5px 0 var(--shadow);
}

.book:nth-child(even) {
    transform: rotate(1deg);
}

.book:hover {
    transform: rotate(0deg) scale(1.05);
    box-shadow: 8px 8px 0 var(--accent);
    z-index: 20;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><text y="28" font-size="28">📚</text></svg>') 16 16, auto;
}

.book h3 {
    color: var(--accent);
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-family: sui, serif;
}

.book img {
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
    border: 2px solid var(--ink);
    transition: all 0.3s;
}

.book img:hover {
    transform: rotate(-2deg) scale(1.05);
    box-shadow: 5px 5px 10px rgba(0,0,0,0.2);
}

.book-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.book-links a,
.book-links button {
    background: var(--highlight);
    color: var(--ink);
    padding: 0.5rem 1rem;
    text-decoration: none;
    border: 2px solid var(--ink);
    font-weight: bold;
    transition: all 0.3s;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.book-links a:hover,
.book-links button:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-2px);
    box-shadow: 3px 3px 0 var(--shadow);
}

.book-status {
    display: inline-block;
    background: var(--fun);
    color: white;
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    transform: rotate(-3deg);
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: rotate(-3deg) scale(1); }
    50% { transform: rotate(-3deg) scale(1.05); }
}

/* About section */
.author-section {
    background: white;
    border: 2px dashed var(--accent);
    padding: 2rem;
    margin: 3rem 0;
    position: relative;
}

.author-section::before {
    content: '✍️';
    position: absolute;
    top: -20px;
    left: 20px;
    font-size: 2rem;
    background: var(--paper);
    padding: 0 10px;
}

.typewriter-text {
    font-family: 'Courier New', monospace;
    border-left: 3px solid var(--ink);
    padding-left: 15px;
    margin: 1rem 0;
}

.typewriter-text p {
    margin: 1rem 0;
    line-height: 1.6;
}

/* Fun fact */
.fun-fact {
    background: linear-gradient(45deg, var(--highlight), var(--accent));
    color: white;
    padding: 1.5rem;
    margin: 3rem 0;
    transform: skew(-2deg);
    position: relative;
    overflow: hidden;
}

.fun-fact::before {
    content: '★';
    position: absolute;
    font-size: 5rem;
    opacity: 0.1;
    right: -20px;
    top: -20px;
    animation: spin 10s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.fun-fact p {
    transform: skew(2deg);
    font-size: 1.1rem;
}

/* Contact form */
.contact-wrapper {
    background: white;
    border: 3px solid var(--ink);
    padding: 2rem;
    margin: 3rem 0;
    position: relative;
    transform: rotate(0.5deg);
    box-shadow: 5px 5px 0 var(--shadow);
}

form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

label {
    font-weight: bold;
    color: var(--accent);
    font-family: 'Courier New', monospace;
}

input,
textarea {
    padding: 0.8rem;
    background: var(--cream);
    color: var(--ink);
    border: 2px solid var(--ink);
    font-family: 'Courier New', monospace;
    transition: all 0.3s;
}

input:focus,
textarea:focus {
    outline: none;
    background: white;
    border-color: var(--accent);
    box-shadow: 3px 3px 0 var(--highlight);
}

button[type="submit"] {
    background: var(--accent);
    color: white;
    padding: 1rem;
    border: 2px solid var(--ink);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    font-family: sui, 'Courier New', monospace;
    font-size: 1.1rem;
}

button[type="submit"]:hover {
    background: var(--fun);
    transform: translateY(-2px);
    box-shadow: 5px 5px 0 var(--shadow);
}

/* Drawer styles */
.drawer-container {
    position: fixed;
    top: 50%;
    right: -300px;
    width: 300px;
    background: white;
    border: 3px solid var(--ink);
    transition: right 0.3s ease-in-out;
    z-index: 1000;
    transform: translateY(-50%);
    box-shadow: -5px 5px 0 var(--shadow);
}

.drawer-handle {
    position: absolute;
    left: -60px;
    top: 50%;
    width: 60px;
    height: 100px;
    background: var(--accent);
    border: 3px solid var(--ink);
    border-right: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 2rem;
    color: white;
    transform: translateY(-50%);
    transition: all 0.3s;
}

.drawer-handle:hover {
    background: var(--fun);
    padding-left: 5px;
}

.drawer-content {
    padding: 2rem;
}

.drawer-content h3 {
    color: var(--accent);
    margin-bottom: 1rem;
    font-family: sui, 'Courier New', monospace;
}

.drawer-content input {
    width: 100%;
    margin: 0.5rem 0;
}

.drawer-content button {
    background: var(--highlight);
    color: var(--ink);
    padding: 0.5rem 1rem;
    border: 2px solid var(--ink);
    margin: 0.5rem 0.2rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.drawer-content button:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-2px);
}

.drawer-container.open {
    right: 0;
}

/* Donation section */
.donation-wrapper {
    background: linear-gradient(135deg, var(--cream) 0%, white 100%);
    border: 2px dashed var(--coffee);
    padding: 2rem;
    margin: 3rem 0;
    text-align: center;
    position: relative;
}

.donation-wrapper::before {
    content: '🫶';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    background: var(--paper);
    padding: 0 10px;
}

.donate-buttons {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 1.5rem 0;
}

.donate {
    transition: transform 0.3s;
}

.donate:hover {
    transform: scale(1.2) rotate(5deg);
}

.be-gone-btn {
    background: var(--fun);
    color: white;
    border: 2px solid var(--ink);
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

.be-gone-btn:hover {
    background: var(--ink);
    transform: rotate(180deg) scale(1.1);
}

/* Web ring style */
.web-ring {
    border: 3px double var(--accent);
    padding: 2rem;
    text-align: center;
    margin: 3rem 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(211, 84, 0, 0.05) 10px,
        rgba(211, 84, 0, 0.05) 20px
    );
    position: relative;
}

.web-ring h2 {
    font-size: 1.8rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--shadow);
    position: relative;
    z-index: 10;
    background: linear-gradient(180deg, transparent 0%, var(--paper) 100%);
}

footer p {
    margin: 0.5rem 0;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
}

.modal-content {
    background: white;
    margin: 10% auto;
    padding: 2rem;
    border: 3px solid var(--ink);
    width: 80%;
    max-width: 600px;
    position: relative;
    box-shadow: 10px 10px 0 var(--accent);
}

.close {
    color: var(--ink);
    float: right;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.close:hover {
    color: var(--fun);
    transform: rotate(90deg);
}

/* Overlay styles */
#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 3000;
    color: white;
}

.spinner {
    border: 8px solid rgba(255, 255, 255, 0.3);
    border-top: 8px solid var(--accent);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

/* Hide spaceship and laser - not needed */
.spaceship, .laser, .stars {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .book-showcase {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.8rem;
    }
}

/* Menu toggle for mobile */
.menu-toggle {
    display: none;
    background: var(--accent);
    color: white;
    border: 2px solid var(--ink);
    padding: 0.5rem 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    margin: 0 auto;
}

@media (max-width: 600px) {
    .menu-toggle {
        display: block;
    }

    nav ul {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: white;
        border: 2px solid var(--ink);
        box-shadow: 0 5px 10px rgba(0,0,0,0.2);
    }

    nav ul.show {
        display: flex;
    }
}