/* =========================================================
   mujun.day  -  A Daily Journal of Contradictions
   Cinematic, editorial, warm, scholarly.
   ========================================================= */

/* ---------- Reset / Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
}

body {
    font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
    font-size: 1.05rem;
    line-height: 1.9;
    color: #2b2018;
    background: #faf6ef;
    counter-reset: contradiction;
    overflow-x: hidden;
}

/* ---------- Cinematic letterboxed frame ---------- */
.page-frame {
    position: relative;
    min-height: 100vh;
    background: #faf6ef;
    /* faint vertical type-set rules behind the column */
    background-image:
        linear-gradient(to right, transparent 0, transparent calc(50% - 380px), rgba(168, 147, 126, 0.18) calc(50% - 380px), rgba(168, 147, 126, 0.18) calc(50% - 379px), transparent calc(50% - 379px)),
        linear-gradient(to right, transparent 0, transparent calc(50% + 379px), rgba(168, 147, 126, 0.18) calc(50% + 379px), rgba(168, 147, 126, 0.18) calc(50% + 380px), transparent calc(50% + 380px));
}

.page-frame::before,
.page-frame::after {
    content: "";
    position: fixed;
    left: 0;
    right: 0;
    height: 24px;
    background: #2b2018;
    z-index: 100;
    pointer-events: none;
}

.page-frame::before { top: 0; }
.page-frame::after  { bottom: 0; }

@media (max-width: 720px) {
    .page-frame::before,
    .page-frame::after { height: 14px; }
    .page-frame {
        background-image: none;
    }
}

/* ---------- Masthead ---------- */
.masthead {
    max-width: 720px;
    margin: 0 auto;
    padding: 96px 32px 24px;
    position: relative;
}

.masthead-rule {
    height: 1px;
    background: #2b2018;
    margin: 18px 0;
}

.masthead-rule.top-rule {
    height: 3px;
    background: #2b2018;
    margin-top: 0;
}

.masthead-rule.bottom-rule {
    height: 1px;
    background: #2b2018;
    margin-bottom: 0;
    position: relative;
}

.masthead-rule.bottom-rule::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 4px;
    height: 1px;
    background: #2b2018;
}

.masthead-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: "Inconsolata", "SF Mono", Menlo, monospace;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #a8937e;
    padding: 4px 0;
}

.masthead-meta-center {
    font-style: italic;
    text-transform: none;
    letter-spacing: 0.04em;
    color: #5c7a6e;
    font-family: "Playfair Display", Georgia, serif;
    font-size: 0.95rem;
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    text-align: center;
    padding: 56px 0 64px;
    overflow: hidden;
}

.day-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: "Inconsolata", monospace;
    font-size: clamp(8rem, 22vw, 14rem);
    font-weight: 500;
    color: rgba(199, 135, 90, 0.18);
    letter-spacing: -0.04em;
    line-height: 1;
    pointer-events: none;
    user-select: none;
    z-index: 0;
    transition: color 600ms ease, transform 800ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.kanji-mark {
    position: relative;
    z-index: 1;
    font-family: "Playfair Display", Georgia, serif;
    font-size: 1.3rem;
    color: #d4534b;
    letter-spacing: 0.6em;
    margin-left: 0.6em;
    margin-bottom: 18px;
    opacity: 0.85;
}

.site-title {
    position: relative;
    z-index: 1;
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 5.5rem);
    line-height: 1;
    color: #2b2018;
    letter-spacing: -0.02em;
    margin-bottom: 24px;
}

.site-title .dot {
    color: #d4534b;
    font-style: italic;
}

.site-tagline {
    position: relative;
    z-index: 1;
    max-width: 480px;
    margin: 0 auto 36px;
    font-family: "Playfair Display", Georgia, serif;
    font-style: italic;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #5c7a6e;
}

.hero-counter {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: baseline;
    gap: 12px;
    padding: 8px 18px;
    border: 1px solid rgba(43, 32, 24, 0.2);
    border-radius: 2px;
    background: rgba(250, 246, 239, 0.6);
    backdrop-filter: blur(2px);
}

.counter-label {
    font-family: "Inconsolata", monospace;
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #a8937e;
}

.counter-value {
    font-family: "Inconsolata", monospace;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    color: #2b2018;
    font-weight: 500;
}

/* ---------- Journal column ---------- */
.journal {
    max-width: 100%;
    margin: 0 auto;
}

.entry {
    padding: 80px 32px;
    position: relative;
    counter-increment: contradiction;
    transition: background-color 400ms ease;
}

.entry-cream {
    background: #faf6ef;
}

.entry-parchment {
    background: #f2ece0;
}

.entry > * {
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

/* ---------- Entry header ---------- */
.entry-header {
    margin-bottom: 36px;
    position: relative;
}

.entry-header::before {
    content: "Day " counter(contradiction, decimal-leading-zero);
    display: block;
    font-family: "Inconsolata", monospace;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #c7875a;
    margin-bottom: 14px;
    font-weight: 500;
}

.entry-date {
    font-family: "Inconsolata", monospace;
    font-size: 0.8rem;
    font-variant: small-caps;
    letter-spacing: 0.1em;
    color: #a8937e;
    border-left: 3px solid #c7875a;
    padding-left: 0.75rem;
    margin-bottom: 16px;
}

.entry-title {
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.05;
    color: #2b2018;
    letter-spacing: -0.015em;
    margin-bottom: 12px;
}

.entry-byline {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 0.85rem;
    font-style: italic;
    color: #a8937e;
    letter-spacing: 0.02em;
}

.entry-byline em {
    color: #5c7a6e;
    font-style: italic;
}

/* ---------- Body paragraphs ---------- */
.thesis,
.antithesis {
    font-size: 1.05rem;
    line-height: 1.9;
    color: #2b2018;
}

.thesis p,
.antithesis p {
    margin-bottom: 1.4em;
}

.thesis p:last-child,
.antithesis p:last-child {
    margin-bottom: 0;
}

.paragraph-lead {
    font-size: 1.08rem;
}

.dropcap {
    float: left;
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 700;
    font-size: 4.2rem;
    line-height: 0.85;
    padding: 0.18em 0.12em 0 0;
    color: #d4534b;
    font-style: normal;
}

.paradox-key {
    color: #d4534b;
    font-style: italic;
    font-weight: 600;
    border-bottom: 1px dotted rgba(212, 83, 75, 0.4);
}

/* ---------- Fading divider ---------- */
.divider {
    height: 1px;
    background: linear-gradient(to right, #c7875a 0%, rgba(199, 135, 90, 0.4) 40%, transparent 100%);
    margin: 2.4rem auto;
    max-width: 640px;
    position: relative;
}

.divider::before {
    content: "\00a7";
    position: absolute;
    top: 50%;
    left: 0;
    transform: translate(-150%, -55%);
    color: #c7875a;
    font-family: "Playfair Display", Georgia, serif;
    font-size: 0.9rem;
    opacity: 0.65;
}

/* ---------- Pull quote ---------- */
.pull-quote {
    margin: 3rem auto 1.5rem;
    max-width: 560px;
    text-align: center;
    position: relative;
    padding: 1.5rem 1rem;
}

.pull-quote::before,
.pull-quote::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    height: 1px;
    width: 60px;
    background: #c7875a;
    opacity: 0.5;
}

.pull-quote::before { top: 0; }
.pull-quote::after  { bottom: 0; }

.pull-quote p {
    font-family: "Playfair Display", Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: 1.5rem;
    line-height: 1.45;
    color: #5c7a6e;
}

/* ---------- Entry footer mark ---------- */
.entry-footer {
    text-align: center;
    margin-top: 2.2rem;
}

.entry-mark {
    font-family: "Playfair Display", Georgia, serif;
    color: #c7875a;
    font-size: 1.4rem;
    opacity: 0.6;
    display: inline-block;
    transition: opacity 600ms ease, transform 600ms ease;
}

.entry:hover .entry-mark {
    opacity: 0.9;
    transform: rotate(8deg);
}

/* ---------- Archive ---------- */
.archive {
    max-width: 640px;
    margin: 80px auto 0;
    padding: 0 32px 48px;
}

.archive-rule {
    height: 1px;
    background: #2b2018;
    margin-bottom: 20px;
    position: relative;
}

.archive-rule::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 0;
    right: 0;
    height: 1px;
    background: #2b2018;
}

.archive-title {
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 700;
    font-style: italic;
    font-size: 1.6rem;
    color: #2b2018;
    margin-bottom: 24px;
    text-align: center;
}

.archive-list {
    list-style: none;
}

.archive-list li {
    display: grid;
    grid-template-columns: 64px 1fr 80px;
    align-items: baseline;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px dashed rgba(168, 147, 126, 0.4);
    transition: padding-left 300ms ease, color 300ms ease;
    cursor: pointer;
}

.archive-list li:hover {
    padding-left: 12px;
}

.archive-list li:hover .archive-line {
    color: #d4534b;
}

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

.archive-num {
    font-family: "Inconsolata", monospace;
    font-size: 0.8rem;
    color: #c7875a;
    letter-spacing: 0.08em;
    font-weight: 500;
}

.archive-line {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 1.1rem;
    color: #2b2018;
    font-style: italic;
    transition: color 300ms ease;
}

.archive-meta {
    font-family: "Inconsolata", monospace;
    font-size: 0.75rem;
    color: #a8937e;
    text-align: right;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ---------- Subscribe ---------- */
.subscribe {
    max-width: 640px;
    margin: 0 auto;
    padding: 64px 32px 80px;
    text-align: center;
    background: #f2ece0;
}

.subscribe {
    max-width: 100%;
}

.subscribe > * {
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.subscribe-rule {
    width: 60px;
    height: 1px;
    background: #c7875a;
    margin: 0 auto 32px;
}

.subscribe-eyebrow {
    font-family: "Inconsolata", monospace;
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #a8937e;
    margin-bottom: 14px;
}

.subscribe-headline {
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    line-height: 1.15;
    color: #2b2018;
    margin-bottom: 20px;
    letter-spacing: -0.01em;
}

.subscribe-body {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 1rem;
    line-height: 1.75;
    color: #2b2018;
    margin-bottom: 32px;
}

.subscribe-form {
    display: flex;
    gap: 0;
    max-width: 480px;
    margin: 0 auto;
    border-bottom: 1px solid #2b2018;
    padding-bottom: 4px;
    transition: border-color 300ms ease;
}

.subscribe-form.is-focused {
    border-color: #d4534b;
}

.subscribe-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    padding: 14px 8px;
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 1rem;
    color: #2b2018;
}

.subscribe-input::placeholder {
    color: #a8937e;
    font-style: italic;
}

.subscribe-button {
    background: transparent;
    border: none;
    padding: 14px 4px;
    font-family: "Inconsolata", monospace;
    font-size: 0.78rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #d4534b;
    cursor: pointer;
    white-space: nowrap;
    transition: letter-spacing 250ms ease, color 250ms ease;
}

.subscribe-button:hover {
    letter-spacing: 0.22em;
    color: #2b2018;
}

.subscribe-note {
    font-family: "Playfair Display", Georgia, serif;
    font-style: italic;
    font-size: 0.95rem;
    color: #5c7a6e;
    min-height: 1.4em;
    margin-top: 20px;
    transition: opacity 400ms ease, transform 400ms ease;
    opacity: 0;
    transform: translateY(4px);
}

.subscribe-note.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Colophon ---------- */
.colophon {
    max-width: 720px;
    margin: 0 auto;
    padding: 48px 32px 96px;
    text-align: center;
}

.colophon-rule {
    height: 3px;
    background: #2b2018;
    margin-bottom: 32px;
    position: relative;
}

.colophon-rule::after {
    content: "";
    position: absolute;
    top: 6px;
    left: 0;
    right: 0;
    height: 1px;
    background: #2b2018;
}

.colophon-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 36px;
    text-align: center;
}

.colophon-block {
    padding: 0 8px;
}

.colophon-label {
    font-family: "Inconsolata", monospace;
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #a8937e;
    margin-bottom: 6px;
}

.colophon-value {
    font-family: "Playfair Display", Georgia, serif;
    font-style: italic;
    font-size: 0.95rem;
    color: #2b2018;
    line-height: 1.4;
}

.colophon-line {
    font-family: "Inconsolata", monospace;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    color: #a8937e;
    margin-top: 16px;
}

.colophon-kanji {
    color: #d4534b;
    letter-spacing: 0.3em;
    font-family: "Playfair Display", Georgia, serif;
}

@media (max-width: 640px) {
    .colophon-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .masthead-meta {
        flex-direction: column;
        gap: 6px;
        text-align: center;
    }
    .masthead-meta-center {
        order: -1;
    }
}

/* ---------- Reveal-on-scroll ---------- */
.entry,
.archive,
.subscribe,
.colophon {
    opacity: 1;
}

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 900ms cubic-bezier(0.2, 0.7, 0.2, 1), transform 900ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Subtle ink-jitter on hover for entry titles ---------- */
.entry-title {
    transition: letter-spacing 600ms ease, color 600ms ease;
}

.entry:hover .entry-title {
    letter-spacing: -0.005em;
    color: #2b2018;
}

/* ---------- Selection ---------- */
::selection {
    background: rgba(212, 83, 75, 0.22);
    color: #2b2018;
}
