/* ============================================================
   miris.day  —  daily devlog journal
   palette:
     #faf8f2  notebook paper
     #2a2a3a  fountain pen ink
     #c84b5a  margin red
     #4a7c59  highlighter green
     #5b7fb5  ballpoint blue
     #e8e4dc  eraser smudge
     #8b7d6b  pencil gray
   ============================================================ */

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

html, body {
    width: 100%;
    min-height: 100%;
}

body {
    font-family: "Patrick Hand", "Patrick Hand SC", "Comic Sans MS", cursive;
    font-size: 1rem;
    line-height: 1.8;
    color: #2a2a3a;
    background-color: #faf8f2;
    background-image:
        radial-gradient(circle at 12% 8%, rgba(139, 125, 107, 0.08) 0, transparent 40%),
        radial-gradient(circle at 88% 92%, rgba(200, 75, 90, 0.05) 0, transparent 45%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* page wrapper -------------------------------------------------- */
.page {
    width: 100%;
    min-height: 100vh;
    padding: clamp(1rem, 4vw, 3rem) 0;
}

/* journal column with ruled paper + margin line ---------------- */
.journal {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
    padding: clamp(1.5rem, 4vh, 3rem) clamp(1rem, 3vw, 2rem) clamp(2rem, 5vh, 4rem);
    background-color: #faf8f2;
    background-image: repeating-linear-gradient(
        transparent,
        transparent 23px,
        rgba(200, 196, 188, 0.3) 23px,
        rgba(200, 196, 188, 0.3) 24px
    );
    box-shadow:
        0 1px 0 rgba(42, 42, 58, 0.04),
        0 8px 24px rgba(42, 42, 58, 0.06),
        0 30px 60px rgba(42, 42, 58, 0.04);
    border-radius: 2px;
}

/* margin line */
.journal::before {
    content: "";
    position: absolute;
    top: 0;
    left: 60px;
    width: 1px;
    height: 100%;
    background: rgba(200, 75, 90, 0.3);
    pointer-events: none;
}

/* a few subtle "stains" on the page (ink dot, coffee ring) */
.journal::after {
    content: "";
    position: absolute;
    top: 14%;
    right: clamp(1.5rem, 4vw, 3rem);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1.5px solid rgba(139, 125, 107, 0.18);
    box-shadow: inset 0 0 0 4px rgba(250, 248, 242, 0.0), 0 0 0 6px rgba(139, 125, 107, 0.04);
    pointer-events: none;
    transform: rotate(8deg);
}

/* hero ---------------------------------------------------------- */
.hero {
    padding-left: 88px;
    padding-bottom: clamp(1.5rem, 4vh, 2.5rem);
    margin-bottom: clamp(1.5rem, 4vh, 2.5rem);
    position: relative;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 600ms ease, transform 600ms ease;
}

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

.hero-date {
    font-family: "Patrick Hand", cursive;
    font-size: 1.05rem;
    color: #8b7d6b;
    letter-spacing: 0.02em;
    margin-bottom: 0.25rem;
}

.hero-title {
    font-family: "Caveat", "Patrick Hand", cursive;
    font-weight: 700;
    font-size: clamp(2.4rem, 7vw, 4rem);
    line-height: 1;
    color: #2a2a3a;
    letter-spacing: -0.01em;
    margin-bottom: 0.5rem;
    transform: rotate(-1.2deg);
    display: inline-block;
    position: relative;
}

.hero-title::after {
    content: "";
    position: absolute;
    left: -2px;
    right: -8px;
    bottom: 4px;
    height: 8px;
    background: linear-gradient(
        to right,
        rgba(91, 127, 181, 0.20) 0%,
        rgba(91, 127, 181, 0.28) 60%,
        rgba(91, 127, 181, 0.0) 100%
    );
    border-radius: 4px;
    z-index: -1;
    transform: rotate(0.6deg);
}

.hero-sub {
    font-family: "Patrick Hand", cursive;
    font-size: 1.1rem;
    color: #2a2a3a;
    margin-bottom: 0.75rem;
}

.hero-meta {
    font-family: "Courier Prime", "Courier New", monospace;
    font-size: 0.78rem;
    color: #8b7d6b;
    letter-spacing: 0.04em;
}

/* doodle dividers ---------------------------------------------- */
.doodle {
    position: relative;
    height: 36px;
    margin: clamp(1.25rem, 3vh, 2rem) 0;
    padding-left: 88px;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.85;
}

/* star doodle */
.star {
    display: inline-block;
    width: 18px;
    height: 18px;
    background: #c84b5a;
    clip-path: polygon(
        50% 0%,
        61% 35%,
        98% 35%,
        68% 57%,
        79% 91%,
        50% 70%,
        21% 91%,
        32% 57%,
        2% 35%,
        39% 35%
    );
    transform: rotate(-8deg);
    opacity: 0.75;
}
.doodle-star::before,
.doodle-star::after {
    content: "";
    flex: 1;
    height: 1px;
    background: repeating-linear-gradient(
        to right,
        rgba(139, 125, 107, 0.45) 0 4px,
        transparent 4px 8px
    );
}
.doodle-star::before { display: none; }

/* arrow doodle */
.doodle-arrow {
    align-items: center;
}
.arrow-line {
    width: 64px;
    height: 2px;
    background: #2a2a3a;
    border-radius: 1px;
    transform: rotate(-1.5deg);
    position: relative;
}
.arrow-tip {
    width: 0; height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 10px solid #2a2a3a;
    margin-left: -4px;
    transform: rotate(-1.5deg) translateY(-1px);
}

/* spiral doodle */
.spiral {
    width: 22px;
    height: 22px;
    border: 2px solid #5b7fb5;
    border-radius: 50%;
    border-right-color: transparent;
    border-bottom-color: transparent;
    position: relative;
    transform: rotate(-30deg);
}
.spiral::before {
    content: "";
    position: absolute;
    inset: 4px;
    border: 2px solid #5b7fb5;
    border-radius: 50%;
    border-top-color: transparent;
    border-left-color: transparent;
}

/* dots doodle */
.doodle-dots {
    gap: 14px;
}
.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #8b7d6b;
}
.dot:nth-child(2) { background: #c84b5a; transform: translateY(-2px); }
.dot:nth-child(3) { background: #4a7c59; }

/* leaf doodle */
.leaf {
    width: 26px;
    height: 14px;
    background: #4a7c59;
    border-radius: 0 100% 0 100%;
    transform: rotate(-25deg);
    position: relative;
    opacity: 0.75;
}
.leaf::after {
    content: "";
    position: absolute;
    left: 2px;
    top: 50%;
    width: 22px;
    height: 1px;
    background: rgba(42, 42, 58, 0.4);
    transform: translateY(-50%) rotate(2deg);
}

/* entries ------------------------------------------------------- */
.entry {
    margin-bottom: clamp(2rem, 5vh, 4rem);
    padding-left: 88px;
    padding-right: 4px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 400ms ease, transform 400ms ease;
}

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

.entry-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.25rem;
}

.entry-date {
    font-family: "Caveat", "Patrick Hand", cursive;
    font-weight: 700;
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    color: #2a2a3a;
    line-height: 1.1;
    letter-spacing: -0.01em;
    transform: rotate(-0.5deg);
    display: inline-block;
}

.entry-stamp {
    font-family: "Courier Prime", "Courier New", monospace;
    font-size: 0.78rem;
    color: #8b7d6b;
    letter-spacing: 0.06em;
    border: 1px dashed rgba(139, 125, 107, 0.45);
    padding: 2px 8px;
    border-radius: 2px;
    transform: rotate(1.5deg);
    background: rgba(232, 228, 220, 0.4);
}

.entry-title {
    font-family: "Caveat", "Patrick Hand", cursive;
    font-weight: 700;
    font-size: clamp(1.2rem, 2.6vw, 1.6rem);
    color: #c84b5a;
    margin-bottom: 0.6rem;
    transform: rotate(-0.3deg);
    display: inline-block;
    line-height: 1.2;
}

.entry-body {
    font-family: "Patrick Hand", cursive;
    font-size: 1.02rem;
    line-height: 1.75;
    color: #2a2a3a;
    margin-bottom: 1rem;
}

.entry-body em {
    color: #5b7fb5;
    font-style: normal;
    text-decoration: underline;
    text-decoration-style: wavy;
    text-decoration-color: rgba(91, 127, 181, 0.5);
    text-underline-offset: 3px;
}

/* checklist ---------------------------------------------------- */
.checklist {
    list-style: none;
    margin: 0.5rem 0 1rem 0;
    padding: 0;
}

.task {
    position: relative;
    padding-left: 28px;
    margin-bottom: 0.4rem;
    font-family: "Courier Prime", "Courier New", monospace;
    font-size: 0.92rem;
    line-height: 1.55;
    color: #2a2a3a;
    cursor: pointer;
    user-select: none;
    transition: color 250ms ease;
}

.task .check {
    position: absolute;
    left: 0;
    top: 4px;
    width: 14px;
    height: 14px;
    border: 2px solid #2a2a3a;
    border-radius: 2px;
    background: #faf8f2;
    transition: background-color 250ms ease, border-color 250ms ease;
}

.task .check::after {
    content: "";
    position: absolute;
    left: 2px;
    top: -3px;
    width: 7px;
    height: 12px;
    border-bottom: 2px solid #4a7c59;
    border-right: 2px solid #4a7c59;
    transform: rotate(45deg) scale(0.4);
    opacity: 0;
    transition: transform 250ms ease, opacity 250ms ease;
}

.task .task-text {
    position: relative;
    display: inline;
    transition: color 250ms ease;
}

.task .task-text::after {
    content: "";
    position: absolute;
    left: -2px;
    right: -2px;
    top: 52%;
    height: 1.5px;
    background: #c84b5a;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 320ms ease;
    border-radius: 1px;
    opacity: 0.85;
}

.task.is-done .check {
    border-color: #4a7c59;
    background: rgba(74, 124, 89, 0.06);
}

.task.is-done .check::after {
    opacity: 1;
    transform: rotate(45deg) scale(1);
}

.task.is-done .task-text {
    color: #8b7d6b;
}

.task.is-done .task-text::after {
    transform: scaleX(1);
}

/* notes -------------------------------------------------------- */
.entry-note {
    font-family: "Patrick Hand", cursive;
    font-size: 0.95rem;
    color: #2a2a3a;
    background: rgba(232, 228, 220, 0.55);
    border-left: 3px solid #c84b5a;
    padding: 0.5rem 0.8rem 0.55rem 0.8rem;
    margin: 0.5rem 0 0 0;
    border-radius: 0 4px 4px 0;
    line-height: 1.5;
}

.note-tag {
    display: inline-block;
    font-family: "Courier Prime", "Courier New", monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #c84b5a;
    background: #faf8f2;
    border: 1px solid rgba(200, 75, 90, 0.4);
    padding: 1px 6px;
    border-radius: 2px;
    margin-right: 0.5rem;
    transform: rotate(-1deg);
    vertical-align: middle;
}

.entry-note em {
    color: #5b7fb5;
    font-style: italic;
}

/* code blocks -------------------------------------------------- */
.codeblock {
    background: #e8e4dc;
    border: 1px dashed rgba(139, 125, 107, 0.5);
    border-radius: 3px;
    padding: 0.7rem 0.9rem;
    font-family: "Courier Prime", "Courier New", monospace;
    font-size: 0.82rem;
    line-height: 1.55;
    color: #2a2a3a;
    overflow-x: auto;
    margin: 0.6rem 0 1rem 0;
    white-space: pre;
}

.codeblock code {
    font-family: inherit;
    color: inherit;
    background: none;
}

/* links -------------------------------------------------------- */
.ink-link {
    color: #5b7fb5;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
    text-decoration-color: rgba(91, 127, 181, 0.6);
    transition: color 200ms ease, text-decoration-color 200ms ease;
}

.ink-link:hover {
    color: #c84b5a;
    text-decoration-color: rgba(200, 75, 90, 0.7);
}

/* small entry -------------------------------------------------- */
.entry.small .entry-date {
    font-size: clamp(1.3rem, 3vw, 1.7rem);
    color: #8b7d6b;
}

.entry-sign {
    font-family: "Caveat", cursive;
    font-size: 1.3rem;
    color: #5b7fb5;
    margin-top: 0.5rem;
    transform: rotate(-1deg);
    display: inline-block;
}

/* footer ------------------------------------------------------- */
.page-foot {
    padding-left: 88px;
    margin-top: clamp(2rem, 5vh, 3rem);
    text-align: left;
    opacity: 0.85;
}

.foot-line {
    font-family: "Caveat", cursive;
    font-size: 1.4rem;
    color: #8b7d6b;
    letter-spacing: 0.5em;
    margin-bottom: 0.4rem;
}

.foot-text {
    font-family: "Patrick Hand", cursive;
    font-size: 1rem;
    color: #2a2a3a;
}

.foot-text #pageNum {
    color: #c84b5a;
    font-family: "Courier Prime", monospace;
    font-size: 0.9rem;
    margin: 0 2px;
}

.foot-time {
    font-family: "Courier Prime", monospace;
    font-size: 0.75rem;
    color: #8b7d6b;
    margin-top: 0.3rem;
    letter-spacing: 0.04em;
}

/* responsive --------------------------------------------------- */
@media (max-width: 540px) {
    .journal {
        padding: clamp(1rem, 3vh, 2rem) clamp(0.75rem, 4vw, 1.25rem);
    }
    .journal::before {
        left: 44px;
    }
    .hero,
    .entry,
    .doodle,
    .page-foot {
        padding-left: 64px;
    }
    .entry-stamp {
        font-size: 0.7rem;
    }
    .codeblock {
        font-size: 0.75rem;
    }
    .journal::after {
        right: 1rem;
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 380px) {
    .journal::before {
        left: 32px;
    }
    .hero,
    .entry,
    .doodle,
    .page-foot {
        padding-left: 48px;
    }
    .hero-title {
        font-size: clamp(2rem, 9vw, 3rem);
    }
}

/* tiny pen wiggle on hover for entry titles */
@media (hover: hover) {
    .entry-title {
        transition: transform 200ms ease, color 200ms ease;
    }
    .entry-title:hover {
        transform: rotate(-1deg) translateX(2px);
        color: #4a7c59;
    }
}

/* subtle paper grain animation on hero */
@keyframes paperBreathe {
    0%, 100% { background-position: 0 0; }
    50% { background-position: 0 1px; }
}

.journal {
    animation: paperBreathe 12s ease-in-out infinite;
}
