
#daylight {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    transition: background 4s ease, opacity 4s ease;
}

html[data-daypart="dawn"] #daylight {
    background: linear-gradient(180deg, rgba(255, 176, 140, 0.18) 0%, rgba(255, 210, 170, 0.06) 40%, transparent 70%);
}

html[data-daypart="day"] #daylight {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.09) 0%, transparent 55%);
}

html[data-daypart="dusk"] #daylight {
    background: linear-gradient(0deg, rgba(255, 138, 64, 0.20) 0%, rgba(190, 90, 170, 0.10) 45%, transparent 80%);
}

html[data-daypart="evening"] #daylight {
    background: radial-gradient(ellipse at 50% 40%, transparent 40%, rgba(0, 0, 0, 0.18) 100%);
}

html[data-daypart="night"] #daylight {
    background:
        radial-gradient(ellipse at 50% 35%, transparent 30%, rgba(0, 0, 12, 0.32) 100%),
        linear-gradient(180deg, rgba(0, 0, 20, 0.16), rgba(0, 0, 20, 0.16));
}

.onthisday {
    width: 90%;
    max-width: 900px;
    margin: 0 auto 22px;
    display: grid;
    gap: 12px;
    text-align: left;
}

.onthisday-card {
    position: relative;
    padding: 18px 22px 14px;
    border-radius: 20px;
    background:
        linear-gradient(135deg, rgba(var(--t-glow-rgb), 0.10), transparent 60%),
        rgba(var(--t-panel-rgb), 0.88);
    border: 1px solid rgba(var(--t-accent-rgb), 0.35);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    color: var(--t-text);
    font-family: Muli, sans-serif;
    overflow: hidden;
}

    .onthisday-card::before {
        content: "";
        position: absolute;
        inset: 0 auto 0 0;
        width: 4px;
        background: linear-gradient(180deg, var(--t-accent), transparent);
    }

.onthisday-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.onthisday-badge {
    font-family: 'Caveat', 'Courier New', cursive;
    font-size: 26px;
    line-height: 1;
    color: var(--t-accent);
}

.onthisday-date {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    opacity: 0.7;
}

.onthisday-excerpt {
    margin: 0;
    font-size: 17px;
    line-height: 1.6;
    opacity: 0.92;
}

.onthisday-full {
    display: block !important;
    -webkit-line-clamp: unset !important;
    font-size: 18px;
    line-height: 1.6;
}

    .onthisday-full img,
    .onthisday-full video {
        max-width: 100%;
        height: auto;
    }

.onthisday-toggle {
    width: auto !important;
    margin: 10px 0 0 !important;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(var(--t-accent-rgb), 0.5);
    background: transparent;
    color: var(--t-accent);
    font-family: Muli, sans-serif;
    font-size: 14px !important;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

    .onthisday-toggle:hover {
        background: rgba(var(--t-accent-rgb), 0.15);
    }

.post-end {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin: 26px auto 8px;
    padding-top: 18px;
    border-top: 1px dashed rgba(var(--t-accent-rgb), 0.25);
    width: min(100%, 560px);
}

.daily-textbox:not(.is-open) > .post-end[data-collapsible] {
    display: none;
}

.post-signature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-family: 'Caveat', cursive;
    color: var(--t-text);
    line-height: 1.15;
    user-select: none;
}

.sign-line {
    display: inline-block;
    padding: 0.08em 0.4em 0.08em 0.12em;
    clip-path: inset(0 100% 0 0);
    -webkit-clip-path: inset(0 100% 0 0);
}

.sign-phrase {
    font-size: clamp(24px, 4vw, 32px);
    font-weight: 600;
}

.sign-name {
    font-size: clamp(22px, 3.4vw, 28px);
    color: var(--t-accent);
    transform: rotate(-3deg);
    margin-left: 40%;
    padding-right: 0.6em;
}

.post-signature.is-drawn .sign-line {
    animation: sign-ink 2.6s cubic-bezier(.45, .05, .35, 1) forwards;
}

.post-signature.is-drawn .sign-name {
    animation-delay: 1.9s;
    animation-duration: 1.2s;
}

.post-signature.is-drawn .sign-name:only-child {
    animation-delay: 0.2s;
}

@keyframes sign-ink {
    from { clip-path: inset(0 100% 0 0); -webkit-clip-path: inset(0 100% 0 0); }
    to { clip-path: inset(-25% -15% -25% -5%); -webkit-clip-path: inset(-25% -15% -25% -5%); }
}

@media (prefers-reduced-motion: reduce) {
    .sign-line { clip-path: none; -webkit-clip-path: none; }
    .post-signature.is-drawn .sign-line { animation: none; }
}

.tea-treat {
    display: flex;
    justify-content: center;
}

.tea-treat-btn {
    width: auto !important;
    margin: 0 !important;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 10px 22px 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(var(--t-accent-rgb), 0.45);
    background: rgba(var(--t-panel-rgb), 0.75);
    color: var(--t-text);
    font-family: Muli, sans-serif;
    font-size: 16px !important;
    text-align: left;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

    .tea-treat-btn:hover:not(:disabled) {
        transform: translateY(-2px);
        border-color: var(--t-accent);
        box-shadow: 0 8px 24px rgba(var(--t-glow-rgb), 0.18);
    }

    .tea-treat-btn:disabled {
        cursor: progress;
        opacity: 0.8;
    }

.tea-treat-text b {
    display: block;
    font-size: 16px;
    color: var(--t-accent);
}

.tea-treat-text small {
    display: block;
    font-size: 13px;
    opacity: 0.8;
}

.tea-glass {
    width: 44px !important;
    height: 55px !important;
    flex: 0 0 auto;
    overflow: visible;
}

.tea-glass-body {
    fill: rgba(255, 255, 255, 0.08);
    stroke: rgba(255, 255, 255, 0.75);
    stroke-width: 2;
}

.tea-saucer {
    fill: rgba(255, 255, 255, 0.18);
    stroke: rgba(255, 255, 255, 0.55);
    stroke-width: 1.5;
}

.tea-liquid {
    fill: #c0471c;
    opacity: 0.92;
    transform: translateY(46px);
    transition: transform 1.4s cubic-bezier(.3, .7, .3, 1);
}

.tea-glass-shine {
    fill: none;
    stroke: rgba(255, 255, 255, 0.55);
    stroke-width: 2;
    stroke-linecap: round;
}

.tea-steam path {
    fill: none;
    stroke: rgba(255, 255, 255, 0.6);
    stroke-width: 2;
    stroke-linecap: round;
    opacity: 0;
}

.tea-treat.is-poured .tea-liquid,
.tea-treat-btn:hover .tea-liquid {
    transform: translateY(6px);
}

.tea-treat.is-poured .tea-steam path {
    animation: tea-steam 2.6s ease-in-out infinite;
}

    .tea-treat.is-poured .tea-steam path:nth-child(2) { animation-delay: 0.5s; }
    .tea-treat.is-poured .tea-steam path:nth-child(3) { animation-delay: 1s; }

@keyframes tea-steam {
    0% { opacity: 0; transform: translateY(6px); }
    40% { opacity: 0.8; }
    100% { opacity: 0; transform: translateY(-8px); }
}

.ambient-toggle {
    position: fixed;
    right: 18px;
    bottom: 74px;
    z-index: 50;
    width: 46px !important;
    height: 46px;
    margin: 0 !important;
    padding: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid rgba(var(--t-accent-rgb), 0.55);
    background-color: rgba(var(--t-panel-rgb), 0.85);
    color: var(--t-accent);
    cursor: pointer;
    transition: box-shadow 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
}

    .ambient-toggle:hover {
        border-color: var(--t-accent);
        box-shadow: 0 0 16px rgba(var(--t-glow-rgb), 0.45);
    }

    .ambient-toggle svg {
        width: 22px !important;
        height: 22px !important;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.7;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .ambient-toggle .amb-on { display: none; }
    .ambient-toggle[aria-pressed="true"] .amb-on { display: block; }
    .ambient-toggle[aria-pressed="true"] .amb-off { display: none; }

    .ambient-toggle[aria-pressed="true"]::after {
        content: "";
        position: absolute;
        inset: -4px;
        border-radius: 50%;
        border: 1px solid rgba(var(--t-accent-rgb), 0.5);
        animation: amb-pulse 2.4s ease-out infinite;
    }

@keyframes amb-pulse {
    from { transform: scale(0.9); opacity: 0.9; }
    to { transform: scale(1.35); opacity: 0; }
}

@media (max-width: 500px) {
    .ambient-toggle {
        right: 12px;
        bottom: 62px;
        width: 40px !important;
        height: 40px;
    }
}
