/* Ramblings: the plain markdown reading column, framed like a Wii channel screen
   (striped Wii backdrop, rounded title, white card, blue-lined bottom bar with a Menu pill). */
:root {
    --blue: #34bbed;
    --glow: rgba(52, 187, 237, 0.55);
    --bar-h: clamp(110px, 17vh, 150px);
    --rounded: 'M PLUS Rounded 1c', ui-rounded, system-ui, sans-serif;
}
html {
    background: #f2f2f2;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}
body {
    margin: 0;
    padding: 0 16px calc(var(--bar-h) + 40px);
}
/* The stripes stay put while the post scrolls. A fixed layer rather than
   background-attachment: fixed, which iOS Safari ignores. */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background: #f2f2f2 repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.95) 0 2px, rgba(0, 0, 0, 0.028) 2px 4px);
}

/* ---- title, like an opened channel's banner ---- */
.post-head {
    font-family: var(--rounded);
    text-align: center;
    padding: clamp(32px, 7vh, 64px) 0 clamp(22px, 4vh, 36px);
}
.post-head h1 {
    margin: 0 auto;
    max-width: 1100px;
    font-size: clamp(26px, 4vw, 40px);
    font-weight: 800;
    line-height: 1.2;
    color: #4a4a4a;
}
.post-head p {
    margin: 8px 0 0;
    font-size: 15px;
    font-weight: 700;
    color: #8a8a8a;
}

/* ---- the post: browser-default serif markdown look, on a white Wii card ---- */
.post-card {
    box-sizing: border-box;
    max-width: 680px;
    margin: 0 auto;
    padding: 8px 40px 28px;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 24px;
    box-shadow:
        0 0 0 2px rgba(0, 0, 0, 0.06),
        0 8px 24px rgba(0, 0, 0, 0.12);
    font-family: serif;
    font-size: 17px;
    line-height: 1.45;
    color: #222;
    overflow-wrap: break-word;
    animation: card-in 0.5s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}
@keyframes card-in {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.985);
    }
}
/* Arriving from the home page's preview card, the view transition already grows the card
   into place (post.js marks html.vt), so skip the fade-up. */
html.vt .post-card {
    animation: none;
}
@media (prefers-reduced-motion: reduce) {
    .post-card {
        animation: none;
    }
}

/* ---- page transition from the home page's preview (names match index.html) ---- */
@media (prefers-reduced-motion: no-preference) {
    @view-transition {
        navigation: auto;
    }
}
.post-card {
    view-transition-name: post-card;
}
.post-head h1 {
    view-transition-name: post-title;
}
.post-head p {
    view-transition-name: post-year;
}
.post-bar {
    view-transition-name: wii-bar;
}
.post-bar .pill {
    view-transition-name: menu-pill;
}
::view-transition-group(*) {
    animation-duration: 0.42s;
    animation-timing-function: cubic-bezier(0.2, 0.8, 0.3, 1);
}
.post-card h2 {
    margin-top: 1.6em;
}
.post-card a {
    color: #1683b5;
    text-underline-offset: 2px;
}
.post-card a:hover {
    text-decoration: none;
}
.post-card img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow:
        0 0 0 1px #e4e4e4,
        0 6px 18px rgba(0, 0, 0, 0.08);
}
.post-card code,
.post-card pre {
    background: #eee;
    border-radius: 6px;
}
.post-card code {
    padding: 0 5px;
    font-size: 0.88em;
}
.post-card pre {
    padding: 10px 12px;
    overflow: auto;
    line-height: 1.35;
}
.post-card pre > code {
    padding: 0;
}
.post-card blockquote {
    margin: 1em 0;
    padding: 2px 14px;
    border-left: 5px solid #d3d3d3;
    border-radius: 0 8px 8px 0;
    background: #f1f1f1;
    color: rgba(0, 0, 0, 0.6);
}

/* ---- bottom bar: Menu goes back to the Wii menu (home page) ---- */
.post-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    height: var(--bar-h);
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(rgba(248, 248, 248, 0.97), rgba(214, 214, 214, 0.98));
    border-top: 3px solid var(--blue);
}
.pill {
    width: clamp(140px, 22vw, 290px);
    height: clamp(54px, 8vh, 80px);
    border-radius: 999px;
    background: linear-gradient(#ffffff, #e9e9e9);
    box-shadow:
        inset 0 0 0 3px #c4c4c4,
        0 3px 7px rgba(0, 0, 0, 0.13);
    display: grid;
    place-items: center;
    font-family: var(--rounded);
    font-size: clamp(19px, 2.3vw, 28px);
    font-weight: 700;
    color: #6c6c6c;
    text-decoration: none;
    transition:
        transform 0.16s ease,
        box-shadow 0.16s ease;
}
.pill:hover,
.pill:focus-visible {
    outline: none;
    transform: scale(1.06);
    box-shadow:
        inset 0 0 0 3px var(--blue),
        0 0 16px 3px var(--glow);
    color: #3a3a3a;
}

/* ---- Wii Remote pointers, same as the home page ---- */
@media (pointer: fine) {
    html {
        cursor:
            url('/home/cursor.png') 13 8,
            auto;
    }
    a {
        cursor:
            url('/home/cursor-tilt.png') 8 9,
            pointer;
    }
    html.grabbing,
    html.grabbing * {
        cursor:
            url('/home/cursor-grab.png') 13 8,
            grabbing !important;
    }
}

/* ---- phones ---- */
@media (max-width: 700px) {
    :root {
        --bar-h: 100px;
    }
    body {
        padding: 0 10px calc(var(--bar-h) + 24px);
    }
    .post-head {
        padding: 28px 8px 18px;
    }
    .post-card {
        padding: 4px 20px 22px;
        border-radius: 18px;
    }
    .pill {
        width: 150px;
        height: 50px;
        font-size: 17px;
    }
}
