:root {
    --heading-font: "Cormorant Garamond", Georgia, serif;
    --body-font: "IBM Plex Mono", "Courier New", monospace;
    --black: #030302;
    --ink: #eee4d3;
    --ink-dim: #a79b89;
    --paper: #17100f;
    --paper-2: #1d1210;
    --cover: #100607;
    --blood: #9e1b23;
    --blood-dark: #4b090d;
    --verdigris: #718066;
    --page-pad: clamp(34px, 5vw, 64px);
    --book-pad: clamp(16px, 2vw, 28px);
    --gutter: clamp(24px, 3vw, 36px);
}

@font-face {
    font-family: "Cormorant Garamond";
    src: url("assets/fonts/CormorantGaramond-Regular.ttf") format("truetype");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "IBM Plex Mono";
    src: url("assets/fonts/IBMPlexMono-Regular.ttf") format("truetype");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--black);
    color-scheme: dark;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background: var(--black);
    font-family: var(--body-font);
    font-size: 17px;
    font-weight: 400;
    line-height: 1.36;
}

.candle-cluster {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    width: min(1200px, calc(100% - 32px));
    height: 58px;
    margin: 18px auto 8px;
}

.candle-trigger {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 7px;
    height: 58px;
    padding: 18px 14px 8px;
    isolation: isolate;
}

.candle {
    position: relative;
    display: block;
    width: 15px;
    height: 33px;
    border: 1px solid rgba(238, 228, 211, 0.2);
    border-radius: 3px 3px 2px 2px;
    background:
        linear-gradient(90deg, rgba(0, 0, 0, 0.24), transparent 36%, rgba(238, 228, 211, 0.1) 52%, rgba(0, 0, 0, 0.34)),
        #d8c5a6;
    box-shadow:
        inset 0 -8px 12px rgba(75, 9, 13, 0.18),
        0 0 18px rgba(158, 27, 35, 0.16);
}

.candle:nth-child(1) {
    height: 26px;
}

.candle:nth-child(2) {
    height: 40px;
}

.candle:nth-child(3) {
    height: 30px;
}

.candle::before {
    position: absolute;
    left: 50%;
    top: -18px;
    width: 11px;
    height: 17px;
    content: "";
    border-radius: 76% 24% 58% 42% / 76% 26% 74% 38%;
    background:
        radial-gradient(circle at 50% 76%, rgba(255, 235, 169, 0.98) 0 16%, transparent 38%),
        linear-gradient(180deg, rgba(255, 244, 191, 0.95), rgba(214, 66, 74, 0.9) 56%, rgba(75, 9, 13, 0.16));
    filter:
        drop-shadow(0 0 6px rgba(214, 66, 74, 0.72))
        drop-shadow(0 0 18px rgba(158, 27, 35, 0.36));
    transform: translateX(-50%);
    transform-origin: 50% 88%;
    animation: candle-flame 900ms ease-in-out infinite alternate;
}

.candle::after {
    position: absolute;
    top: 3px;
    left: 50%;
    width: 4px;
    height: 2px;
    content: "";
    border-radius: 50%;
    background: rgba(75, 9, 13, 0.52);
    transform: translateX(-50%);
}

.candle:nth-child(2)::before {
    animation-delay: -320ms;
}

.candle:nth-child(3)::before {
    animation-delay: -620ms;
}

.candle-trigger.is-puffing .candle::before {
    animation: candle-vanish-return 1320ms ease-in-out both;
}

body::before {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    content: "";
    background-image: radial-gradient(rgba(238, 228, 211, 0.24) 0.6px, transparent 0.6px);
    background-size: 5px 7px;
    opacity: 0.08;
}

body::after {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    content: "";
    background: radial-gradient(ellipse at center, transparent 38%, rgba(0, 0, 0, 0.7));
}

.flame-cursor-root,
.flame-cursor-root * {
    cursor: none;
}

.poster-book {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    width: min(1200px, calc(100% - 32px));
    min-height: min(760px, calc(100vh - 32px));
    margin: 0 auto;
    padding: var(--book-pad);
    border: 1px solid #4b241d;
    border-radius: 3px 14px 14px 3px;
    background: var(--cover);
    box-shadow:
        inset 0 0 0 4px rgba(0, 0, 0, 0.72),
        inset 0 0 0 5px rgba(238, 228, 211, 0.12),
        0 0 0 7px #000,
        0 24px 70px rgba(0, 0, 0, 0.78);
}

.poster-book::before {
    position: absolute;
    inset: var(--book-pad) auto var(--book-pad) 50%;
    z-index: 2;
    width: var(--gutter);
    content: "";
    pointer-events: none;
    background:
        linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.58) 34%, rgba(0, 0, 0, 0.96) 50%, rgba(0, 0, 0, 0.58) 66%, transparent);
    transform: translateX(-50%);
}

.poster-book::after {
    position: absolute;
    inset: 10px;
    z-index: 0;
    content: "";
    pointer-events: none;
    border: 1px solid rgba(238, 228, 211, 0.1);
    border-radius: 2px 10px 10px 2px;
}

.page {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: var(--page-pad);
    overflow: hidden;
    border: 1px solid rgba(238, 228, 211, 0.46);
    background: var(--paper);
    box-shadow:
        inset 0 0 38px rgba(0, 0, 0, 0.62),
        inset 0 0 0 1px rgba(158, 27, 35, 0.22);
}

.page::before {
    position: absolute;
    inset: 18px;
    content: "";
    pointer-events: none;
    border: 1px solid rgba(238, 228, 211, 0.22);
}

.page-left {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 28px;
    border-radius: 10px 2px 2px 10px;
    background:
        linear-gradient(90deg, rgba(158, 27, 35, 0.36) 0 4px, transparent 4px),
        linear-gradient(270deg, rgba(0, 0, 0, 0.48), transparent 18%),
        var(--paper);
}

.page-right {
    border-radius: 2px 10px 10px 2px;
    background:
        linear-gradient(90deg, rgba(0, 0, 0, 0.52), transparent 18%),
        var(--paper-2);
}

.masthead {
    position: relative;
    z-index: 1;
    align-self: center;
    margin: 0;
}

.glyph {
    position: relative;
    display: block;
    width: 180px;
    max-width: 68%;
    margin: 0 0 24px;
    filter: drop-shadow(0 0 12px rgba(158, 27, 35, 0.4));
    isolation: isolate;
}

.glyph img {
    display: block;
    width: 100%;
    height: auto;
}

h1,
h2,
p,
ul,
figure {
    margin-top: 0;
}

h1 {
    margin-bottom: 0;
}

.brand-name {
    position: relative;
    display: block;
    color: var(--ink);
    font-family: var(--heading-font);
    font-size: clamp(52px, 6vw, 76px);
    font-weight: 400;
    line-height: 0.94;
    text-decoration: none;
    text-transform: uppercase;
    text-shadow: 2px 2px 0 var(--blood-dark);
    isolation: isolate;
}

.brand-name span {
    display: block;
}

.vanish-trigger {
    appearance: none;
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    outline: 1px solid transparent;
    outline-offset: 10px;
    text-align: inherit;
    transition:
        box-shadow 160ms ease,
        outline-color 160ms ease;
}

.vanish-trigger:hover,
.vanish-trigger:focus-visible {
    color: inherit;
    background: transparent;
}

.vanish-trigger:hover {
    box-shadow: 0 0 22px rgba(158, 27, 35, 0.16);
}

.vanish-trigger:focus-visible {
    outline-offset: 8px;
    box-shadow: 0 0 28px rgba(158, 27, 35, 0.2);
}

.vanish-trigger::before,
.vanish-trigger::after {
    position: absolute;
    inset: 8%;
    z-index: -1;
    content: "";
    pointer-events: none;
    border-radius: 50%;
    opacity: 0;
    transform: scale(0.38);
}

.vanish-trigger::before {
    background:
        radial-gradient(circle at 26% 42%, rgba(238, 228, 211, 0.76) 0 4px, transparent 5px),
        radial-gradient(circle at 66% 30%, rgba(158, 27, 35, 0.7) 0 5px, transparent 6px),
        radial-gradient(circle at 48% 68%, rgba(238, 228, 211, 0.42) 0 7px, transparent 8px),
        radial-gradient(circle, rgba(158, 27, 35, 0.3), transparent 68%);
    filter: blur(0.4px);
}

.vanish-trigger::after {
    border: 1px solid rgba(238, 228, 211, 0.24);
    box-shadow: 0 0 24px rgba(158, 27, 35, 0.34);
}

.vanish-trigger.is-puffing::before {
    animation: puff-cloud 1200ms ease-out both;
}

.vanish-trigger.is-puffing::after {
    animation: puff-ring 780ms ease-out both;
}

.glyph.is-puffing img,
.brand-name.is-puffing span {
    animation: vanish-return 1320ms ease-in-out both;
}

.studio-line {
    max-width: 28ch;
    margin: 22px 0 0;
    color: var(--ink-dim);
    font-size: 15px;
}

.rat-figure {
    position: relative;
    z-index: 1;
    align-self: end;
    max-width: 100%;
    margin: 0;
    padding-top: 18px;
    color: var(--verdigris);
}

.rat-figure pre {
    margin: 0;
    overflow: hidden;
    font-family: var(--body-font);
    font-size: 12px;
    line-height: 1.05;
    white-space: pre;
}

.poster-grid {
    position: relative;
    z-index: 1;
    display: grid;
    align-content: center;
    gap: 32px;
    min-height: 100%;
}

.module {
    position: relative;
    min-width: 0;
    padding-bottom: 38px;
}

.module:last-child {
    padding-bottom: 0;
}

.module:not(:last-child)::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 16px;
    content: "";
    pointer-events: none;
    background:
        linear-gradient(90deg, transparent 0%, rgba(158, 27, 35, 0.2) 18%, rgba(238, 228, 211, 0.24) 50%, rgba(158, 27, 35, 0.2) 82%, transparent 100%) center / 100% 1px no-repeat,
        linear-gradient(90deg, transparent 12%, rgba(158, 27, 35, 0.1) 50%, transparent 88%) center / 100% 9px no-repeat;
    background-repeat: no-repeat;
    opacity: 0.86;
}

h2 {
    margin-bottom: 14px;
    color: var(--ink);
    font-family: var(--heading-font);
    font-size: 44px;
    font-weight: 400;
    line-height: 1.08;
}

p,
ul {
    margin-bottom: 13px;
}

ul {
    padding-left: 20px;
}

li {
    margin-bottom: 7px;
}

li::marker {
    color: var(--blood);
}

.link-list {
    display: grid;
    gap: 0;
    padding-left: 0;
    list-style: none;
}

.link-list li {
    display: grid;
    grid-template-columns: minmax(148px, 0.48fr) 1fr;
    gap: 14px;
    margin-bottom: 0;
    padding: 10px 0;
    border-top: 1px solid rgba(238, 228, 211, 0.16);
}

.link-list li:last-child {
    border-bottom: 1px solid rgba(238, 228, 211, 0.16);
}

.link-list span {
    color: var(--ink-dim);
    text-transform: uppercase;
    white-space: nowrap;
}

a {
    color: #d6424a;
    font-weight: 400;
    text-decoration-color: rgba(214, 66, 74, 0.56);
    text-decoration-line: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

a:hover,
a:focus-visible {
    color: var(--ink);
    background: var(--blood-dark);
    text-decoration-color: transparent;
}

a:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 3px;
}

::selection {
    color: var(--black);
    background: var(--blood);
}

.flame-cursor,
.cursor-light {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 2147483646;
    pointer-events: none;
    opacity: 0;
    transform: translate(-200px, -200px);
    transition: opacity 160ms ease;
}

.flame-cursor {
    width: 30px;
    height: 42px;
    margin: -34px 0 0 -15px;
    mix-blend-mode: screen;
}

.flame-cursor::before,
.flame-cursor::after {
    position: absolute;
    content: "";
    transform-origin: 50% 82%;
}

.flame-cursor::before {
    inset: 0 4px 3px;
    background:
        radial-gradient(circle at 50% 73%, rgba(255, 213, 116, 0.98) 0 13%, transparent 36%),
        linear-gradient(180deg, rgba(255, 238, 183, 0.96), rgba(214, 66, 74, 0.92) 52%, rgba(75, 9, 13, 0.18));
    border-radius: 78% 22% 62% 38% / 72% 28% 72% 38%;
    clip-path: polygon(50% 0, 76% 34%, 95% 66%, 68% 100%, 32% 100%, 5% 66%, 28% 34%);
    filter:
        drop-shadow(0 0 8px rgba(214, 66, 74, 0.75))
        drop-shadow(0 0 18px rgba(158, 27, 35, 0.46));
    animation: flame-waver 760ms ease-in-out infinite alternate;
}

.flame-cursor::after {
    inset: 13px 10px 6px;
    background: linear-gradient(180deg, rgba(255, 244, 191, 0.96), rgba(214, 66, 74, 0.66));
    border-radius: 64% 36% 58% 42% / 76% 30% 70% 38%;
    clip-path: polygon(50% 0, 76% 42%, 88% 72%, 63% 100%, 35% 100%, 13% 72%, 30% 40%);
    animation: flame-waver 520ms ease-in-out infinite alternate-reverse;
}

.cursor-light {
    z-index: 2;
    width: 220px;
    height: 220px;
    margin: -110px 0 0 -110px;
    background:
        radial-gradient(circle, rgba(255, 238, 183, 0.13) 0%, rgba(238, 228, 211, 0.11) 9%, rgba(214, 66, 74, 0.14) 24%, rgba(158, 27, 35, 0.09) 43%, rgba(75, 9, 13, 0.04) 58%, transparent 78%);
    border-radius: 50%;
    mix-blend-mode: screen;
}

.flame-cursor.is-visible,
.cursor-light.is-visible {
    opacity: 1;
}

.flame-cursor.is-pressed::before {
    filter:
        drop-shadow(0 0 13px rgba(214, 66, 74, 0.94))
        drop-shadow(0 0 28px rgba(158, 27, 35, 0.68));
}

@keyframes vanish-return {
    0% {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0) scale(1);
    }

    14% {
        opacity: 0;
        filter: blur(10px);
        transform: translateY(-7px) scale(0.94);
    }

    58% {
        opacity: 0;
        filter: blur(7px);
        transform: translateY(6px) scale(0.96);
    }

    100% {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0) scale(1);
    }
}

@keyframes puff-cloud {
    0% {
        opacity: 0;
        transform: scale(0.35) rotate(0deg);
    }

    15% {
        opacity: 0.88;
    }

    100% {
        opacity: 0;
        transform: scale(1.52) rotate(-8deg);
    }
}

@keyframes puff-ring {
    0% {
        opacity: 0;
        transform: scale(0.46);
    }

    22% {
        opacity: 0.78;
    }

    100% {
        opacity: 0;
        transform: scale(1.38);
    }
}

@keyframes flame-waver {
    0% {
        transform: rotate(-5deg) scaleX(0.92) scaleY(1.02);
    }

    100% {
        transform: rotate(5deg) scaleX(1.08) scaleY(0.94);
    }
}

@keyframes candle-vanish-return {
    0% {
        opacity: 1;
        filter: blur(0) drop-shadow(0 0 6px rgba(214, 66, 74, 0.72)) drop-shadow(0 0 18px rgba(158, 27, 35, 0.36));
        transform: translateX(-50%) translateY(0) scale(1);
    }

    14% {
        opacity: 0;
        filter: blur(10px);
        transform: translateX(-50%) translateY(-7px) scale(0.94);
    }

    58% {
        opacity: 0;
        filter: blur(7px);
        transform: translateX(-50%) translateY(6px) scale(0.96);
    }

    100% {
        opacity: 1;
        filter: blur(0) drop-shadow(0 0 6px rgba(214, 66, 74, 0.72)) drop-shadow(0 0 18px rgba(158, 27, 35, 0.36));
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

@keyframes candle-flame {
    0% {
        transform: translateX(-50%) rotate(-4deg) scaleX(0.92) scaleY(1.02);
    }

    100% {
        transform: translateX(-50%) rotate(5deg) scaleX(1.08) scaleY(0.95);
    }
}

@media (max-width: 1120px) {
    .brand-name {
        font-size: clamp(52px, 6.5vw, 72px);
    }

    h2 {
        font-size: 38px;
    }
}

@media (max-width: 900px) {
    .poster-book {
        grid-template-columns: 1fr;
        width: min(720px, calc(100% - 22px));
        min-height: 0;
        gap: 18px;
    }

    .poster-book::before {
        display: none;
    }

    .page-left,
    .page-right {
        border-radius: 8px;
    }

    .masthead {
        margin: 0;
    }

    .poster-grid {
        align-content: start;
        min-height: 0;
    }
}

@media (max-width: 680px) {
    body {
        font-size: 16px;
    }

    .poster-book {
        padding: 12px;
    }

    .candle-cluster {
        height: 46px;
        margin-top: 12px;
    }

    .page {
        padding: 34px 24px;
    }

    .page::before {
        inset: 12px;
    }

    .glyph {
        width: 142px;
    }

    .brand-name {
        font-size: 58px;
    }

    h2 {
        font-size: 34px;
    }

    .link-list li {
        grid-template-columns: 1fr;
        gap: 3px;
    }
}

@media (pointer: coarse) {
    .flame-cursor-root,
    .flame-cursor-root * {
        cursor: auto;
    }

    .flame-cursor,
    .cursor-light {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .candle::before,
    .glyph.is-puffing img,
    .brand-name.is-puffing span,
    .vanish-trigger.is-puffing::before,
    .vanish-trigger.is-puffing::after {
        animation: none;
    }
}

@media (max-width: 380px) {
    .page {
        padding: 30px 20px;
    }

    .brand-name {
        font-size: 50px;
    }

    .rat-figure pre {
        font-size: 11px;
    }
}
