:root {
    --primary-color: #4b5563;
    --secondary-color: #be185d;
    --text-color: #374151;
    --paper-bg: #fdf6e3;
    --ink-color: #1f2937;
    --font-hand: "Patrick Hand", cursive;
    --font-script: "Dancing Script", cursive;
    --font-sans: "Quicksand", sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--paper-bg);
    background-image: url('https://www.transparenttextures.com/patterns/natural-paper.png');
    color: var(--text-color);
    font-family: var(--font-sans);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    padding: 40px 0;
    text-align: center;
}

.logo {
    font-family: var(--font-script);
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 20px;
    filter: drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.1));
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 30px;
}

nav a {
    color: var(--text-color);
    text-decoration: none;
    font-family: var(--font-hand);
    font-size: 1.4rem;
    transition: 0.2s;
    border-bottom: 2px solid transparent;
}

nav a:hover,
nav a.active {
    color: var(--secondary-color);
    border-bottom: 2px dashed var(--secondary-color);
}

/* Hand-drawn Box */
.hero {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
}

.quote-box {
    background: white;
    border: 3px solid var(--ink-color);
    box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.1);
    padding: 60px 40px;
    width: 100%;
    max-width: 700px;
    text-align: center;
    position: relative;
    /* Sketchy irregular border */
    border-radius: 255px 15px 225px 15px/15px 225px 15px 255px;
}

.quote-box::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 2px solid var(--ink-color);
    border-radius: 15px 255px 15px 225px/225px 15px 255px 15px;
    z-index: -1;
    opacity: 0.3;
}

.quote-text {
    font-family: var(--font-hand);
    font-size: 2.2rem;
    line-height: 1.4;
    color: var(--ink-color);
    margin-bottom: 30px;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quote-author {
    font-family: var(--font-script);
    font-size: 1.5rem;
    color: var(--secondary-color);
    text-align: right;
    display: block;
}

/* Marquee logic - we will wrap text in JS if needed, but for now CSS fade */
@keyframes inkFade {
    0% {
        opacity: 0;
        transform: scale(0.98);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.quote-box.fade-in {
    animation: inkFade 0.6s ease-out forwards;
}

/* Buttons */
.actions {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.btn {
    padding: 10px 25px;
    font-family: var(--font-hand);
    font-size: 1.3rem;
    cursor: pointer;
    background: transparent;
    border: 2px solid var(--ink-color);
    border-radius: 20px 5px 20px 5px;
    transition: 0.2s;
}

.btn:hover {
    transform: scale(1.05) rotate(-1deg);
    background: var(--paper-bg);
}

.btn-primary {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.btn-primary:hover {
    background: #9d174d;
    color: white;
}

/* Categories */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    padding: 40px 0 80px;
}

.category-item {
    background: white;
    border: 2px solid var(--ink-color);
    padding: 30px;
    border-radius: 10px 30px 10px 30px;
    transition: 0.3s;
}

.category-item:hover {
    transform: translateY(-5px) rotate(1deg);
    box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.05);
}

.category-item h3 {
    font-family: var(--font-script);
    font-size: 1.8rem;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.category-item p {
    font-family: var(--font-hand);
    font-size: 1.1rem;
    color: var(--text-color);
}

/* Footer */
footer {
    padding: 60px 0;
    border-top: 2px dashed var(--ink-color);
    background: rgba(255, 255, 255, 0.3);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 40px;
}

.footer-info {
    font-family: var(--font-hand);
    font-size: 1.2rem;
}

.footer-info p {
    margin-bottom: 5px;
}

.footer-credit {
    font-family: var(--font-hand);
    font-size: 1rem;
    opacity: 0.7;
}

/* Hide canvas as we move away from the glowy particles */
#bg-canvas,
.stars-container {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .logo {
        font-size: 2.2rem;
    }

    .quote-text {
        font-size: 1.6rem;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}