/* Add CSS custom properties for randomness */
.tractor-feed-paper {
    background-color: #fefef0;
    margin-left: 2vw;
    margin-right: 2vw;
    margin-top: 0px;
    margin-bottom: 0px;
    padding: 0;
    position: relative;
    
    /* THX Deep Note inspired randomness - chaos to order */
    --random-skew: 0deg;
    --random-brightness: 1;
    --random-dot-spacing: 0.8rem; /* Smaller, more frequent perforations */
    --random-shadow-offset: 0px;
    
    /* Create authentic tractor feed holes on sides */
    border-left: 2vw solid #f5f5f5;
    border-right: 2vw solid #f5f5f5;
    border-image: 
        radial-gradient(circle, #555 30%, transparent 30%) 0 0 0 50 / 
        0 4px 0 4px repeat;
}

/* Add horizontal perforations with randomness - use different pseudo-element approach */
.tractor-feed-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background-image: repeating-linear-gradient(
        transparent,
        transparent var(--random-dot-spacing),
        #ddd var(--random-dot-spacing),
        #ddd calc(var(--random-dot-spacing) + 0.1rem)
    );
    pointer-events: none;
    opacity: 0.3;
    filter: brightness(var(--random-brightness));
    transform: skewY(var(--random-skew));
    z-index: -1;
}

/* Create smaller, more frequent perforation holes on the sides */
.tractor-feed-paper::after {
    content: '';
    position: absolute;
    top: 0;
    left: -2vw;
    width: 2vw;
    height: 100%;
    background-image: 
        radial-gradient(circle at 50% 2px, #555 1px, transparent 1px),
        radial-gradient(circle at 50% 6px, #555 1px, transparent 1px),
        radial-gradient(circle at 50% 10px, #555 1px, transparent 1px),
        radial-gradient(circle at 50% 14px, #555 1px, transparent 1px);
    background-size: 100% 16px;
    background-repeat: repeat-y;
    pointer-events: none;
}

.tractor-feed-paper::before {
    content: '';
    position: absolute;
    top: 0;
    right: -2vw;
    width: 2vw;
    height: 100%;
    background-image: 
        radial-gradient(circle at 50% 2px, #555 1px, transparent 1px),
        radial-gradient(circle at 50% 6px, #555 1px, transparent 1px),
        radial-gradient(circle at 50% 10px, #555 1px, transparent 1px),
        radial-gradient(circle at 50% 14px, #555 1px, transparent 1px);
    background-size: 100% 16px;
    background-repeat: repeat-y;
    pointer-events: none;
}

.tractor-feed-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* Changed from center to flex-start */
    border-left: .3vw dashed #ccc;
    border-right: .3vw dashed #ccc;
    margin-left: 2vw;
    margin-right: 2vw;
    padding: 2rem 4rem; /* Increased horizontal padding */
    min-height: auto; /* Changed from 100vh to auto */
    text-align: center;
    font-family: 'Courier New', 'Monaco', 'Lucida Console', monospace;
}

/* Dot matrix text styling */
.dot-matrix-text {
    font-family: 'Courier New', 'Monaco', 'Lucida Console', monospace;
    font-weight: bold;
    letter-spacing: 0.1em;
    line-height: 1.4;
    color: #333;
    text-shadow: 0.5px 0.5px 0px #666;
}

.dot-matrix-title {
    font-size: clamp(1.5rem, 4vw, 3rem);
    margin-bottom: 2rem;
    text-transform: uppercase;
}

.dot-matrix-body {
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    max-width: 60ch;
    margin: 0 auto;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .tractor-feed-paper {
        border-left: 1rem dotted #555;
        border-right: 1rem dotted #555;
        margin-left: 0.5rem;
        margin-right: 0.5rem;
    }
    
    .tractor-feed-content {
        border-left: 0.2rem dashed #ccc;
        border-right: 0.2rem dashed #ccc;
        margin-left: 1.5rem; /* Increased to avoid punch holes */
        margin-right: 1.5rem; /* Increased to avoid punch holes */
        padding: 1.5rem 2.5rem; /* Increased horizontal padding for mobile */
    }
}

/* Print mode - remove borders for actual printing */
@media print {
    .tractor-feed-paper {
        border: none;
        margin: 0;
        background: white;
    }
    
    .tractor-feed-content {
        border: none;
        margin: 0;
        min-height: auto;
    }
    
    .tractor-feed-paper::before {
        display: none;
    }
}