/* ==========================================================================
   HOME PAGE: ZINE COLLAGE (newspaper scraps, tape, grain, news ticker)
   ========================================================================== */
.home {
    min-height: 100vh;
    height: auto;
}

/* Film grain over the whole page */
.home::after {
    content: "";
    position: fixed;
    inset: -50%;
    width: 200%;
    height: 200%;
    pointer-events: none;
    z-index: 50;
    opacity: 0.13;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1.4 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    animation: grain 0.9s steps(5) infinite;
}

@keyframes grain {
    0%   { transform: translate(0, 0); }
    20%  { transform: translate(-3%, 2%); }
    40%  { transform: translate(2%, -3%); }
    60%  { transform: translate(-2%, -1%); }
    80%  { transform: translate(3%, 3%); }
    100% { transform: translate(0, 0); }
}

/* Board that holds the scraps */
.zine-board {
    position: absolute;
    top: 3.4cm;
    left: 4vw;
    right: 4vw;
    bottom: 80px;
    z-index: 5;
}

/* --------------------------------------------------------------------------
   One scrap: outer link carries position, tilt and shadow,
   inner .scrap-paper carries the torn paper image
   -------------------------------------------------------------------------- */
.scrap {
    position: absolute;
    display: block;
    color: #1d1b17;
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    -webkit-user-drag: none;
    touch-action: manipulation;
    translate: calc(var(--jx, 0px) + var(--px, 0px)) calc(var(--jy, 0px) + var(--py, 0px));
    rotate: calc(var(--rot, 0deg) + var(--jr, 0deg));
    filter: drop-shadow(0 10px 14px rgba(0,0,0,0.5)) drop-shadow(0 2px 3px rgba(0,0,0,0.35));
    transition: rotate 0.35s cubic-bezier(0.25, 1, 0.5, 1), scale 0.35s cubic-bezier(0.25, 1, 0.5, 1),
                transform 0.35s cubic-bezier(0.25, 1, 0.5, 1), filter 0.35s ease, opacity 0.35s ease,
                translate 0.25s ease-out;
}

.scrap-paper {
    position: relative;
    display: block;
    box-sizing: border-box;
    padding: 30px 30px 32px;
    isolation: isolate;
    /* fallback paper until home.js draws the torn edge */
    background: #e9e3d2 url('img/paper-texture.webp');
}

.scrap-paper.torn { background: none; }

.paper-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* Strips of sticky tape */
.tape {
    position: absolute;
    z-index: 3;
    top: -4px;
    left: 50%;
    width: 104px;
    height: 34px;
    margin-left: -52px;
    background: url('img/tape.webp') center / 100% 100% no-repeat;
    rotate: -3deg;
    pointer-events: none;
}

.tape--l { left: -40px; margin-left: 0; top: -10px; rotate: -38deg; }
.tape--r { left: auto; right: -40px; margin-left: 0; top: -10px; rotate: 36deg; }
#scrap-bio .tape   { rotate: 4deg; }
#scrap-texts .tape { rotate: -6deg; left: 42%; }

/* Text on the paper */
.scrap-kicker {
    display: block;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(29,27,23,0.6);
    padding-bottom: 6px;
    margin-bottom: 10px;
    color: #4a453b;
}

.scrap-head {
    font-family: "Times New Roman", Georgia, serif;
    font-weight: 900;
    font-size: clamp(20px, 1.9vw, 30px);
    line-height: 1.02;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    margin: 0 0 10px 0;
    display: inline;
    padding: 0 2px;
    background-image: linear-gradient(transparent 55%, rgba(245, 225, 70, 0) 55%);
    transition: background-image 0.3s ease;
}

.scrap-body {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 13px;
    line-height: 1.45;
    margin: 12px 0 0 0;
    color: #3a362e;
    column-count: 2;
    column-gap: 14px;
    text-align: left;
}

.scrap-photo {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    margin: 0 0 12px 0;
    filter: grayscale(1) contrast(1.35) brightness(0.95);
    mix-blend-mode: multiply;
    pointer-events: none;
}

.scrap-photo--big {
    aspect-ratio: 1 / 1;
    margin-bottom: 14px;
}

.scrap-stamp {
    position: absolute;
    bottom: 30px;
    right: 22px;
    padding: 6px 10px;
    border: 3px double #b3261e;
    border-radius: 4px;
    color: #b3261e;
    font-family: 'EuroStyle', Arial, sans-serif;
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    transform: rotate(12deg);
    opacity: 0.85;
    mix-blend-mode: multiply;
}

.scrap-chart {
    list-style: none;
    margin: 14px 0 0 0;
    padding: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 15px;
    color: #2a2721;
}

.scrap-chart li {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 4px 0;
}

.scrap-chart li::after {
    content: "";
    order: 1;
    flex: 1;
    border-bottom: 1px dotted rgba(29,27,23,0.55);
}

.scrap-chart img {
    order: -1;
    align-self: center;
    width: 36px;
    height: 36px;
    object-fit: cover;
    flex: none;
    border: 1px solid rgba(29,27,23,0.5);
    filter: grayscale(1) contrast(1.25);
    mix-blend-mode: multiply;
    pointer-events: none;
    transition: filter 0.3s ease;
}

.scrap--disco:hover .scrap-chart img { filter: none; mix-blend-mode: normal; }

.scrap-chart span { order: 0; font-weight: bold; text-transform: uppercase; letter-spacing: 0.03em; }
.scrap-chart em { order: 2; font-size: 13px; color: #5a5448; }
.scrap-chart li:first-child em { color: #b3261e; font-style: normal; font-weight: bold; }

.scrap-more {
    display: inline-block;
    margin-top: 10px;
    font-family: Georgia, serif;
    font-size: 12px;
    font-style: italic;
    color: #6b6457;
}

/* Desktop placement */
.scrap--disco { --rot: -6deg; left: 1%;  top: 3%;  width: 26%; }
.scrap--news  { --rot: 2deg;  left: 35%; top: -2%; width: 28%; z-index: 6; }
.scrap--bio   { --rot: 5deg;  right: 1%; top: 1%;  width: 26%; }
.scrap--photo { --rot: 4deg;  left: 4%;  top: 57%; width: 25%; }
.scrap--texts { --rot: -4deg; right: 3%; top: 55%; width: 25%; }

/* Hover: the scrap straightens, lifts and gets a marker highlight */
@media (hover: hover) {
    .scrap:hover,
    .scrap:focus-visible {
        rotate: 0deg;
        scale: 1.06;
        transform: translateY(-6px);
        filter: drop-shadow(0 24px 26px rgba(0,0,0,0.6)) drop-shadow(0 4px 6px rgba(0,0,0,0.35)) brightness(1.04);
        z-index: 20;
        outline: none;
    }
    .scrap:hover .scrap-head,
    .scrap:focus-visible .scrap-head {
        background-image: linear-gradient(transparent 55%, rgba(245, 225, 70, 0.85) 55%);
    }
    .zine-board:not(.drag-active):hover .scrap:not(:hover) {
        opacity: 0.6;
        filter: drop-shadow(0 10px 14px rgba(0,0,0,0.5)) grayscale(0.6) brightness(0.8);
    }
}

/* Dragging */
.zine-board.drag-active .scrap { transition: none; }
.scrap.is-dragging {
    cursor: grabbing;
    rotate: calc(var(--rot, 0deg) + var(--jr, 0deg) + 2deg);
    scale: 1.08;
    z-index: 30 !important;
    filter: drop-shadow(0 30px 30px rgba(0,0,0,0.6)) drop-shadow(0 6px 8px rgba(0,0,0,0.35));
}

/* Scraps falling onto the table on page load */
@keyframes scrap-drop {
    0%   { transform: translateY(-115vh) rotate(-22deg); }
    65%  { transform: translateY(10px) rotate(2deg); }
    82%  { transform: translateY(-5px) rotate(-1deg); }
    100% { transform: none; }
}

.zine-board.is-dropping .scrap {
    animation: scrap-drop 0.95s cubic-bezier(0.22, 0.8, 0.3, 1) backwards;
    animation-delay: calc(var(--i, 0) * 140ms);
}

/* Shuffle button */
.shuffle-btn {
    position: fixed;
    left: 20px;
    bottom: 64px;
    z-index: 41;
    padding: 8px 14px;
    background: rgba(0,0,0,0.65);
    border: 1px solid rgba(233,227,210,0.6);
    border-radius: 3px;
    color: #e9e3d2;
    font-family: 'EuroStyle', Arial, sans-serif;
    font-size: 13px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.shuffle-btn:hover { background: #e9e3d2; color: #111; }

/* Running news ticker */
.ticker {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: block;
    overflow: hidden;
    background: #0b0b0b;
    border-top: 2px solid #e9e3d2;
    color: #e9e3d2;
    text-decoration: none;
    white-space: nowrap;
}

.ticker-track {
    display: inline-flex;
    animation: ticker 38s linear infinite;
}

.ticker:hover .ticker-track { animation-play-state: paused; }

.ticker-item {
    font-family: 'EuroStyle', sans-serif;
    font-size: 18px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 14px 0;
}

.ticker-item::after {
    content: "\2022";
    font-family: Arial, sans-serif;
    margin: 0 28px;
    color: #f5e146;
}

@keyframes ticker {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
    .home::after, .ticker-track { animation: none; }
    .zine-board.is-dropping .scrap { animation: none; }
}

/* Between laptop and tablet: tighten the collage */
@media (max-width: 1240px) {
    .scrap-body { font-size: 12px; }
    .scrap-paper { padding: 26px 24px 28px; }
    .scrap--disco { left: 0%;  width: 31%; }
    .scrap--news  { left: 34%; width: 32%; }
    .scrap--bio   { right: 0%; width: 31%; }
    .scrap--photo { left: 1%;  top: 62%; width: 30%; }
    .scrap-chart { font-size: 14px; }
    .scrap-chart img { width: 30px; height: 30px; }
    .scrap--texts { right: 1%; width: 30%; }
}

/* Phone and small tablet: vertical stack of scraps, tap to open */
@media (max-width: 860px) {
    .zine-board {
        position: static;
        display: flex;
        flex-direction: column;
        gap: 30px;
        padding: 3.4cm 5vw 110px;
    }
    .scrap {
        position: relative;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        width: 88% !important;
        translate: none;
    }
    .scrap:nth-child(even) { align-self: flex-end; }
    .scrap--news  { --rot: -2deg; }
    .scrap--bio   { --rot: 2.5deg; }
    .scrap--disco { --rot: -2deg; }
    .scrap--photo { --rot: 3deg; }
    .scrap--texts { --rot: -2.5deg; }
    .scrap-head { font-size: 24px; }
    .scrap-body { font-size: 13px; }
    .scrap:active { scale: 0.98; rotate: 0deg; }
    .shuffle-btn { display: none; }
    .ticker-item { font-size: 14px; padding: 11px 0; }
}

@media (max-width: 480px) {
    .scrap { width: 96% !important; }
    .scrap-body { column-count: 1; }
    .scrap-paper { padding: 24px 20px 26px; }
}
