/* ───────────────────────────────
   RESET / BASE
   ─────────────────────────────── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    background: #000;
    color: #fff;
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Oxygen,
        Ubuntu,
        Cantarell,
        "Open Sans",
        "Helvetica Neue",
        sans-serif;
    font-size: 16px;
    padding: 1rem;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ───────────────────────────────
   STATS BAR
   ─────────────────────────────── */
.stats-bar {
    padding-right: 20px;
    padding-left: 20px;
    padding-bottom: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}
.stats-group {
    display: flex;
    gap: 60px;
}
.stat-item {
    text-align: center;
}
.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
}
.stat-label {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    margin-top: 2px;
}
.nav-controls {
    display: flex;
    gap: 6px;
}
.nav-btn {
    background: #fff;
    color: #000;
    border: none;
    padding: 8px 20px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    border-radius: 2px;
}
.nav-btn:hover {
    background: #fff;
}

@media (max-width: 768px) {
    .nav-btn {
        padding: 6px;
    }
}
/* ───────────────────────────────
   CALENDAR LAYOUT
   ─────────────────────────────── */
.calendar-container{
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* desktop: 3 columns  */
    gap: 16px;
}
/* medium screens (tablets, small laptops) */
@media (max-width: 1024px) {
    .calendar-container {
        grid-template-columns: repeat(2, 1fr);
    } /* 2 columns */
}
/* small screens (phones) */
@media (max-width: 768px) {
    .calendar-container {
        grid-template-columns: 1fr;
    } /* 1 column  */
}

/* ───────────────────────────────
   MONTH / DAY CELLS
   ─────────────────────────────── */
/*.month-grid {
    border: 1px solid #111;
}*/
.month-header {
    background: #000;
    color: #777;
    padding: 15px;
    text-align: center;
    font-weight: bold;
    text-transform: uppercase;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}
.day-header {
    background: #111;
    color: #888;
    padding: 12px 4px;
    text-align: center;
    font-size: 10px;
    font-weight: bold;
}
.day-header:last-child {
    border-right: none;
}

.day-cell {
    min-height: 50px;
    border-right: 1px solid #111;
    border-bottom: 1px solid #111;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}
.day-cell:nth-child(7n) {
    border-right: none;
}

.day-number {
    font-size: 12px;
    color: #888;
}
.day-cell.other-month .day-number {
    color: #111;
}

.word-count {
    font-size: 9px;
    color: #888;
    text-align: right;
    margin-top: auto;
}

.word-count::after{
    content:"words";
    display:block;              /* forces new line */
    font-size:9px;
    font-weight:normal;
    color:inherit;
}

.day-cell.has-entry {
    background: #111;
}
.day-cell.has-entry .word-count {
    color: #fff;
    font-weight: bold;
}

/* ── dark grey scale: 0-300 in 25-word steps ───────────────── */
/* ── darker grey scale: 0-500 in 50-word steps ─────────────── */
.day-cell.word-count-50 {
    background: #121212;
} /*   1- 50 */
.day-cell.word-count-100 {
    background: #181818;
} /*  51-100 */
.day-cell.word-count-150 {
    background: #1f1f1f;
} /* 101-150 */
.day-cell.word-count-200 {
    background: #262626;
} /* 151-200 */
.day-cell.word-count-250 {
    background: #2c2c2c;
} /* 201-250 */
.day-cell.word-count-300 {
    background: #333333;
} /* 251-300 */
.day-cell.word-count-350 {
    background: #3a3a3a;
} /* 301-350 */
.day-cell.word-count-400 {
    background: #404040;
} /* 351-400 */
.day-cell.word-count-450 {
    background: #474747;
} /* 401-450 */
.day-cell.word-count-500 {
    background: #4e4e4e;
} /* 451-500 */

/* >500 words */
.day-cell.word-count-high {
    background: #555555;
}

/* light text still works; if you want darker text on the last
   two shades add rules similar to the example below               */
.day-cell.word-count-450 .day-number,
.day-cell.word-count-450 .word-count,
.day-cell.word-count-500 .day-number,
.day-cell.word-count-500 .word-count,
.day-cell.word-count-high .day-number,
.day-cell.word-count-high .word-count {
    color: #e0e0e0;
}

/* ───────────────────────────────
   RESPONSIVE: STATS BAR
   ─────────────────────────────── */
@media (max-width: 768px) {
    .stats-bar {
        flex-direction: column;
        text-align: center;
    }
    .stats-group {
        justify-content: center;
    }
}

/* ──────────────────────────────────────────────────────────────── */
/*  DAY CELLS – add heat-map colouring                            */
/* ──────────────────────────────────────────────────────────────── */
.day-cell {
    /* existing styles … */
    min-height: 50px;
    border-right: 1px solid #111;
    border-bottom: 1px solid #111;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;

    /* heat-map background: lightness comes from a variable set in JS */
    background-color: hsl(0 0% var(--lightness, 0%));
    transition: background-color 0.25s;
}

/* The text colours stay readable on dark cells */
.day-number,
.word-count {
    color: #bbb;
}
.day-cell .word-count {
    font-size: 9px;
    margin-top: auto;
}

/* Very bright cells (>= 75 % lightness) get darker text for contrast */
.day-cell[data-bright="true"] .day-number,
.day-cell[data-bright="true"] .word-count {
    color: #000;
}

/* ── heading + quote inside stats bar ────────────────────────── */
.stats-header {
    width: 100%; /* full row */
    text-align: center;
    margin-bottom: 8px;
}
.stats-title {
    font-size: 32px;
    letter-spacing: 1px;
    padding-top: 16px;
}
.stats-quote {
    font-size: 12px;
    color: #888;
    font-style: italic;
}

/* keep layout tidy on small screens */
@media (max-width: 768px) {
    .stats-header {
        margin-top: 1rem;
        margin-bottom: 16px;
        width: 60%;
    }
}
