/* showa.boo — Sepia-toned Showa-era ghost story archive */

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: #F5ECD7;
    color: #6B5340;
    font-family: Georgia, serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.75;
    position: relative;
    overflow-x: hidden;
    filter: sepia(0.15);
}

/* ===== Aged Paper Texture (noise overlay via CSS) ===== */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        repeating-conic-gradient(#6B5340 0% 25%, transparent 0% 50%);
    background-size: 3px 3px;
    opacity: 0.04;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: multiply;
}

/* ===== Scattered Watermarks ===== */
.watermark-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.watermark-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.2rem;
    color: rgba(61, 43, 31, 0.04);
    position: absolute;
    white-space: nowrap;
    user-select: none;
}

.watermark-text.scattered:nth-child(1) { top: 8%; left: 5%; transform: rotate(-8deg); }
.watermark-text.scattered:nth-child(2) { top: 22%; right: 8%; transform: rotate(4deg); }
.watermark-text.scattered:nth-child(3) { top: 42%; left: 12%; transform: rotate(-3deg); }
.watermark-text.scattered:nth-child(4) { top: 58%; right: 15%; transform: rotate(6deg); }
.watermark-text.scattered:nth-child(5) { top: 75%; left: 7%; transform: rotate(-5deg); }
.watermark-text.scattered:nth-child(6) { top: 88%; right: 10%; transform: rotate(3deg); }

/* ===== Shared Heading ===== */
.section-heading {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.4rem;
    color: #3D2B1F;
    text-align: center;
    margin-bottom: 2rem;
    letter-spacing: 0.02em;
}

/* ===== Hero Zone ===== */
.hero {
    position: relative;
    text-align: center;
    padding: 7rem 2rem 5rem;
    overflow: hidden;
}

.era-watermark {
    font-size: 4rem;
    color: rgba(61, 43, 31, 0.05);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
    line-height: 1;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(2.2rem, 6vw, 3.2rem);
    color: #3D2B1F;
    line-height: 1.2;
    margin-bottom: 0.6rem;
    position: relative;
    z-index: 1;
}

/* Text wobble for vintage print feel */
.wobble-char {
    display: inline-block;
    letter-spacing: 0.05em;
}

.wobble-char:nth-child(1) { letter-spacing: 0.06em; }
.wobble-char:nth-child(2) { letter-spacing: 0.04em; transform: translateY(1px); }
.wobble-char:nth-child(4) { letter-spacing: 0.07em; }
.wobble-char:nth-child(5) { letter-spacing: 0.03em; transform: translateY(-1px); }
.wobble-char:nth-child(6) { letter-spacing: 0.055em; transform: translateY(1px); }

.hero-tagline {
    font-family: Georgia, serif;
    font-size: 1.05rem;
    color: #6B5340;
    margin-bottom: 2.5rem;
    position: relative;
    z-index: 1;
}

.archive-link {
    font-family: Georgia, serif;
    font-size: 0.95rem;
    color: #8B0000;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 1px;
    position: relative;
    z-index: 1;
    transition: color 0.3s ease, text-decoration-color 0.3s ease;
}

.archive-link:hover {
    color: #1A1A1A;
    text-decoration-color: #8B0000;
}

/* ===== Decades Grid ===== */
.decades {
    max-width: 920px;
    margin: 0 auto;
    padding: 3rem 2rem 4rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    position: relative;
    z-index: 1;
}

.decade-col {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.decade-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    color: #A08060;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.decade-desc {
    font-family: Georgia, serif;
    font-size: 0.85rem;
    color: #6B5340;
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* ===== Aged Card (shared) ===== */
.aged-card {
    background: #E8DCC4;
    border: 1px solid #C4A882;
    border-radius: 4px 8px 4px 6px;
    padding: 1.25rem;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.aged-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(61, 43, 31, 0.12);
}

/* ===== Story Cards ===== */
.story-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.ghost-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: #8B0000;
    line-height: 1.3;
}

.story-year {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: #A08060;
    letter-spacing: 0.04em;
}

.read-link {
    font-family: Georgia, serif;
    font-size: 0.8rem;
    color: #8B0000;
    text-decoration: none;
    transition: color 0.25s ease;
}

.read-link::after {
    content: ' \2192';
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.read-link:hover {
    color: #1A1A1A;
}

.read-link:hover::after {
    opacity: 1;
}

/* ===== Yokai of the Week ===== */
.yokai {
    max-width: 620px;
    margin: 0 auto;
    padding: 3rem 2rem 4rem;
    position: relative;
    z-index: 1;
}

.yokai-card {
    text-align: center;
    padding: 2.5rem 2rem;
}

.yokai-name {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.3rem;
    color: #8B0000;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.yokai-era {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: #A08060;
    display: block;
    margin-bottom: 1.25rem;
    letter-spacing: 0.04em;
}

.yokai-desc {
    font-family: Georgia, serif;
    font-size: 0.95rem;
    color: #6B5340;
    margin-bottom: 1.25rem;
    line-height: 1.75;
}

.profile-link {
    font-family: Georgia, serif;
    font-size: 0.85rem;
    color: #8B0000;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: color 0.25s ease;
}

.profile-link:hover {
    color: #1A1A1A;
}

/* ===== Urban Legend Feed ===== */
.legends {
    max-width: 620px;
    margin: 0 auto;
    padding: 3rem 2rem 4rem;
    position: relative;
    z-index: 1;
}

.legend-list {
    display: flex;
    flex-direction: column;
}

.legend-entry {
    border-bottom: 1px solid #C4A882;
    padding: 1.25rem 0;
    transition: background-color 0.3s ease;
}

.legend-entry:first-child {
    border-top: 1px solid #C4A882;
}

.legend-entry:hover {
    background-color: rgba(232, 220, 196, 0.5);
}

.legend-year {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: #A08060;
    margin-right: 0.75rem;
    letter-spacing: 0.04em;
}

.legend-location {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: #C4A882;
}

.legend-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.05rem;
    color: #3D2B1F;
    margin: 0.35rem 0 0.25rem;
    line-height: 1.3;
}

.legend-teaser {
    font-family: Georgia, serif;
    font-size: 0.9rem;
    color: #6B5340;
    line-height: 1.65;
}

/* ===== Footer ===== */
.footer {
    max-width: 620px;
    margin: 0 auto;
    padding: 3rem 2rem 4rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.footer-rule {
    width: 60px;
    height: 1px;
    background: #C4A882;
    margin: 0 auto 2rem;
}

.footer-tagline {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.05rem;
    color: #3D2B1F;
    margin-bottom: 1.25rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.flink {
    font-family: Georgia, serif;
    font-size: 0.85rem;
    color: #1A1A1A;
    text-decoration: none;
    transition: color 0.25s ease;
}

.flink:hover {
    color: #8B0000;
}

.footer-copy {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    color: #A08060;
    letter-spacing: 0.04em;
}

/* ===== Responsive ===== */
@media (max-width: 700px) {
    .decades {
        grid-template-columns: 1fr;
        max-width: 420px;
    }
}

/* ===== Fade-in Animation ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes subtlePulse {
    0%, 100% { opacity: 0.04; }
    50% { opacity: 0.07; }
}

@keyframes flickerIn {
    0% { opacity: 0; }
    15% { opacity: 0.6; }
    30% { opacity: 0.2; }
    50% { opacity: 0.85; }
    70% { opacity: 0.4; }
    100% { opacity: 1; }
}

.fade-in {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children inside decades */
.decade-col .story-card {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.fade-in.visible .story-card:nth-child(3) {
    transition-delay: 0.1s;
}

.fade-in.visible .story-card:nth-child(4) {
    transition-delay: 0.2s;
}

.fade-in.visible .story-card:nth-child(5) {
    transition-delay: 0.3s;
}

.fade-in.visible .story-card {
    opacity: 1;
    transform: translateY(0);
}

/* Watermark subtle pulse */
.watermark-text {
    animation: subtlePulse 8s ease-in-out infinite;
}

.watermark-text:nth-child(2) { animation-delay: 1.3s; }
.watermark-text:nth-child(3) { animation-delay: 2.6s; }
.watermark-text:nth-child(4) { animation-delay: 3.9s; }
.watermark-text:nth-child(5) { animation-delay: 5.2s; }
.watermark-text:nth-child(6) { animation-delay: 6.5s; }

/* Hero title flicker entrance */
.hero-title.flicker-active {
    animation: flickerIn 1.2s ease forwards;
}
