/* ==========================================================================
   mysterious.day  --  A Daily Chronicle of Unexplained Phenomena
   Dark-academia / cinematic noir / scholar's mystery journal
   ========================================================================== */

:root {
    --ink-black: #0f0c08;
    --parchment-dark: #1a1610;
    --amber-glow: #d4a84b;
    --vellum-light: #e8dcc0;
    --burnished-gold: #8b6914;
    --dark-leather: #3d2b1f;
    --sage-ink: #6b8f71;

    --font-display: "Playfair Display", "Times New Roman", serif;
    --font-body: "Crimson Text", Georgia, "Times New Roman", serif;
    --font-hand: "Caveat", "Bradley Hand", cursive;

    --col-width: 680px;
    --timeline-offset: 2.25rem;
}

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

html {
    background: var(--ink-black);
    color: var(--vellum-light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
}

body {
    position: relative;
    min-height: 100vh;
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--vellum-light);
    background: var(--ink-black);
    background-image:
        radial-gradient(ellipse 90% 50% at 50% 0%, rgba(212, 168, 75, 0.075) 0%, transparent 60%),
        radial-gradient(ellipse 60% 30% at 50% 100%, rgba(139, 105, 20, 0.04) 0%, transparent 70%),
        linear-gradient(180deg, var(--ink-black) 0%, #110d09 50%, var(--ink-black) 100%);
    background-attachment: fixed;
    overflow-x: hidden;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(212, 168, 75, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 100%, rgba(61, 43, 31, 0.25) 0%, transparent 50%),
        radial-gradient(ellipse at 20% 100%, rgba(15, 12, 8, 0.45) 0%, transparent 55%);
}

.lamp-glow {
    position: fixed;
    top: -10vh;
    left: 50%;
    transform: translateX(-50%);
    width: 100vmax;
    height: 70vh;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(ellipse at center, rgba(212, 168, 75, 0.12) 0%, rgba(212, 168, 75, 0.04) 30%, transparent 65%);
    filter: blur(40px);
    animation: lamp-flicker 7.3s ease-in-out infinite;
}

@keyframes lamp-flicker {
    0%, 100% { opacity: 0.95; transform: translateX(-50%) scale(1); }
    13% { opacity: 1; transform: translateX(-50%) scale(1.02); }
    27% { opacity: 0.88; transform: translateX(-50%) scale(0.99); }
    41% { opacity: 0.97; transform: translateX(-50%) scale(1.01); }
    63% { opacity: 0.92; transform: translateX(-50%) scale(1); }
    79% { opacity: 1; transform: translateX(-50%) scale(1.015); }
}

.page-grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    opacity: 0.07;
    mix-blend-mode: overlay;
    background-image:
        repeating-linear-gradient(
            0deg,
            rgba(232, 220, 192, 0.3) 0px,
            rgba(232, 220, 192, 0.3) 1px,
            transparent 1px,
            transparent 3px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(212, 168, 75, 0.2) 0px,
            rgba(212, 168, 75, 0.2) 1px,
            transparent 1px,
            transparent 5px
        );
}

.page-frame {
    position: relative;
    z-index: 3;
    max-width: var(--col-width);
    margin: 0 auto;
    padding: 4rem 2rem 6rem;
}

/* ----- Masthead -------------------------------------------------------- */

.masthead {
    position: relative;
    padding: 3rem 0 2.5rem;
    border-bottom: 1px solid rgba(212, 168, 75, 0.18);
    text-align: center;
}

.masthead::before,
.masthead::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: var(--amber-glow);
    transform: translateX(-50%) rotate(45deg);
    box-shadow: 0 0 14px rgba(212, 168, 75, 0.5);
}

.masthead::after {
    bottom: -7px;
    background: var(--ink-black);
    width: 8px;
    height: 8px;
    box-shadow: none;
    border: 1px solid var(--amber-glow);
}

.masthead-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-family: var(--font-body);
    font-style: italic;
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--burnished-gold);
    margin-bottom: 1.25rem;
}

.masthead-divider {
    color: var(--amber-glow);
    font-style: normal;
}

.masthead-label {
    opacity: 0.85;
}

.masthead-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(2.6rem, 7vw, 4.4rem);
    line-height: 1;
    color: var(--vellum-light);
    letter-spacing: -0.01em;
    margin-bottom: 0.6rem;
    text-shadow: 0 1px 0 rgba(212, 168, 75, 0.05), 0 0 30px rgba(212, 168, 75, 0.08);
}

.masthead-dot {
    color: var(--amber-glow);
    font-style: italic;
}

.masthead-subtitle {
    max-width: 520px;
    margin: 1rem auto 0;
    font-family: var(--font-body);
    font-style: italic;
    font-size: 1rem;
    line-height: 1.7;
    color: rgba(232, 220, 192, 0.78);
}

/* ----- Hero datestamp -------------------------------------------------- */

.hero {
    position: relative;
    padding: 4rem 0 3.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(212, 168, 75, 0.12);
}

.hero-inner {
    max-width: 560px;
    margin: 0 auto;
}

.hero-eyebrow {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 0.85rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--burnished-gold);
    margin-bottom: 1.5rem;
}

.hero-datestamp {
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    gap: 1.25rem;
    padding: 1.5rem 2.5rem;
    margin: 0 auto 1.5rem;
    border-top: 1px solid rgba(212, 168, 75, 0.4);
    border-bottom: 1px solid rgba(212, 168, 75, 0.4);
    position: relative;
}

.hero-datestamp::before,
.hero-datestamp::after {
    content: "\2756";
    position: absolute;
    color: var(--amber-glow);
    font-size: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
}

.hero-datestamp::before { left: -1.25rem; }
.hero-datestamp::after  { right: -1.25rem; }

.hero-day {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(4rem, 12vw, 7rem);
    line-height: 0.95;
    color: var(--amber-glow);
    text-shadow: 0 0 40px rgba(212, 168, 75, 0.25), 0 2px 0 rgba(15, 12, 8, 0.8);
    letter-spacing: -0.02em;
    opacity: 0.92;
}

.hero-month {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.4rem, 3.5vw, 2rem);
    color: var(--vellum-light);
    letter-spacing: 0.04em;
}

.hero-year {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    color: var(--burnished-gold);
    letter-spacing: 0.25em;
    text-transform: uppercase;
}

.hero-tagline {
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(1.1rem, 2.4vw, 1.35rem);
    line-height: 1.55;
    color: var(--vellum-light);
    margin: 1.75rem auto 0.5rem;
    max-width: 440px;
}

.hero-attribution {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 0.9rem;
    color: var(--burnished-gold);
    letter-spacing: 0.05em;
    margin-bottom: 2.5rem;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-family: var(--font-body);
    font-size: 0.88rem;
    color: rgba(232, 220, 192, 0.7);
}

.hero-meta-item em {
    font-style: italic;
    color: var(--burnished-gold);
    margin-right: 0.35rem;
}

.hero-meta-item strong {
    font-weight: 600;
    font-style: normal;
    color: var(--vellum-light);
    font-variant-numeric: oldstyle-nums;
}

.hero-meta-divider {
    color: var(--amber-glow);
    font-size: 0.75rem;
    opacity: 0.8;
}

/* ----- Journal / vertical timeline ------------------------------------ */

.journal {
    position: relative;
    padding: 4rem 0 3rem 2.5rem;
    margin-top: 2rem;
}

.journal::before {
    content: "";
    position: absolute;
    left: 0.5rem;
    top: 1rem;
    bottom: 1rem;
    width: 1px;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(212, 168, 75, 0.45) 8%,
        rgba(212, 168, 75, 0.55) 50%,
        rgba(212, 168, 75, 0.3) 92%,
        transparent 100%
    );
}

.entry {
    position: relative;
    padding: 0 0 4rem 1.5rem;
    margin-bottom: 1rem;
}

.entry::before {
    content: "";
    position: absolute;
    left: -2rem;
    top: 0.75rem;
    width: 10px;
    height: 10px;
    background: var(--amber-glow);
    transform: rotate(45deg);
    box-shadow: 0 0 12px rgba(212, 168, 75, 0.55), 0 0 0 3px var(--ink-black);
    transition: transform 0.4s ease, box-shadow 0.4s ease, background 0.4s ease;
}

.entry::after {
    content: "";
    position: absolute;
    left: -1.6rem;
    top: 1.4rem;
    width: 1.45rem;
    height: 1px;
    background: linear-gradient(90deg, rgba(212, 168, 75, 0.5), transparent);
}

.entry:hover::before {
    transform: rotate(45deg) scale(1.25);
    box-shadow: 0 0 22px rgba(212, 168, 75, 0.85), 0 0 0 3px var(--ink-black);
}

.entry.is-archived::before {
    background: var(--burnished-gold);
    box-shadow: 0 0 6px rgba(139, 105, 20, 0.5), 0 0 0 3px var(--ink-black);
    opacity: 0.6;
}

.entry-header {
    margin-bottom: 1.25rem;
}

.entry-meta {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 0.82rem;
    color: var(--burnished-gold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.6rem;
}

.entry-divider {
    margin: 0 0.4rem;
    color: rgba(212, 168, 75, 0.5);
}

.entry-locale {
    color: rgba(232, 220, 192, 0.6);
    font-style: italic;
    text-transform: none;
    letter-spacing: 0.04em;
}

.entry-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 1.15;
    color: var(--vellum-light);
    margin-bottom: 0.75rem;
    letter-spacing: -0.005em;
    text-wrap: balance;
}

.entry-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

/* status pill badges */
.status-tag {
    display: inline-block;
    padding: 2px 10px;
    border: 1px solid var(--burnished-gold);
    border-radius: 2px;
    font-family: var(--font-body);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--burnished-gold);
    background: transparent;
    line-height: 1.65;
}

.status-tag.status-unsolved {
    color: var(--amber-glow);
    border-color: var(--amber-glow);
    background: rgba(212, 168, 75, 0.06);
}

.status-tag.status-partial {
    color: var(--sage-ink);
    border-color: var(--sage-ink);
    background: rgba(107, 143, 113, 0.06);
}

.status-tag.status-archived {
    color: var(--burnished-gold);
    border-color: rgba(139, 105, 20, 0.55);
    opacity: 0.8;
}

.status-tag.status-recurring {
    color: var(--vellum-light);
    border-color: rgba(232, 220, 192, 0.4);
}

.status-tag.status-archival {
    color: var(--burnished-gold);
    border-color: var(--burnished-gold);
    border-style: dashed;
}

.entry-body {
    font-family: var(--font-body);
    font-size: 1.08rem;
    line-height: 1.85;
    color: var(--vellum-light);
    margin-bottom: 1.4rem;
    text-align: left;
    text-wrap: pretty;
}

.entry-body em {
    color: var(--amber-glow);
    font-style: italic;
}

/* scholar's annotation -- handwritten margin note */
.annotation {
    display: block;
    position: relative;
    border-left: 2px solid var(--sage-ink);
    margin: 1.5rem 0 1.5rem 2rem;
    padding: 0.5rem 0 0.5rem 1rem;
    font-family: var(--font-hand);
    font-style: italic;
    font-weight: 500;
    font-size: 1.35rem;
    line-height: 1.45;
    color: var(--sage-ink);
    background: linear-gradient(90deg, rgba(107, 143, 113, 0.045) 0%, transparent 80%);
    transform: rotate(-0.4deg);
    transition: transform 0.5s ease;
}

.annotation::before {
    content: "\201C";
    position: absolute;
    left: 0.5rem;
    top: -0.3rem;
    font-family: var(--font-display);
    font-size: 2.2rem;
    color: rgba(107, 143, 113, 0.35);
    line-height: 1;
}

.annotation::after {
    content: "";
    position: absolute;
    right: -0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background: var(--sage-ink);
    border-radius: 50%;
    opacity: 0.6;
}

.annotation:hover {
    transform: rotate(0deg);
}

.entry-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.75rem;
    padding-top: 1rem;
    border-top: 1px dashed rgba(212, 168, 75, 0.18);
    font-family: var(--font-body);
    font-style: italic;
    font-size: 0.82rem;
    color: var(--burnished-gold);
    letter-spacing: 0.1em;
}

.entry-folio {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.72rem;
    color: rgba(139, 105, 20, 0.85);
}

.entry-action {
    appearance: none;
    background: transparent;
    border: 1px solid rgba(139, 105, 20, 0.5);
    border-radius: 1px;
    color: var(--burnished-gold);
    font-family: var(--font-body);
    font-style: italic;
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    padding: 0.4rem 1rem;
    cursor: pointer;
    transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease, letter-spacing 0.3s ease;
}

.entry-action:hover {
    color: var(--amber-glow);
    border-color: var(--amber-glow);
    background: rgba(212, 168, 75, 0.05);
    letter-spacing: 0.22em;
}

.entry.is-archived .entry-body,
.entry.is-archived .entry-title,
.entry.is-archived .annotation {
    opacity: 0.55;
    transition: opacity 0.4s ease;
}

.entry.is-archived .entry-action {
    color: var(--sage-ink);
    border-color: rgba(107, 143, 113, 0.4);
}

/* ----- Archive strip --------------------------------------------------- */

.archive-strip {
    position: relative;
    margin-top: 3rem;
    padding: 3rem 2rem 3rem 2.5rem;
    background: linear-gradient(180deg, var(--parchment-dark) 0%, rgba(26, 22, 16, 0.65) 100%);
    border-top: 1px solid rgba(212, 168, 75, 0.18);
    border-bottom: 1px solid rgba(212, 168, 75, 0.12);
}

.archive-strip::before {
    content: "";
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background: var(--amber-glow);
    box-shadow: 0 0 12px rgba(212, 168, 75, 0.4);
}

.archive-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    color: var(--amber-glow);
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
}

.archive-lede {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 0.95rem;
    color: rgba(232, 220, 192, 0.75);
    margin-bottom: 1.75rem;
    max-width: 540px;
}

.archive-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.archive-item {
    display: grid;
    grid-template-columns: minmax(8rem, auto) 1fr auto;
    align-items: center;
    gap: 1.25rem;
    padding: 0.8rem 0;
    border-bottom: 1px dotted rgba(139, 105, 20, 0.25);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: background 0.3s ease, padding-left 0.3s ease;
    cursor: default;
}

.archive-item:last-child {
    border-bottom: none;
}

.archive-item:hover {
    background: rgba(61, 43, 31, 0.18);
    padding-left: 0.75rem;
}

.archive-date {
    font-style: italic;
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    color: var(--burnished-gold);
    text-transform: uppercase;
}

.archive-name {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 400;
    color: var(--vellum-light);
    line-height: 1.3;
}

/* ----- Colophon -------------------------------------------------------- */

.colophon {
    margin-top: 4rem;
    padding: 3rem 0 1rem;
    border-top: 1px solid rgba(212, 168, 75, 0.18);
    text-align: center;
}

.colophon::before {
    content: "\2756 \00a0 \2756 \00a0 \2756";
    display: block;
    color: var(--amber-glow);
    font-size: 0.8rem;
    letter-spacing: 0.5em;
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.colophon-inner {
    max-width: 540px;
    margin: 0 auto;
    font-family: var(--font-body);
    font-style: italic;
    font-size: 0.9rem;
    line-height: 1.7;
    color: rgba(232, 220, 192, 0.7);
}

.colophon-line {
    margin-bottom: 0.6rem;
}

.colophon-mark {
    color: var(--amber-glow);
    font-style: normal;
    margin-right: 0.4rem;
}

.colophon-email {
    color: var(--amber-glow);
    border-bottom: 1px dashed rgba(212, 168, 75, 0.5);
    padding-bottom: 1px;
    font-style: normal;
}

.colophon-fine {
    margin-top: 1.25rem;
    font-size: 0.78rem;
    color: rgba(139, 105, 20, 0.7);
    letter-spacing: 0.08em;
}

/* ----- Reveal animation ------------------------------------------------ */

.entry,
.archive-item {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.9s ease, transform 0.9s ease;
}

.entry.is-revealed,
.archive-item.is-revealed {
    opacity: 1;
    transform: translateY(0);
}

.hero-day {
    animation: ember-pulse 4.7s ease-in-out infinite;
}

@keyframes ember-pulse {
    0%, 100% { text-shadow: 0 0 40px rgba(212, 168, 75, 0.25), 0 2px 0 rgba(15, 12, 8, 0.8); }
    50%      { text-shadow: 0 0 60px rgba(212, 168, 75, 0.45), 0 2px 0 rgba(15, 12, 8, 0.8); }
}

/* ----- Responsive ------------------------------------------------------ */

@media (max-width: 720px) {
    .page-frame {
        padding: 2.5rem 1.25rem 4rem;
    }

    .journal {
        padding-left: 2rem;
    }

    .journal::before {
        left: 0.25rem;
    }

    .entry::before {
        left: -1.75rem;
    }

    .entry::after {
        left: -1.4rem;
    }

    .annotation {
        margin-left: 1rem;
    }

    .hero {
        padding: 2.5rem 0;
    }

    .hero-datestamp {
        gap: 0.75rem;
        padding: 1.25rem 1.5rem;
    }

    .archive-item {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    .archive-strip {
        padding: 2rem 1.25rem;
    }
}

@media (max-width: 420px) {
    .masthead-line {
        flex-wrap: wrap;
        gap: 0.5rem;
        font-size: 0.7rem;
    }

    .hero-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .hero-meta-divider {
        display: none;
    }

    .entry-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}
