/* deepsea-dark theme
   The dark, more formal sibling of deepsea: near-black page, quiet blue glow, calm body
   text - but the same game-menu personality where it counts (slanted italic headings,
   the red/white slash on whatever is selected, the tilted home menu, the hint bar).
   Plain CSS, no images.

   Sections:  1. tokens  2. base  3. background  4. header  5. home  6. list pages
              7. single page  8. hint bar + misc  9. code colours  10. small screens  11. motion */


/* ===== 1. tokens ===== */
:root {
    --sea-top: #2a9bff;
    --sea-mid: #1348dc;
    --sea-low: #0a23a6;
    --sea-deep: #050f5c;

    --cyan: #4ff0ff;
    --cyan-soft: #9ff7ff;
    --azure: #3fa2ff;
    --blue: #2f6dff;
    --white: #ffffff;
    --ink: #04081f;
    --red: #ff1e3c;
    --pink: #ff6fc0;
    --yellow: #ffe34d;

    --page: #07090f;
    --panel: #0d111d;
    --panel-edge: rgba(143, 184, 255, 0.16);
    --text: #c9d2e3;
    --muted: #8793ab;

    --display: "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
    --body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: ui-monospace, "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;

    --slant: -8deg;
    --content: 820px;
}


/* ===== 2. base ===== */
*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-padding-top: 24px;
    overflow-x: clip;
    background:
        radial-gradient(60% 45% at 85% -5%, rgba(47, 109, 255, 0.22), transparent 70%),
        radial-gradient(45% 40% at 0% 100%, rgba(79, 240, 255, 0.07), transparent 70%),
        repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 16px);
    background-color: var(--page);
    background-attachment: fixed;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--body);
    font-size: 17px;
    line-height: 1.75;
    color: var(--text);
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
::selection { background: var(--red); color: var(--white); }

:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }


/* ===== 3. background ===== */
.bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

/* Light shafts falling from the surface. */
.bg-rays {
    position: absolute;
    inset: -20% -10% 0 -10%;
    background: repeating-linear-gradient(100deg,
        transparent 0 70px,
        rgba(120, 170, 255, 0.035) 70px 110px,
        transparent 110px 190px,
        rgba(120, 170, 255, 0.025) 190px 210px,
        transparent 210px 300px);
    mask-image: linear-gradient(180deg, #000 0%, transparent 75%);
    -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 75%);
    filter: blur(3px);
    animation: sway 14s ease-in-out infinite alternate;
}

/* Rippling light blobs near the surface. */
.bg-caustics {
    display: none; /* too playful for the dark variant */
    position: absolute;
    inset: -10% -10% 55% -10%;
    background:
        radial-gradient(40px 14px at 12% 30%, rgba(255, 255, 255, 0.35), transparent 70%),
        radial-gradient(70px 20px at 28% 18%, rgba(255, 255, 255, 0.25), transparent 70%),
        radial-gradient(90px 24px at 55% 34%, rgba(255, 255, 255, 0.22), transparent 70%),
        radial-gradient(60px 18px at 74% 14%, rgba(255, 255, 255, 0.30), transparent 70%),
        radial-gradient(110px 26px at 88% 40%, rgba(255, 255, 255, 0.18), transparent 70%),
        radial-gradient(50px 16px at 40% 52%, rgba(255, 255, 255, 0.20), transparent 70%);
    filter: blur(2px);
    animation: drift 18s ease-in-out infinite alternate;
}

/* Glassy shards drifting in the water. */
.shard {
    position: absolute;
    width: 46px;
    height: 70px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.55), rgba(255, 111, 192, 0.25));
    clip-path: polygon(20% 0, 100% 18%, 78% 100%, 0 76%);
    opacity: 0.12;
    animation: float 22s ease-in-out infinite alternate;
}
.shard.s1 { left: 18%; top: 22%; transform: rotate(18deg); }
.shard.s2 { left: 34%; top: 70%; width: 30px; height: 44px; animation-delay: -4s; background: linear-gradient(135deg, rgba(79, 240, 255, 0.7), rgba(255, 255, 255, 0.1)); }
.shard.s3 { left: 62%; top: 12%; width: 24px; height: 36px; animation-delay: -9s; }
.shard.s4 { left: 80%; top: 58%; width: 54px; height: 80px; animation-delay: -13s; background: linear-gradient(135deg, rgba(255, 111, 192, 0.55), rgba(79, 240, 255, 0.15)); }
.shard.s5 { left: 8%; top: 84%; width: 20px; height: 30px; animation-delay: -7s; }
.shard.s6 { left: 92%; top: 26%; width: 28px; height: 42px; animation-delay: -16s; }

@keyframes sway { from { transform: translateX(-30px) skewX(-2deg); } to { transform: translateX(30px) skewX(2deg); } }
@keyframes drift { from { transform: translate(-20px, 0) scale(1); } to { transform: translate(30px, 10px) scale(1.05); } }
@keyframes float { from { translate: 0 0; rotate: 0deg; } to { translate: 20px -60px; rotate: 40deg; } }

/* Giant vertical word down the left edge, reading bottom to top. */
.side-word {
    position: fixed;
    left: -0.06em;
    bottom: 0;
    z-index: -1;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-family: var(--display);
    font-weight: 900;
    font-style: italic;
    font-size: min(30vh, 260px);
    line-height: 0.8;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    color: transparent;
    -webkit-text-stroke: 2px rgba(79, 240, 255, 0.14);
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
}


/* ===== 4. header ===== */
.header { position: relative; z-index: 2; }

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 24px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 22px 40px 0;
}

.logo {
    font-family: var(--display);
    font-weight: 900;
    font-style: italic;
    font-size: 30px;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    color: var(--white);
    text-shadow: 3px 3px 0 var(--ink);
}

.menu {
    display: flex;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.menu a {
    position: relative;
    display: block;
    padding: 2px 14px;
    font-family: var(--display);
    font-weight: 800;
    font-style: italic;
    font-size: 21px;
    text-transform: uppercase;
    color: var(--muted);
    transition: color 0.15s;
}
.menu a span { position: relative; z-index: 1; }
.menu a::before {
    content: "";
    position: absolute;
    inset: 2px 0;
    background: var(--red);
    transform: skewX(-14deg) scaleX(0);
    transform-origin: left;
    box-shadow: 4px 4px 0 var(--white);
    transition: transform 0.18s cubic-bezier(.2, .9, .3, 1.3);
}
.menu a:hover { color: var(--white); }
.menu a.active { color: var(--ink); }
.menu a.active::before { transform: skewX(-14deg) scaleX(1); }


/* ===== shared: main column + slash titles ===== */
.main {
    position: relative;
    z-index: 1;
    flex: 1;
    width: 100%;
    max-width: calc(var(--content) + 80px);
    margin: 0 auto;
    padding: 40px 40px 140px;
}
.home .main { max-width: 1280px; padding-bottom: 120px; }

.breadcrumbs {
    font-family: var(--display);
    font-weight: 700;
    font-style: italic;
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}
.breadcrumbs a:hover { color: var(--white); }
.breadcrumbs .sep { margin: 0 8px; opacity: 0.6; }

/* Huge black-on-red-on-white slashed heading, the "selected item" look. */
.slash-title {
    position: relative;
    display: inline-block;
    margin: 6px 0 36px;
    padding: 0 0.25em;
    font-family: var(--display);
    font-weight: 900;
    font-style: italic;
    font-size: clamp(56px, 10vw, 104px);
    line-height: 0.95;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    color: var(--ink);
    /* solid white outline so the black letters read where they stick out onto the dark page */
    text-shadow:
        3px 0 0 var(--white), -3px 0 0 var(--white), 0 3px 0 var(--white), 0 -3px 0 var(--white),
        2px 2px 0 var(--white), -2px 2px 0 var(--white), 2px -2px 0 var(--white), -2px -2px 0 var(--white);
    transform: rotate(var(--slant));
    transform-origin: left bottom;
}
.slash-title span { position: relative; z-index: 1; }
.slash-title::before,
.slash-title::after {
    content: "";
    position: absolute;
    z-index: 0;
}
.slash-title::before { /* white wedge with a pink edge */
    inset: -6% -10% 2% -4%;
    background: linear-gradient(100deg, var(--white) 78%, var(--pink) 96%);
    clip-path: polygon(0 88%, 100% 0, 92% 100%, 0 100%);
}
.slash-title::after { /* red band */
    inset: 28% -2% 14% 0;
    background: var(--red);
    clip-path: polygon(0 18%, 100% 0, 100% 78%, 0 100%);
}


/* ===== 5. home ===== */
.home-grid {
    display: grid;
    grid-template-columns: minmax(260px, 340px) 1fr 210px;
    gap: 40px;
    align-items: center;
    min-height: calc(100vh - 260px);
}

/* Left column */
.who { position: relative; }

.status-box {
    display: inline-block;
    min-width: 220px;
    margin-bottom: 22px;
    padding: 8px 18px 10px;
    background: var(--white);
    color: var(--ink);
    border: 3px solid var(--ink);
    box-shadow: 6px 6px 0 rgba(4, 8, 31, 0.5);
}
.status-value {
    font-family: var(--display);
    font-weight: 900;
    font-style: italic;
    font-size: 44px;
    line-height: 1;
}
.status-label {
    font-family: var(--display);
    font-weight: 700;
    font-style: italic;
    font-size: 16px;
}

/* Portrait in a slanted frame with an offset cyan backing. */
.portrait {
    position: relative;
    width: 100%;
    max-width: 320px;
    aspect-ratio: 1 / 1.1;
}
.portrait::before { /* offset cyan frame */
    content: "";
    position: absolute;
    inset: 0;
    background: var(--cyan);
    clip-path: polygon(10% 0, 100% 4%, 90% 100%, 0 94%);
    transform: translate(12px, 12px);
}
.portrait img {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: cover;
    clip-path: polygon(10% 0, 100% 4%, 90% 100%, 0 94%);
}

.who-name {
    margin: 26px 0 8px;
    font-family: var(--display);
    font-weight: 900;
    font-style: italic;
    font-size: 46px;
    line-height: 1;
    text-transform: uppercase;
    color: var(--white);
    text-shadow: 4px 4px 0 var(--ink);
}
.who-about {
    margin: 0;
    font-family: var(--display);
    font-weight: 600;
    font-style: italic;
    font-size: 22px;
    line-height: 1.3;
    letter-spacing: 0.01em;
    color: var(--text);
}

/* Centre: the big slanted command menu */
.commands ul {
    margin: 0;
    padding: 0 0 0 20px;
    list-style: none;
    transform: rotate(var(--slant));
}
.commands li { margin: -0.06em 0; }
/* Each item sits a little off from the one above, like a hand-set menu. */
.commands li:nth-child(4n + 1) { margin-left: 40px; --c: var(--cyan); }
.commands li:nth-child(4n + 2) { margin-left: 0;    --c: #e3ebff; }
.commands li:nth-child(4n + 3) { margin-left: 70px; --c: #8fb2ff; }
.commands li:nth-child(4n + 4) { margin-left: 20px; --c: #5a7fe0; }

.commands a {
    position: relative;
    display: inline-block;
    padding: 0 0.18em;
    font-family: var(--display);
    font-weight: 900;
    font-style: italic;
    font-size: clamp(56px, 7.4vw, 108px);
    line-height: 0.9;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    color: var(--c);
    text-shadow: 0 0 24px rgba(4, 8, 31, 0.25);
    transition: transform 0.16s cubic-bezier(.2, .9, .3, 1.4), color 0.1s;
}
.commands a span { position: relative; z-index: 1; }
.commands a::before,
.commands a::after {
    content: "";
    position: absolute;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.1s, transform 0.18s cubic-bezier(.2, .9, .3, 1.3);
}
.commands a::before { /* white wedge, pink tip */
    inset: -14% -22% 4% -8%;
    background: linear-gradient(100deg, var(--white) 76%, var(--pink) 95%);
    clip-path: polygon(0 86%, 100% 0, 90% 100%, 0 100%);
    transform: translateX(-30px);
}
.commands a::after { /* red band */
    inset: 26% -6% 14% 2%;
    background: var(--red);
    clip-path: polygon(0 20%, 100% 0, 100% 76%, 0 100%);
    transform: translateX(30px);
}
.commands a.is-selected {
    color: var(--ink);
    /* solid white outline so the black letters read where they stick out onto the dark page */
    text-shadow:
        3px 0 0 var(--white), -3px 0 0 var(--white), 0 3px 0 var(--white), 0 -3px 0 var(--white),
        2px 2px 0 var(--white), -2px 2px 0 var(--white), 2px -2px 0 var(--white), -2px -2px 0 var(--white);
    transform: scale(1.1) rotate(-6deg) translateX(-10px);
}
.commands a.is-selected::before,
.commands a.is-selected::after { opacity: 1; transform: none; }
.commands a:focus-visible { outline: none; }

/* Right: social links as party-member cards */
.party {
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: flex-end;
}
.party-card {
    position: relative;
    display: grid;
    grid-template-columns: 52px 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 10px;
    width: 190px;
    padding: 10px 16px 10px 12px;
    background: var(--panel);
    border: 2px solid rgba(79, 240, 255, 0.45);
    transform: skewX(-12deg) rotate(-4deg);
    box-shadow: 5px 5px 0 rgba(4, 8, 31, 0.45);
    transition: transform 0.16s, background 0.16s;
}
.party-card:nth-child(even) { margin-right: 18px; }
.party-card > * { transform: skewX(12deg); }
.party-icon {
    grid-row: span 2;
    width: 44px;
    height: 44px;
    color: var(--cyan);
}
.party-icon svg { width: 100%; height: 100%; }
.party-name {
    font-family: var(--display);
    font-weight: 800;
    font-style: italic;
    font-size: 20px;
    line-height: 1;
    text-transform: uppercase;
    color: var(--white);
}
.party-bars { display: grid; gap: 4px; margin-top: 6px; }
.party-bars i { display: block; height: 5px; background: var(--cyan); }
.party-bars i + i { background: var(--yellow); width: 70%; }
.party-card:nth-child(2) .party-bars i + i { width: 90%; }
.party-card:nth-child(3) .party-bars i + i { width: 55%; }
.party-card:hover {
    background: var(--white);
    transform: skewX(-12deg) rotate(-4deg) translateX(-8px);
}
.party-card:hover .party-name { color: var(--ink); }
.party-card:hover .party-icon { color: var(--red); }


/* ===== theme picker (top-right, after the nav) ===== */
.theme-pick { position: relative; }
.nav .menu { margin-left: auto; }  /* keep the menu right-aligned, next to the picker */
.theme-pick summary {
    display: block;
    padding: 2px 14px;
    cursor: pointer;
    list-style: none;
    font-family: var(--display);
    font-weight: 800;
    font-style: italic;
    font-size: 21px;
    text-transform: uppercase;
    color: var(--muted);
    border: 2px solid currentColor;
    transform: skewX(-14deg);
    user-select: none;
}
.theme-pick summary::-webkit-details-marker { display: none; }
.theme-pick summary span { display: inline-block; transform: skewX(14deg); }
.theme-pick summary:hover, .theme-pick[open] summary { color: var(--white); }
.theme-pick ul {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    z-index: 10;
    min-width: 230px;
    margin: 0;
    padding: 10px 12px;
    list-style: none;
    background: var(--panel);
    border: 2px solid var(--cyan);
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.45);
    transform: skewX(-8deg);
    animation: slide-in 0.25s cubic-bezier(.2, .9, .3, 1.2) both;
}
.theme-pick li a {
    position: relative;
    display: block;
    padding: 0 12px;
    font-family: var(--display);
    font-weight: 900;
    font-style: italic;
    font-size: 28px;
    line-height: 1.25;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--cyan);
    transform: skewX(8deg);
}
.theme-pick li a span { position: relative; z-index: 1; }
.theme-pick li a::before {
    content: "";
    position: absolute;
    inset: 4px 0;
    background: var(--red);
    box-shadow: 4px 4px 0 var(--white);
    transform: skewX(-14deg) scaleX(0);
    transform-origin: left;
    transition: transform 0.16s cubic-bezier(.2, .9, .3, 1.3);
}
.theme-pick li a:hover, .theme-pick li a.current { color: var(--ink); }
.theme-pick li a:hover::before, .theme-pick li a.current::before { transform: skewX(-14deg) scaleX(1); }
/* On phones the picker wraps to the start of a new row, so open the list rightwards. */
@media (max-width: 900px) { .theme-pick ul { right: auto; left: 0; } }


/* ===== 6. list pages ===== */
.page-header { margin-bottom: 8px; }

.entries { display: grid; gap: 22px; counter-reset: entry; }

.post-entry {
    position: relative;
    display: block;
    background: var(--panel);
    border-left: 4px solid var(--cyan);
    clip-path: polygon(0 0, 100% 0, calc(100% - 22px) 100%, 0 100%);
    transition: transform 0.16s cubic-bezier(.2, .9, .3, 1.3), background 0.12s;
}
.post-entry::before { /* red slash that slides in when selected */
    content: "";
    position: absolute;
    left: -6px;
    top: 0;
    bottom: 0;
    width: 18px;
    background: var(--red);
    transform: skewX(-12deg) scaleY(0);
    transform-origin: top;
    transition: transform 0.18s;
    z-index: 2;
}
.post-entry:hover,
.post-entry.is-selected {
    background: var(--white);
    transform: translateX(10px);
}
.post-entry:hover::before,
.post-entry.is-selected::before { transform: skewX(-12deg) scaleY(1); }
.post-entry:focus-visible { outline: none; }

.entry-cover { margin: 0; }
.entry-cover img {
    width: 100%;
    max-height: 280px;
    object-fit: cover;
}

.entry-body { position: relative; padding: 20px 56px 20px 28px; }

.entry-num {
    position: absolute;
    right: 34px;
    top: 10px;
    font-family: var(--display);
    font-weight: 900;
    font-style: italic;
    font-size: 54px;
    line-height: 1;
    color: rgba(143, 184, 255, 0.10);
}

.entry-title {
    margin: 0 0 6px;
    padding-right: 40px;
    font-family: var(--display);
    font-weight: 800;
    font-style: italic;
    font-size: 32px;
    line-height: 1.05;
    text-transform: uppercase;
    color: var(--white);
}
.entry-content {
    margin: 0 0 6px;
    font-size: 16px;
    line-height: 1.55;
    color: var(--muted);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}
.entry-footer {
    font-family: var(--display);
    font-weight: 700;
    font-style: italic;
    font-size: 17px;
    letter-spacing: 0.03em;
    color: var(--cyan);
}

.post-entry:hover .entry-title, .post-entry.is-selected .entry-title { color: var(--ink); }
.post-entry:hover .entry-content, .post-entry.is-selected .entry-content { color: #34405e; }
.post-entry:hover .entry-footer, .post-entry.is-selected .entry-footer { color: var(--red); }
.post-entry:hover .entry-num, .post-entry.is-selected .entry-num { color: rgba(255, 30, 60, 0.25); }


/* ===== 7. single page ===== */
.post-header { margin-bottom: 26px; }

.post-title {
    margin: 10px 0 10px;
    font-family: var(--display);
    font-weight: 900;
    font-style: italic;
    font-size: clamp(38px, 6vw, 60px);
    line-height: 1.02;
    color: var(--white);
    text-shadow: 4px 4px 0 var(--ink);
}
.post-description {
    font-family: var(--display);
    font-weight: 700;
    font-style: italic;
    font-size: 22px;
    color: var(--cyan-soft);
}
.post-meta { margin-top: 12px; }
.post-meta span {
    display: inline-block;
    padding: 2px 14px;
    font-family: var(--display);
    font-weight: 800;
    font-style: italic;
    font-size: 17px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink);
    background: var(--yellow);
    transform: skewX(-12deg);
}

.post-single > .entry-cover { margin: 0 0 26px; }
.post-single > .entry-cover img {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 26px), calc(100% - 40px) 100%, 0 100%);
}
.entry-cover figcaption { margin-top: 6px; font-size: 14px; color: var(--muted); }

.panel {
    padding: 34px 40px;
    background: var(--panel);
    border: 1px solid var(--panel-edge);
    border-top: 3px solid var(--cyan);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    clip-path: polygon(0 0, calc(100% - 30px) 0, 100% 30px, 100% 100%, 0 100%);
}

.toc {
    margin-bottom: 28px;
    padding: 12px 18px;
    border: 1px solid var(--panel-edge);
    background: rgba(255, 255, 255, 0.025);
}
.toc summary {
    cursor: pointer;
    font-family: var(--display);
    font-weight: 800;
    font-style: italic;
    font-size: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--cyan);
}
.toc ul { margin: 6px 0; padding-left: 20px; list-style: none; }
.toc li { margin: 2px 0; }
.toc a { color: var(--text); }
.toc a:hover { color: var(--cyan); }
.toc .inner > ul { padding-left: 4px; }

/* Article text */
.post-content { overflow-wrap: break-word; }
.post-content > :first-child { margin-top: 0; }
.post-content p, .post-content ul, .post-content ol, .post-content blockquote,
.post-content table, .post-content pre, .post-content figure { margin: 0 0 1.2em; }
.post-content li { margin: 0.3em 0; }
.post-content li::marker { color: var(--cyan); }
.post-content strong { color: var(--white); }

.post-content h1, .post-content h2, .post-content h3,
.post-content h4, .post-content h5, .post-content h6 {
    position: relative;
    margin: 1.6em 0 0.6em;
    padding-left: 26px;
    font-family: var(--display);
    font-weight: 800;
    font-style: italic;
    line-height: 1.1;
    text-transform: uppercase;
    color: var(--white);
}
.post-content h1::before, .post-content h2::before, .post-content h3::before,
.post-content h4::before, .post-content h5::before, .post-content h6::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.1em;
    bottom: 0.1em;
    width: 10px;
    background: var(--red);
    transform: skewX(-16deg);
}
.post-content h1 { font-size: 38px; }
.post-content h2 { font-size: 32px; }
.post-content h3 { font-size: 26px; }
.post-content h4, .post-content h5, .post-content h6 { font-size: 21px; }

.anchor { margin-left: 8px; color: var(--muted); text-decoration: none; }
.post-content :is(h1, h2, h3, h4, h5, h6):hover .anchor { display: inline !important; }

.post-content a {
    color: var(--cyan);
    box-shadow: inset 0 -2px 0 var(--cyan);
    transition: background 0.12s, color 0.12s;
}
.post-content a:hover { background: var(--cyan); color: var(--ink); }
.post-content a.anchor { box-shadow: none; }

.post-content img { margin: 1em auto; border: 3px solid var(--white); }

.post-content blockquote {
    padding: 4px 0 4px 20px;
    border-left: 5px solid var(--red);
    color: var(--muted);
    font-style: italic;
}

.post-content hr {
    height: 4px;
    margin: 2em 0;
    border: 0;
    background: linear-gradient(90deg, var(--cyan), transparent);
}

.post-content table { width: 100%; border-collapse: collapse; font-size: 16px; }
.post-content th, .post-content td { padding: 8px 12px; border-bottom: 1px solid var(--panel-edge); text-align: left; }
.post-content th {
    font-family: var(--display);
    font-style: italic;
    text-transform: uppercase;
    color: var(--cyan);
}

.post-content code {
    padding: 2px 6px;
    font-family: var(--mono);
    font-size: 0.85em;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
.post-content pre {
    padding: 16px 20px;
    overflow-x: auto;
    background: #05070d;
    border-left: 4px solid var(--cyan);
    line-height: 1.5;
}
.post-content pre code { padding: 0; background: none; font-size: 14.5px; color: #d6deef; }
.post-content .highlight { margin: 0 0 1.2em; }
.post-content .highlight pre { margin: 0; }

/* Footer: tags + prev/next */
.post-footer { margin-top: 28px; display: grid; gap: 24px; }

.post-tags { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.post-tags li {
    padding: 0 14px;
    font-family: var(--display);
    font-weight: 700;
    font-style: italic;
    font-size: 17px;
    line-height: 32px;
    text-transform: uppercase;
    color: var(--text);
    border: 1px solid var(--panel-edge);
    transform: skewX(-12deg);
}

.paginav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.paginav a {
    display: block;
    padding: 12px 20px;
    background: var(--panel);
    border: 2px solid var(--cyan);
    transform: skewX(-8deg);
    transition: background 0.12s, transform 0.16s;
}
.paginav .next { grid-column: 2; text-align: right; }
.paginav .title {
    display: block;
    font-family: var(--display);
    font-weight: 800;
    font-style: italic;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--yellow);
}
.paginav .name { display: block; font-weight: 600; color: var(--white); }
.paginav a:hover, .paginav a.is-selected { background: var(--white); transform: skewX(-8deg) translateY(-3px); }
.paginav a:hover .name, .paginav a.is-selected .name { color: var(--ink); }
.paginav a:hover .title, .paginav a.is-selected .title { color: var(--red); }


/* ===== 8. hint bar, footer, 404, back-to-top ===== */
/* Off the home page, the hint bar only shows when the screen is wide enough
   for it to sit beside the content column instead of on top of it. */
body:not(.home) .hint-bar { display: none; }
@media (min-width: 1560px) { body:not(.home) .hint-bar { display: block; } }

.hint-bar {
    position: fixed;
    right: 40px;
    bottom: 26px;
    z-index: 3;
    text-align: right;
    pointer-events: none;
}
.hint-text {
    font-family: var(--display);
    font-weight: 800;
    font-style: italic;
    font-size: 34px;
    line-height: 1;
    color: var(--white);
    text-shadow: 3px 3px 0 var(--ink);
    max-width: 46vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hint-label {
    position: relative;
    margin: 2px -40px 8px 0;
    padding-right: 40px;
    font-family: var(--display);
    font-weight: 700;
    font-style: italic;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--white);
    border-bottom: 2px solid var(--white);
}
.hint-keys {
    display: flex;
    justify-content: flex-end;
    gap: 18px;
    font-family: var(--display);
    font-weight: 800;
    font-style: italic;
    font-size: 20px;
    color: var(--white);
}
.hint-keys kbd {
    display: inline-grid;
    place-items: center;
    min-width: 26px;
    height: 26px;
    margin-right: 5px;
    padding: 0 6px;
    font-family: var(--display);
    font-size: 14px;
    font-style: normal;
    color: var(--ink);
    background: var(--white);
    border-radius: 13px;
}

.footer {
    position: relative;
    z-index: 3;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 0 40px 24px;
    font-size: 13px;
    color: var(--muted);
}

.not-found { padding-top: 6vh; }
.not-found-code { font-size: clamp(110px, 20vw, 200px); margin-bottom: 40px; }
.not-found p {
    margin: 0 0 10px;
    font-family: var(--display);
    font-weight: 700;
    font-style: italic;
    font-size: 28px;
    color: var(--white);
}
.not-found a { color: var(--cyan); box-shadow: inset 0 -3px 0 var(--cyan); }
.not-found a:hover, .not-found a.is-selected { color: var(--ink); background: var(--cyan); }

.top-link {
    position: fixed;
    right: 40px;
    bottom: 140px;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: var(--ink);
    background: var(--cyan);
    transform: skewX(-12deg);
    box-shadow: 4px 4px 0 var(--ink);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}
.top-link svg { width: 14px; transform: skewX(12deg); }
.top-link.visible { opacity: 1; visibility: visible; }


/* ===== 9. code colours (Pygments / Chroma token classes) ===== */
.chroma .k, .chroma .kd, .chroma .kn, .chroma .kp, .chroma .kr, .chroma .kt, .chroma .kc { color: #ff7ac8; }
.chroma .s, .chroma .s1, .chroma .s2, .chroma .sb, .chroma .sc, .chroma .sd, .chroma .se,
.chroma .sh, .chroma .si, .chroma .sx, .chroma .sr, .chroma .ss, .chroma .sa { color: #ffe34d; }
.chroma .c, .chroma .c1, .chroma .cm, .chroma .cs, .chroma .ch, .chroma .cpf { color: #7d97d9; font-style: italic; }
.chroma .cp { color: #ff9f6b; }
.chroma .nf, .chroma .fm, .chroma .nc, .chroma .nn { color: #4ff0ff; }
.chroma .nb, .chroma .bp { color: #9ff7ff; }
.chroma .m, .chroma .mi, .chroma .mf, .chroma .mh, .chroma .mo, .chroma .il { color: #ffb86b; }
.chroma .o, .chroma .ow { color: #ffffff; }
.chroma .nd, .chroma .na { color: #b9a6ff; }


/* ===== 10. small screens ===== */
@media (max-width: 1100px) {
    .home-grid { grid-template-columns: minmax(240px, 300px) 1fr; }
    .party { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center; }
    .party-card:nth-child(even) { margin-right: 0; }
}

@media (max-width: 900px) {
    .side-word, .hint-bar { display: none !important; }
    .nav { padding: 18px 16px 0; }
    .main { padding: 24px 16px 80px; }
    .footer { padding: 0 16px 20px; }
    .top-link { right: 16px; bottom: 20px; }

    .home-grid { grid-template-columns: 1fr; gap: 32px; min-height: 0; }
    .who { display: grid; grid-template-columns: 140px 1fr; gap: 0 20px; align-items: center; }
    .status-box { grid-column: 1 / -1; justify-self: start; }
    .portrait { max-width: 140px; }
    .who-name { margin: 0; font-size: 36px; }
    .who-about { grid-column: 1 / -1; margin-top: 18px; }
    .commands a { font-size: clamp(48px, 14vw, 80px); }
    .commands ul { padding-left: 28px; }
    .commands a.is-selected { transform: scale(1.04) rotate(-4deg); }
    .party-card { width: 160px; }

    .panel { padding: 24px 18px; }
    .entry-body { padding: 16px 40px 16px 20px; }
    .entry-title { font-size: 26px; }
    .entry-num { font-size: 40px; right: 26px; }
}

@media (max-width: 520px) {
    .logo { font-size: 24px; }
    .menu a { font-size: 18px; padding: 2px 9px; }
    .commands ul { padding-left: 0; }
    .commands li:nth-child(n) { margin-left: 0; }
    .commands li:nth-child(even) { margin-left: 24px; }
    .paginav { grid-template-columns: 1fr; }
    .paginav .next { grid-column: 1; }
}


/* ===== 11. motion ===== */
/* Menu items and cards slide in when a page opens. */
.commands li, .post-entry, .party-card {
    animation: slide-in 0.45s cubic-bezier(.2, .9, .3, 1.2) both;
    animation-delay: calc(var(--i, 0) * 60ms + 80ms);
}
.post-entry:nth-child(n + 8) { animation-delay: 500ms; }
@keyframes slide-in {
    from { opacity: 0; translate: 80px 0; }
    to { opacity: 1; translate: 0 0; }
}
.slash-title, .post-title { animation: slam 0.4s cubic-bezier(.2, .9, .3, 1.4) both; }
@keyframes slam {
    from { opacity: 0; scale: 1.25; }
    to { opacity: 1; scale: 1; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}
