/* ===================== PAGE BOTTOM =====================
   The page is the night; the footer is the morning. On pages that mark their last section
   with .footer-sheet, the footer waits underneath and that section lifts away like a sheet
   to uncover it, while a sun in the theme's accent colour rises behind the name.
   Also: the back-to-top button, and sample app notifications (notify.js). */

.site-footer {
    --paper: #f8f1e8;
    --paper-2: #f3e4d4;
    --ink: #1c1930;
    --ink-2: #4b4559;
    --ink-3: #847c8c;
    position: relative; overflow: hidden; isolation: isolate;
    padding: 84px 0 0; border-top: 0;
    background: linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
    color: var(--ink);
}
/* morning light spilling up from the horizon */
.site-footer::before {
    content: ''; position: absolute; inset: 0; z-index: -2; pointer-events: none;
    background:
        radial-gradient(90% 70% at 50% 118%, rgba(var(--accent-rgb), 0.34), transparent 62%),
        radial-gradient(60% 40% at 50% 100%, rgba(var(--accent-light-rgb), 0.28), transparent 70%);
}
/* the sun, rising as the footer is uncovered (--rise goes 0 → 1) */
.footer-sun {
    position: absolute; left: 50%; bottom: 0; z-index: -1; pointer-events: none;
    width: min(52vw, 640px); aspect-ratio: 1; border-radius: 50%;
    background: radial-gradient(circle closest-side at 50% 50%,
        rgba(255, 253, 247, 0.95) 0%, rgba(255, 246, 232, 0.9) 24%,
        rgba(var(--accent-light-rgb), 0.5) 55%, rgba(var(--accent-rgb), 0.16) 80%, rgba(var(--accent-rgb), 0) 100%);
    opacity: calc(0.35 + 0.65 * var(--rise, 1));
    transform: translate(-50%, calc(78% - 30% * var(--rise, 1)));
    will-change: transform;
}
.site-footer .container { position: relative; }
.footer-grid {
    display: grid; grid-template-columns: 1.4fr 2fr 1.4fr; gap: 40px; align-items: center;
}
.site-footer .footer-brand { display: flex; align-items: center; gap: 14px; font-size: inherit; font-weight: inherit; }
.site-footer .footer-brand img { width: 44px; height: 44px; border-radius: 11px; box-shadow: 0 6px 18px rgba(40, 24, 10, 0.18); }
.footer-name { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
.footer-tag { font-size: 13px; color: var(--ink-3); }
.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 24px; }
.footer-nav a {
    white-space: nowrap; font-size: 14px; font-weight: 500; color: var(--ink-2); text-decoration: none;
    transition: color 0.2s;
}
.footer-nav a:hover { color: rgb(var(--accent-rgb)); }
.footer-meta {
    display: flex; flex-direction: column; gap: 6px; text-align: right;
    font-size: 12px; line-height: 1.5; color: var(--ink-3);
}
.footer-meta a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.footer-meta a:hover { color: var(--ink-2); }
.footer-wordmark {
    margin: 72px 0 -0.17em; text-align: center; white-space: nowrap; user-select: none; pointer-events: none;
    font-size: 14.1vw; font-weight: 900; line-height: 0.82; letter-spacing: -0.055em; color: var(--ink);
}
.footer-wordmark em {
    font-style: normal;
    background: linear-gradient(135deg, rgb(var(--accent-rgb)), rgb(var(--accent-light-rgb)));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
/* a deeper shade of the accent, so "2day" stands out against the paper and the sun */
@supports (color: color-mix(in srgb, red 50%, blue)) {
    .footer-wordmark em {
        background-image: linear-gradient(135deg,
            color-mix(in srgb, rgb(var(--accent-rgb)) 78%, #1c1930), rgb(var(--accent-rgb)));
    }
}
/* the paper takes a hint of the theme's colour, so a blue or green sun still sits well on it */
@supports (color: color-mix(in srgb, red 50%, blue)) {
    .site-footer {
        --paper: color-mix(in srgb, #f8f1e8 90%, rgb(var(--accent-light-rgb)));
        --paper-2: color-mix(in srgb, #f3e4d4 86%, rgb(var(--accent-light-rgb)));
    }
}

/* Reveal: the footer is fixed underneath, reaching 48px up behind the sheet so its rounded
   corners always show paper. It is only painted once the sheet covers its spot, so the
   page's other (transparent) sections never show it through. */
html.has-footer-reveal .site-footer {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 0; padding-top: 132px;
    visibility: hidden;
}
html.has-footer-reveal .site-footer.is-under { visibility: visible; }
html.has-footer-reveal .footer-sheet {
    position: relative; z-index: 1;
    margin-bottom: calc(var(--footer-h, 48px) - 48px);
    border-radius: 0 0 44px 44px; overflow: clip;
    box-shadow: 0 36px 60px -26px rgba(20, 14, 6, 0.55);
}

@media (max-width: 900px) {
    .footer-grid { grid-template-columns: 1fr; gap: 26px; }
    .footer-nav { justify-content: flex-start; }
    .footer-meta { text-align: left; }
}
@media (max-width: 720px) {
    .site-footer { padding-top: 56px; }
    html.has-footer-reveal .site-footer { padding-top: 104px; }
    html.has-footer-reveal .footer-sheet { border-radius: 0 0 30px 30px; }
    .footer-wordmark { margin-top: 48px; }
    .footer-sun { width: 70vw; }
}

/* ===================== BACK TO TOP =====================
   Glass in the theme's colours, bottom right, with a ring that fills as you scroll. */
.to-top {
    position: fixed; right: 22px; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); z-index: 900;
    width: 56px; height: 56px; padding: 0; display: grid; place-items: center;
    border: 0; border-radius: 50%; cursor: pointer; color: var(--text);
    background: rgba(var(--bg2-rgb), 0.62);
    -webkit-backdrop-filter: blur(18px) saturate(150%); backdrop-filter: blur(18px) saturate(150%);
    box-shadow: 0 10px 30px rgba(var(--shadow-color), 0.35), 0 0 24px rgba(var(--accent-rgb), 0.18),
        inset 0 0 0 1px rgba(var(--text-rgb), 0.08);
    opacity: 0; transform: translateY(16px) scale(0.86); pointer-events: none;
    transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1.1), background 0.3s, color 0.3s;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top::after { content: ''; position: absolute; inset: -18px -22px -22px -18px; border-radius: 24px; }
.to-top-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.to-top-ring circle { fill: none; stroke-width: 1.8; }
.to-top-track { stroke: rgba(var(--text-rgb), 0.14); }
.to-top-progress {
    stroke: rgb(var(--accent-rgb)); stroke-linecap: round;
    stroke-dasharray: 163.4; stroke-dashoffset: calc(163.4px * (1 - var(--read, 0)));
    filter: drop-shadow(0 0 4px rgba(var(--accent-rgb), 0.7));
}
.to-top-arrow { position: relative; transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1.2); }
.to-top:hover { color: rgb(var(--accent-light-rgb)); background: rgba(var(--bg2-rgb), 0.85); }
.to-top:hover .to-top-arrow { transform: translateY(-3px); }
.to-top:active { transform: scale(0.94); }
.to-top:focus-visible { outline: 2px solid rgb(var(--accent-rgb)); outline-offset: 4px; }
/* over the morning footer it turns to paper */
.to-top.is-paper {
    color: #1c1930; background: rgba(255, 250, 243, 0.82);
    box-shadow: 0 10px 28px rgba(60, 34, 10, 0.22), inset 0 0 0 1px rgba(28, 25, 48, 0.06);
}
.to-top.is-paper .to-top-track { stroke: rgba(28, 25, 48, 0.14); }
.to-top.is-paper:hover { color: rgb(var(--accent-rgb)); background: rgba(255, 252, 247, 0.96); }
@media (max-width: 720px) {
    .to-top { right: 14px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: 50px; height: 50px; }
}

/* ===================== APP NOTIFICATIONS =====================
   iOS-style banners from WakeUp 2day, under the top bar on the right (top on phones). */
.wu-notes {
    position: fixed; top: 88px; right: 20px; width: 352px; z-index: 990; pointer-events: none;
}
.wu-note {
    position: relative; display: grid; grid-template-columns: 38px minmax(0, 1fr) 22px; align-items: center; gap: 10px;
    padding: 10px 10px 11px 12px; border-radius: 22px; cursor: pointer;
    background: rgba(44, 44, 50, 0.74); color: #fff;
    -webkit-backdrop-filter: blur(22px) saturate(1.8); backdrop-filter: blur(22px) saturate(1.8);
    box-shadow: 0 18px 36px -14px rgba(0, 0, 0, 0.7), inset 0 0 0 0.5px rgba(255, 255, 255, 0.14);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.24; text-align: left;
    transform: translateX(calc(100% + 40px)); opacity: 0; pointer-events: none;
    transition: transform 0.62s cubic-bezier(0.2, 0.9, 0.24, 1.06), opacity 0.32s ease;
    will-change: transform;
}
.wu-notes[data-tone="light"] .wu-note {
    background: rgba(246, 246, 249, 0.82); color: #0b0b0f;
    box-shadow: 0 18px 36px -14px rgba(20, 30, 60, 0.35), inset 0 0 0 0.5px rgba(255, 255, 255, 0.7);
}
.wu-note.is-in { transform: none; opacity: 1; pointer-events: auto; }
.wu-note-icon { width: 38px; height: 38px; border-radius: 9px; display: block; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); }
.wu-note-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.wu-note-title { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wu-note-time { flex: none; font-size: 12px; opacity: 0.5; }
.wu-note-body {
    margin-top: 1px; font-size: 13px; line-height: 1.26; opacity: 0.88;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.wu-note-close {
    appearance: none; align-self: start; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%;
    background: rgba(255, 255, 255, 0.14); color: inherit; font: 400 15px/22px -apple-system, 'Helvetica Neue', Arial, sans-serif;
    text-align: center; cursor: pointer; opacity: 0.75;
}
.wu-notes[data-tone="light"] .wu-note-close { background: rgba(0, 0, 0, 0.07); }
.wu-note-close:hover { opacity: 1; background: rgba(255, 255, 255, 0.26); }
@media (max-width: 720px) {
    .wu-notes { top: 76px; right: 10px; width: min(360px, calc(100vw - 20px)); }
    .wu-note { transform: translateY(-190%) scale(0.94); grid-template-columns: 38px minmax(0, 1fr) 26px; }
    .wu-note-close { width: 26px; height: 26px; line-height: 26px; }
}
@media (prefers-reduced-motion: reduce) {
    .to-top, .to-top-arrow, .wu-note { transition: none; }
    .footer-sun { transform: translate(-50%, 48%); }
}
