
/* =========================================
   A FUNERAL FOR AN UNWRITTEN FUTURE

   Visual direction:
   Cinematic · Literary · Melancholic
   Vintage editorial · Analog film
========================================= */


/* =========================================
   01. ROOT VARIABLES
========================================= */

:root {

    --navy: #343f50;
    --navy-dark: #293341;
    --navy-light: #465365;

    --ivory: #e9dcc5;
    --paper: #eee8dc;
    --paper-dark: #e4dccd;

    --ink: #302e2b;
    --ink-muted: #81796d;

    --line: rgba(48, 46, 43, 0.18);

    --font-script: "Great Vibes", cursive;
    --font-serif: "Cormorant Garamond", Georgia, serif;
    --font-sans: "Inter", sans-serif;

    --ease: cubic-bezier(0.22, 1, 0.36, 1);

    --grain-opacity: 0.28;

}


/* =========================================
   02. RESET
========================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background: var(--navy);
    color: var(--ivory);
    font-family: var(--font-serif);
    overflow-x: hidden;
}

button {
    font: inherit;
    color: inherit;
    cursor: pointer;
    background: none;
    border: none;
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible {
    outline: 1px solid currentColor;
    outline-offset: 6px;
}

img {
    display: block;
    width: 100%;
}

[hidden] {
    display: none !important;
}

::selection {
    background: var(--navy);
    color: var(--ivory);
}


/* =========================================
   03. GRAIN TEXTURE
========================================= */

.grain-overlay {

    position: fixed;
    inset: 0;

    z-index: 100;

    pointer-events: none;

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 180 180'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23grain)'/%3E%3C/svg%3E");

    background-size: 180px 180px;

    opacity: var(--grain-opacity);

    mix-blend-mode: soft-light;

}

body[data-page="contents"] .grain-overlay,
body[data-page="reader"] .grain-overlay {

    opacity: 0.19;

    mix-blend-mode: multiply;

}


/* =========================================
   04. GENERAL PAGE SYSTEM
========================================= */

#app {
    width: 100%;
    min-height: 100vh;
}

.page {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    width: 100%;
}

.page.is-active {
    animation: page-reveal 1.1s var(--ease) both;
}

@keyframes page-reveal {

    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }

}

body[data-page="landing"],
body[data-page="ending"] {

    background: var(--navy);
    color: var(--ivory);

}

body[data-page="contents"],
body[data-page="reader"] {

    background: var(--paper);
    color: var(--ink);

}


/* =========================================
   05. LANDING PAGE
========================================= */

.landing-page {

    display: flex;

    align-items: center;
    justify-content: center;

    min-height: 100svh;

    padding: 55px 30px;

    isolation: isolate;

    overflow: hidden;

    background:

        radial-gradient(
            ellipse at 50% 32%,
            var(--navy-light) 0%,
            var(--navy) 55%,
            var(--navy-dark) 100%
        );

}


/* Vintage book-cover border */

.landing-frame {

    position: absolute;

    inset: 10px;

    border: 1px solid rgba(233, 220, 197, 0.85);

    pointer-events: none;

    z-index: 2;

}

.landing-content {

    position: relative;

    width: min(100%, 850px);

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    z-index: 3;

}


/* =========================================
   06. LANDING TYPOGRAPHY
========================================= */

.landing-title {

    width: 100%;

    position: relative;

    font-family: var(--font-script);
    font-weight: 400;

    color: var(--ivory);

    line-height: 0.85;

    user-select: none;

    padding: 20px 15px 35px;

}

.title-line {

    display: block;

    width: max-content;

    max-width: 100%;

    font-weight: 400;

    opacity: 0;

    animation: title-reveal 1.5s var(--ease) forwards;

}


/* A */

.title-a {

    font-size: clamp(38px, 5vw, 68px);

    margin-left: 19%;

    animation-delay: 0.1s;

}


/* Funeral */

.title-funeral {

    font-size: clamp(95px, min(16vw, 22vh), 205px);

    margin-left: 6%;

    margin-top: -2%;

    animation-delay: 0.23s;

}


/* for an */

.title-for-an {

    font-size: clamp(38px, 5.6vw, 73px);

    margin-left: 57%;

    margin-top: 2%;

    animation-delay: 0.36s;

}


/* Unwritten */

.title-unwritten {

    font-size: clamp(76px, min(13vw, 19vh), 170px);

    margin-left: 5%;

    margin-top: 0;

    animation-delay: 0.49s;

}


/* Future */

.title-future {

    font-size: clamp(100px, min(17vw, 23vh), 215px);

    margin-left: 25%;

    margin-top: 1%;

    animation-delay: 0.62s;

}


@keyframes title-reveal {

    from {

        opacity: 0;

        transform: translateY(14px);

        filter: blur(5px);

    }

    to {

        opacity: 1;

        transform: translateY(0);

        filter: blur(0);

    }

}


/* =========================================
   07. ENTER BUTTON
========================================= */

.enter-button {

    position: relative;

    display: inline-flex;

    justify-content: center;
    align-items: center;

    min-width: 225px;

    padding: 14px 35px;

    border: 1px solid var(--ivory);

    border-radius: 100px;

    font-family: var(--font-serif);

    font-size: 15px;

    font-weight: 500;

    text-transform: uppercase;

    letter-spacing: 0.4em;

    text-indent: 0.4em;

    color: var(--ivory);

    background: transparent;

    transition:
        background 0.5s var(--ease),
        color 0.5s var(--ease),
        box-shadow 0.5s var(--ease);

}

.landing-page .enter-button {

    margin-top: 25px;

    opacity: 0;

    animation: button-reveal 1.2s var(--ease) 1s forwards;

}

.enter-button:hover {

    color: var(--navy);

    background: var(--ivory);

    box-shadow: 0 0 25px rgba(233, 220, 197, 0.1);

}

.enter-button:active {

    transform: scale(0.98);

}

@keyframes button-reveal {

    from {

        opacity: 0;

        transform: translateY(8px);

    }

    to {

        opacity: 1;

        transform: translateY(0);

    }

}


/* =========================================
   08. TABLE OF CONTENTS
========================================= */

.contents-page {

    background: var(--paper);

    color: var(--ink);

    padding: 45px 7%;

}

.contents-container {

    max-width: 1050px;

    margin: 0 auto;

}

.contents-header {

    display: flex;

    justify-content: space-between;
    align-items: center;

    padding-bottom: 25px;

    border-bottom: 1px solid var(--line);

}

.text-button {

    font-family: var(--font-sans);

    font-size: 10px;

    font-weight: 400;

    letter-spacing: 0.16em;

    text-transform: uppercase;

    position: relative;

    padding: 5px 0;

    transition: opacity 0.3s ease;

}

.text-button::after {

    content: "";

    position: absolute;

    bottom: 0;
    left: 0;

    width: 0;

    height: 1px;

    background: currentColor;

    transition: width 0.4s var(--ease);

}

.text-button:hover::after {

    width: 100%;

}

.edition-label {

    font-family: var(--font-serif);

    font-size: 15px;

    font-style: italic;

    color: var(--ink-muted);

}


/* Contents introduction */

.contents-heading {

    padding: 65px 0 55px;

}

.section-label {

    display: block;

    font-family: var(--font-sans);

    font-size: 10px;

    letter-spacing: 0.24em;

    text-transform: uppercase;

    color: var(--ink-muted);

    margin-bottom: 22px;

}

.contents-heading h2 {

    font-size: clamp(43px, 7vw, 85px);

    font-family: var(--font-serif);

    font-weight: 400;

    line-height: 0.97;

    letter-spacing: -0.04em;

}

.contents-heading p {

    max-width: 470px;

    margin-top: 25px;

    font-size: 21px;

    line-height: 1.4;

    font-style: italic;

    color: var(--ink-muted);

}


/* =========================================
   09. CHAPTER LIST
========================================= */

.chapter-list {

    border-top: 1px solid var(--line);

}

.chapter-item {

    display: grid;

    grid-template-columns: 65px minmax(0, 1fr) 255px;

    align-items: center;

    gap: 15px;

    width: 100%;

    text-align: left;

    padding: 24px 12px;

    border-bottom: 1px solid var(--line);

    position: relative;

    transition:
        background 0.4s ease,
        padding 0.4s var(--ease);

}

.chapter-item:hover {

    background: rgba(52, 63, 80, 0.045);

    padding-left: 22px;

}

.chapter-number {

    font-family: var(--font-serif);

    font-size: 20px;

    font-style: italic;

    color: var(--ink-muted);

}

.chapter-name {

    font-family: var(--font-serif);

    font-size: clamp(23px, 3vw, 36px);

    line-height: 1.05;

    font-weight: 500;

    letter-spacing: -0.025em;

}

.chapter-film {

    font-family: var(--font-serif);

    font-size: 16px;

    font-style: italic;

    text-align: right;

    color: var(--ink-muted);

}

.chapter-item.is-current .chapter-name {

    font-style: italic;

}

.contents-footer {

    display: flex;

    justify-content: space-between;

    gap: 20px;

    padding: 28px 0 15px;

    font-family: var(--font-sans);

    font-size: 9px;

    letter-spacing: 0.1em;

    color: var(--ink-muted);

}


/* =========================================
   10. CHAPTER READER
========================================= */

.reader-page {

    background: var(--paper);

    color: var(--ink);

    padding: 28px 6% 50px;

}

.reader-container {

    width: 100%;

    max-width: 1050px;

    margin: 0 auto;

}

.reader-header {

    display: flex;

    align-items: center;
    justify-content: space-between;

    margin-bottom: 25px;

}

#reader-chapter-count {

    font-family: var(--font-sans);

    font-size: 10px;

    font-weight: 400;

    letter-spacing: 0.15em;

    color: var(--ink-muted);

}

.chapter-article {

    width: 100%;

}


/* =========================================
   11. CINEMATIC LANDSCAPE IMAGE
========================================= */

.chapter-visual {

    position: relative;

    width: 100%;

    aspect-ratio: 2.35 / 1;

    overflow: hidden;

    background: var(--paper-dark);

}

.chapter-visual img {

    width: 100%;

    height: 100%;

    object-fit: cover;

    object-position: center;

    animation: image-reveal 1.3s var(--ease);

}

.chapter-visual::after {

    content: "";

    position: absolute;

    inset: 0;

    pointer-events: none;

    background: linear-gradient(
        to bottom,
        transparent 65%,
        rgba(0, 0, 0, 0.07)
    );

}

.chapter-visual.is-missing {

    background: linear-gradient(
        135deg,
        #d3c9b9,
        #c0b8ab
    );

}

.chapter-visual.is-missing::before {

    content: "Photograph forthcoming";

    position: absolute;

    inset: 0;

    display: grid;

    place-items: center;

    font-family: var(--font-serif);

    font-size: 18px;

    font-style: italic;

    color: var(--ink-muted);

}

@keyframes image-reveal {

    from {

        opacity: 0;

        transform: scale(1.025);

    }

    to {

        opacity: 1;

        transform: scale(1);

    }

}


/* =========================================
   12. FILM REFERENCE
========================================= */

.chapter-meta {

    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 15px;

    margin-top: 13px;

    padding-bottom: 20px;

    color: var(--ink-muted);

}

#chapter-index {

    font-family: var(--font-sans);

    text-transform: uppercase;

    font-size: 9px;

    letter-spacing: 0.2em;

}

#chapter-film-reference {

    font-family: var(--font-serif);

    font-style: italic;

    font-size: 15px;

}


/* =========================================
   13. EDITORIAL PARAGRAPH
========================================= */

.chapter-editorial {

    position: relative;

    width: 100%;

    display: flow-root;

}

.chapter-text {

    font-family: var(--font-serif);

    font-size: clamp(19px, 2vw, 23px);

    font-weight: 500;

    line-height: 1.42;

    letter-spacing: 0.005em;

    color: var(--ink);

    text-align: justify;

    text-justify: inter-word;

    hyphens: auto;

    overflow-wrap: break-word;

    margin: 0;

    padding: 0;

}

.chapter-text::after {

    content: "";

    display: block;

    clear: both;

}


/* =========================================
   14. EMBEDDED CHAPTER TITLES
========================================= */

.chapter-heading {

    font-family: var(--font-serif);

    font-size: clamp(35px, 5vw, 68px);

    font-weight: 400;

    font-style: italic;

    line-height: 0.88;

    letter-spacing: -0.045em;

    color: var(--ink);

    width: 47%;

    position: relative;

    display: block;

    hyphens: none;

    overflow-wrap: normal;

    text-align: left;

    padding: 10px 0;

}

.chapter-heading::after {

    content: "";

    display: block;

    width: 55px;

    height: 1px;

    background: var(--ink-muted);

    margin-top: 18px;

}


/* =========================================
   15. VARIABLE TITLE POSITIONS
========================================= */


/* TOP LEFT */

.title-top-left > .chapter-heading {

    float: left;

    margin: 2px 30px 15px 0;

    padding-top: 5px;

}


/* TOP RIGHT */

.title-top-right > .chapter-heading {

    float: right;

    text-align: right;

    margin: 2px 0 15px 30px;

    padding-top: 5px;

}

.title-top-right > .chapter-heading::after {

    margin-left: auto;

}


/* CENTER LEFT */

.title-center-left .embedded-heading {

    float: left;

    margin: 12px 30px 16px 0;

}


/* CENTER RIGHT */

.title-center-right .embedded-heading {

    float: right;

    text-align: right;

    margin: 12px 0 16px 30px;

}

.title-center-right .embedded-heading::after {

    margin-left: auto;

}


/* BOTTOM LEFT */

.title-bottom-left .embedded-heading {

    float: left;

    margin: 15px 30px 12px 0;

    width: 50%;

}


/* BOTTOM RIGHT */

.title-bottom-right .embedded-heading {

    float: right;

    text-align: right;

    margin: 15px 0 12px 30px;

    width: 50%;

}

.title-bottom-right .embedded-heading::after {

    margin-left: auto;

}


/* =========================================
   16. READER FOOTER
========================================= */

.reader-footer {

    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 35px;

    margin-top: 55px;

    padding-top: 25px;

    border-top: 1px solid var(--line);

}

.chapter-navigation {

    display: flex;

    flex-direction: column;

    gap: 10px;

    text-align: left;

    transition: opacity 0.3s ease;

}

.chapter-navigation:hover {

    opacity: 0.55;

}

#next-chapter {

    align-items: flex-end;

    text-align: right;

}

.navigation-label {

    font-family: var(--font-sans);

    font-size: 9px;

    letter-spacing: 0.2em;

    text-transform: uppercase;

    color: var(--ink-muted);

}

#previous-chapter-title,
#next-chapter-title {

    font-family: var(--font-serif);

    font-size: clamp(20px, 2.6vw, 30px);

    font-style: italic;

    line-height: 1.05;

}


/* =========================================
   17. EPILOGUE
========================================= */

.ending-page {

    display: flex;

    align-items: center;
    justify-content: center;

    text-align: center;

    padding: 70px 30px;

    background:

        radial-gradient(
            ellipse at center,
            var(--navy-light),
            var(--navy-dark)
        );

    color: var(--ivory);

}

.ending-frame {

    position: absolute;

    inset: 10px;

    border: 1px solid rgba(233, 220, 197, 0.85);

    pointer-events: none;

}

.ending-content {

    max-width: 850px;

    width: 100%;

}

.ending-label {

    display: block;

    font-family: var(--font-sans);

    font-size: 10px;

    letter-spacing: 0.4em;

    text-transform: uppercase;

    margin-bottom: 35px;

    opacity: 0.7;

}

.ending-title {

    font-family: var(--font-script);

    font-size: clamp(52px, 9vw, 115px);

    font-weight: 400;

    line-height: 1.05;

}

.ending-text {

    font-size: clamp(19px, 2.5vw, 26px);

    font-style: italic;

    line-height: 1.5;

    max-width: 460px;

    margin: 30px auto 40px;

    opacity: 0.85;

}


/* =========================================
   18. TABLET RESPONSIVE
========================================= */

@media (max-width: 900px) {

    .landing-content {

        max-width: 720px;

    }

    .chapter-item {

        grid-template-columns: 45px minmax(0, 1fr) 190px;

    }

    .chapter-film {

        font-size: 14px;

    }

    .chapter-heading {

        width: 48%;

    }

    .contents-page {

        padding: 35px 6%;

    }

}


/* =========================================
   19. MOBILE RESPONSIVE
========================================= */

@media (max-width: 600px) {

    /* Landing */

    .landing-page {

        padding: 40px 20px;

    }

    .landing-frame,
    .ending-frame {

        inset: 7px;

    }

    .landing-title {

        padding: 5px 0 25px;

        line-height: 0.9;

    }

    .title-a {

        font-size: 11vw;

        margin-left: 18%;

    }

    .title-funeral {

        font-size: 23vw;

        margin-left: 3%;

        margin-top: 0;

    }

    .title-for-an {

        font-size: 10vw;

        margin-left: 56%;

        margin-top: 5%;

    }

    .title-unwritten {

        font-size: 18.5vw;

        margin-left: 1%;

        margin-top: 1%;

    }

    .title-future {

        font-size: 25vw;

        margin-left: 22%;

        margin-top: 5%;

    }

    .landing-page .enter-button {

        margin-top: 35px;

    }

    .enter-button {

        min-width: 175px;

        font-size: 12px;

        padding: 13px 25px;

        letter-spacing: 0.35em;

    }


    /* Contents */

    .contents-page {

        padding: 24px 6% 25px;

    }

    .contents-header {

        padding-bottom: 18px;

    }

    .edition-label {

        font-size: 12px;

        text-align: right;

    }

    .contents-heading {

        padding: 45px 0 35px;

    }

    .contents-heading h2 {

        font-size: 48px;

    }

    .contents-heading p {

        font-size: 18px;

        line-height: 1.4;

    }

    .section-label {

        font-size: 9px;

        margin-bottom: 17px;

    }

    .chapter-item {

        grid-template-columns: 32px minmax(0, 1fr);

        gap: 7px 8px;

        padding: 20px 3px;

    }

    .chapter-item:hover {

        padding-left: 8px;

    }

    .chapter-number {

        font-size: 17px;

    }

    .chapter-name {

        font-size: 26px;

    }

    .chapter-film {

        grid-column: 2;

        text-align: left;

        font-size: 14px;

    }

    .contents-footer {

        font-size: 8px;

        line-height: 1.5;

    }


    /* Reader */

    .reader-page {

        padding: 20px 5% 35px;

    }

    .reader-header {

        margin-bottom: 18px;

    }

    .chapter-visual {

        aspect-ratio: 16 / 9;

    }

    .chapter-meta {

        padding-bottom: 17px;

        margin-top: 10px;

    }

    #chapter-film-reference {

        font-size: 12px;

        text-align: right;

    }

    #chapter-index {

        font-size: 8px;

    }

    .chapter-text {

        font-size: 18.5px;

        line-height: 1.43;

        letter-spacing: 0;

    }

    .chapter-heading {

        font-size: clamp(29px, 7.8vw, 46px);

        width: 54%;

        line-height: 0.95;

        letter-spacing: -0.035em;

    }

    .chapter-heading::after {

        width: 32px;

        margin-top: 12px;

    }

    .title-top-left > .chapter-heading,
    .title-center-left .embedded-heading,
    .title-bottom-left .embedded-heading {

        width: 54%;

        margin: 8px 15px 10px 0;

    }

    .title-top-right > .chapter-heading,
    .title-center-right .embedded-heading,
    .title-bottom-right .embedded-heading {

        width: 54%;

        margin: 8px 0 10px 15px;

    }

    .reader-footer {

        margin-top: 35px;

        padding-top: 20px;

        gap: 15px;

    }

    #previous-chapter-title,
    #next-chapter-title {

        font-size: 21px;

    }

    .navigation-label {

        font-size: 8px;

    }


    /* Epilogue */

    .ending-title {

        font-size: 14vw;

    }

    .ending-text {

        font-size: 19px;

    }

}


/* =========================================
   20. SMALL MOBILE SCREENS
========================================= */

@media (max-width: 360px) {

    .landing-page {

        padding: 35px 15px;

    }

    .contents-heading h2 {

        font-size: 39px;

    }

    .chapter-name {

        font-size: 23px;

    }

    .chapter-text {

        font-size: 17px;

    }

    .chapter-heading {

        font-size: 28px;

    }

}


/* =========================================
   21. REDUCED MOTION
========================================= */

@media (prefers-reduced-motion: reduce) {

    html {

        scroll-behavior: auto;

    }

    *,
    *::before,
    *::after {

        animation-duration: 0.01ms !important;

        animation-delay: 0ms !important;

        transition-duration: 0.01ms !important;

    }

    .title-line,
    .landing-page .enter-button {

        opacity: 1;

    }

}
/* VINTAGE ANALOG GRAIN */

.grain-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");

    background-repeat: repeat;
    background-size: 180px 180px;

    opacity: 0.48;
    mix-blend-mode: soft-light;
}

body[data-page="contents"] .grain-overlay,
body[data-page="reader"] .grain-overlay {
    opacity: 0.15;
    mix-blend-mode: multiply;
}

/* =========================================
   FINAL LANDING PAGE REFINEMENT
========================================= */

body[data-page="landing"] {
    background: #343e4d;
}

/* LANDING BACKGROUND */

.landing-page {
    min-height: 100vh;
    min-height: 100svh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 45px 25px;

    background: radial-gradient(
        ellipse at 50% 45%,
        #424c5a 0%,
        #343e4d 60%,
        #2d3542 100%
    );

    isolation: isolate;
    overflow: hidden;
}


/* =========================================
   HEAVY VINTAGE GRAIN
========================================= */

/* Disable the old grain on landing */

body[data-page="landing"] .grain-overlay,
body[data-page="contents"] .grain-overlay  {
    display: none;
}

/* Seamless monochromatic texture */

.landing-page::before {
    content: "";

    position: absolute;
    inset: 0;

    z-index: 1;
    pointer-events: none;

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Cfilter id='noise' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.76' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncR type='linear' slope='2.2' intercept='-.6'/%3E%3CfeFuncG type='linear' slope='2.2' intercept='-.6'/%3E%3CfeFuncB type='linear' slope='2.2' intercept='-.6'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");

    background-size: 100% 100%;
    background-repeat: no-repeat;

    opacity: 0.68;
    mix-blend-mode: overlay;
}


/* Soft vintage vignette */

.landing-page::after {
    content: "";

    position: absolute;
    inset: 0;

    pointer-events: none;
    z-index: 1;

    background: radial-gradient(
        ellipse at center,
        transparent 40%,
        rgba(0, 0, 0, 0.17) 100%
    );
}


/* =========================================
   BOOK COVER FRAME
========================================= */

.landing-frame {
    position: absolute;
    inset: 9px;

    border: 1px solid rgba(233, 220, 197, 0.8);

    z-index: 2;
}


/* =========================================
   CENTERED COMPOSITION
========================================= */

.landing-content {
    position: relative;

    width: min(88vw, 740px, 86svh);
    max-width: 740px;

    display: flex;
    flex-direction: column;

    justify-content: center;
    align-items: center;

    container-type: inline-size;

    margin: auto;

    z-index: 3;
}


/* =========================================
   REFINED CALLIGRAPHY
========================================= */

.landing-title {
    display: grid;
    grid-template-columns: 1fr;

    width: 100%;

    padding: 0;
    margin: 0;

    font-family: "Pinyon Script", cursive;
    font-weight: 400;

    color: #eadbc4;

    line-height: 1;

    animation: refined-title-reveal 1.8s ease both;
}

.landing-title .title-line {
    display: block;

    width: max-content;
    max-width: none;

    margin: 0;
    padding: 0;

    font-family: "Pinyon Script", cursive;
    font-weight: 400;

    white-space: nowrap;

    opacity: 1;
    animation: none;
}


/* A */

.landing-title .title-a {
    font-family: "Cormorant Garamond", serif;
    font-style: italic;

    font-size: 10cqw;
    line-height: 1.05;

    justify-self: start;

    margin-left: 21%;
}


/* Funeral */

.landing-title .title-funeral {
    font-size: 25cqw;
    line-height: 1;

    justify-self: center;
}


/* for an */

.landing-title .title-for-an {
    font-size: 11cqw;
    line-height: 1.05;

    justify-self: center;

    margin-left: 30%;
}


/* Unwritten */

.landing-title .title-unwritten {
    font-size: 23cqw;
    line-height: 1.05;

    justify-self: center;
}


/* Future */

.landing-title .title-future {
    font-size: 26cqw;
    line-height: 1.05;

    justify-self: center;

    margin-left: 12%;
}


/* =========================================
   ENTER BUTTON
========================================= */

.landing-page .enter-button {
    min-width: 210px;

    margin-top: 32px;
    padding: 13px 32px;

    border: 1px solid #eadbc4;
    border-radius: 100px;

    background: transparent;
    color: #eadbc4;

    font-family: "Cormorant Garamond", serif;
    font-size: 14px;
    font-weight: 500;

    letter-spacing: 0.45em;

    text-transform: uppercase;

    animation: button-reveal 1.2s ease 0.8s both;
}

.landing-page .enter-button:hover {
    background: #eadbc4;
    color: #343e4d;
}


/* =========================================
   SOFT ENTRANCE
========================================= */

@keyframes refined-title-reveal {
    from {
        opacity: 0;
        transform: translateY(8px);
        filter: blur(3px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}


/* =========================================
   MOBILE RESPONSIVE
========================================= */

@media (max-width: 600px) {

    .landing-page {
        padding: 35px 22px;
    }

    .landing-content {
        width: 100%;
        max-width: 460px;
    }

    .landing-frame {
        inset: 7px;
    }

    .landing-page .enter-button {
        min-width: 165px;

        margin-top: 40px;

        padding: 12px 25px;

        font-size: 12px;
    }
}
.landing-title .title-a {
    text-transform: lowercase !important;
}
/* =========================================
   VINTAGE LINEN BOOK COVER TEXTURE
========================================= */

.landing-page {
    background-color: #343e4d;

    background-image:
        radial-gradient(
            ellipse at center,
            rgba(255, 255, 255, 0.055),
            rgba(0, 0, 0, 0.18)
        ),

        repeating-linear-gradient(
            0deg,
            rgba(255, 255, 255, 0.045) 0px,
            rgba(255, 255, 255, 0.045) 1px,
            rgba(0, 0, 0, 0.06) 1px,
            rgba(0, 0, 0, 0.06) 2px
        ),

        repeating-linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.035) 0px,
            rgba(255, 255, 255, 0.035) 1px,
            rgba(0, 0, 0, 0.05) 1px,
            rgba(0, 0, 0, 0.05) 2px
        );

    background-blend-mode:
        normal,
        soft-light,
        soft-light;
}

/* Preserve the existing analog grain */

.landing-page::before {
    opacity: 0.55;
    mix-blend-mode: overlay;
}

/* =========================================
   COARSE WOVEN LINEN
   Vintage clothbound book texture
========================================= */

.landing-page {

    --linen-size: 6px;

    background-color: #343e4d;

    background-image:

        /* Soft lighting */
        radial-gradient(
            ellipse at 45% 35%,
            rgba(255, 255, 255, 0.06),
            rgba(0, 0, 0, 0.18)
        ),

        /* Interwoven fabric pattern */
        repeating-conic-gradient(
            rgba(255, 255, 255, 0.09) 0% 25%,
            rgba(0, 0, 0, 0.12) 0% 50%
        ),

        /* Horizontal linen threads */
        repeating-linear-gradient(
            0deg,
            rgba(0, 0, 0, 0.20) 0px,
            rgba(255, 255, 255, 0.14) 1px,
            rgba(255, 255, 255, 0.04) 2px,
            rgba(0, 0, 0, 0.08) 3px,
            transparent 4px
        ),

        /* Vertical linen threads */
        repeating-linear-gradient(
            90deg,
            rgba(0, 0, 0, 0.18) 0px,
            rgba(255, 255, 255, 0.12) 1px,
            rgba(255, 255, 255, 0.03) 2px,
            rgba(0, 0, 0, 0.10) 3px,
            transparent 4px
        );

    background-size:
        100% 100%,
        var(--linen-size) var(--linen-size),
        100% 4px,
        4px 100%;

    background-blend-mode:
        normal,
        soft-light,
        normal,
        normal;
}


/* Organic grain over the woven fabric */

.landing-page::before {

    opacity: 0.70;

    mix-blend-mode: overlay;

}


/* Slightly aged edges */

.landing-page::after {

    background: radial-gradient(
        ellipse at center,
        transparent 35%,
        rgba(0, 0, 0, 0.22) 100%
    );

}

/* =========================================
   REAL VINTAGE LINEN TEXTURE
========================================= */

.landing-page {
    background-color: #343e4d;

    background-image: url("./linen.jpg");

    background-size: 550px auto;
    background-repeat: repeat;
    background-position: center;

    background-blend-mode: multiply;
}

/* Muted navy tint */

.landing-page::before {
    content: "";

    position: absolute;
    inset: 0;

    background: rgba(52, 62, 77, 0.25);

    opacity: 1;
    mix-blend-mode: normal;

    pointer-events: none;
    z-index: 1;
}

/* Vintage vignette */

.landing-page::after {
    content: "";

    position: absolute;
    inset: 0;

    background: radial-gradient(
        ellipse at center,
        transparent 35%,
        rgba(0, 0, 0, 0.25) 100%
    );

    pointer-events: none;
    z-index: 1;
}
/* =========================================
   FOREGROUND ANALOG GRAIN
========================================= */

body[data-page="landing"] .grain-overlay,
body[data-page="contents"] .grain-overlay {
    display: block !important;

    position: fixed;
    inset: 0;

    z-index: 99999;
    pointer-events: none;

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");

    background-size: 100% 100%;
    background-repeat: no-repeat;

    opacity: 70;

    mix-blend-mode: overlay;
}
/* =========================================
   HIGH CONTRAST FOREGROUND FILM GRAIN
========================================= */

body[data-page="landing"] .grain-overlay,
body[data-page="contents"] .grain-overlay {
    display: block !important;

    position: fixed;
    inset: 0;

    width: 100%;
    height: 100%;

    z-index: 999999;
    pointer-events: none;

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256' viewBox='0 0 256 256'%3E%3Cfilter id='noise' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncR type='linear' slope='4' intercept='-1.5'/%3E%3CfeFuncG type='linear' slope='4' intercept='-1.5'/%3E%3CfeFuncB type='linear' slope='4' intercept='-1.5'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='256' height='256' filter='url(%23noise)'/%3E%3C/svg%3E") !important;

    background-size: 256px 256px !important;
    background-repeat: repeat !important;

    mix-blend-mode: normal !important;
    opacity: 0.25 !important;
}
.landing-title .title-a {
    font-family: "Pinyon Script", cursive;
    font-style: italic !important;
    font-weight: 400;
    text-transform: lowercase !important;
    transform: skewX(-5deg);
    transform-origin: center;
}
.funeral-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 1.5cqw;
    width: 100%;
}

.landing-title .title-a {
    font-family: "Pinyon Script", cursive;
    font-size: 13cqw;
    font-style: normal;
    text-transform: lowercase !important;
    transform: skewX(-10deg);
    margin: 0;
    line-height: 1;
}

.landing-title .title-funeral {
    font-size: 25cqw;
    margin: 0;
    line-height: 1;
}
.funeral-row {
    align-items: center;
}

.landing-title .title-a {
    align-self: center;
    position: relative;
    top: 0;
    margin: 0;
    transform: skewX(-10deg);
}

/* =========================================
   THE COLOR ARCHIVE
   Stacked Linen Folder Navigation
========================================= */

.contents-page {
    padding: 0;
    min-height: 100svh;

    background-color: #e4dac6;
    background-image: url("./linen.jpg");
    background-size: 550px auto;
    background-repeat: repeat;
    background-blend-mode: multiply;

    color: #1d120e;
}

.contents-container {
    width: 100%;
    max-width: none;
    min-height: 100svh;

    display: flex;
    flex-direction: column;

    margin: 0;
}


/* =========================================
   MINIMAL HEADER
========================================= */

.contents-header {
    padding: 25px 5%;
    border: none;
}

.contents-header .edition-label {
    display: none;
}

.contents-heading {
    padding: 65px 20px 100px;
    text-align: center;
}

.contents-heading h2 {
    font-family: "Cormorant Garamond", serif;
    font-size: clamp(45px, 7vw, 90px);
    font-weight: 400;
    letter-spacing: -0.045em;
    line-height: 1;
}

.contents-heading p {
    max-width: none;

    margin: 12px auto 0;

    font-family: "Inter", sans-serif;
    font-size: 11px;
    font-weight: 300;
    font-style: normal;

    text-transform: uppercase;
    letter-spacing: 0.08em;

    color: #1d120e;
}


/* =========================================
   STACKED FOLDER SYSTEM
========================================= */

.chapter-list {
    display: flex;
    flex-direction: column;
    flex: 1;

    border: none;
    width: 100%;
}

.chapter-item {

    --folder-color: #462e24;
    --folder-text: #f3e5c2;

    --tab-width: min(480px, 88%);
    --tab-position: 0.15;
    --tab-height: 44px;

    --tab-left: calc(
        (100% - var(--tab-width))
        * var(--tab-position)
    );

    --tab-right: calc(
        var(--tab-left) + var(--tab-width)
    );

    position: relative;

    display: block;

    width: 100%;
    height: 112px;
    min-height: 112px;

    flex-shrink: 0;

    margin: -44px 0 0;
    padding: 0;

    border: none;
    border-radius: 0;

    background-color: var(--folder-color);
    background-image: url("./linen.jpg");
    background-repeat: repeat;
    background-size: 550px auto;
    background-blend-mode: multiply;

    color: var(--folder-text);

    clip-path: polygon(
        0 var(--tab-height),

        calc(var(--tab-left) - 12px) var(--tab-height),
        var(--tab-left) 39px,
        calc(var(--tab-left) + 7px) 12px,
        calc(var(--tab-left) + 12px) 3px,
        calc(var(--tab-left) + 20px) 0,

        calc(var(--tab-right) - 20px) 0,
        calc(var(--tab-right) - 12px) 3px,
        calc(var(--tab-right) - 7px) 12px,
        var(--tab-right) 39px,
        calc(var(--tab-right) + 12px) var(--tab-height),

        100% var(--tab-height),
        100% 100%,
        0 100%
    );

    transition:
        transform 0.4s ease,
        filter 0.4s ease;
}

.chapter-item:first-child {
    margin-top: 0;
}


/* =========================================
   FOLDER TAB TYPOGRAPHY
========================================= */

.chapter-number,
.chapter-film {
    display: none;
}

.chapter-name {
    position: absolute;

    top: 0;
    left: var(--tab-left);

    width: var(--tab-width);
    height: var(--tab-height);

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 4px 20px;

    font-family: "Inter", sans-serif;
    font-size: clamp(9px, 1.2vw, 14px);
    font-weight: 300;
    font-style: normal;

    text-transform: uppercase;
    text-align: center;

    letter-spacing: -0.025em;
    line-height: 1.15;

    color: var(--folder-text);
}

.chapter-item.is-current .chapter-name {
    font-style: normal;
}

.chapter-item:hover {
    padding: 0;
    transform: translateY(-5px);
    filter: brightness(1.12);
}

.chapter-item:focus-visible {
    filter: brightness(1.3);
}


/* =========================================
   CHAPTER COLORS & TAB POSITIONS
========================================= */

/* I — Potting Soil */

.chapter-item:nth-child(1) {
    --folder-color: #462E24;
    --folder-text: #F3E5C2;
    --tab-position: 0.12;
}

/* II — Cerulean Blue */

.chapter-item:nth-child(2) {
    --folder-color: #A4BCD4;
    --folder-text: #1D120E;
    --tab-position: 0.75;
}

/* III — Sceptre Red */

.chapter-item:nth-child(3) {
    --folder-color: #490B0C;
    --folder-text: #F3E5C2;
    --tab-position: 0.42;
}

/* IV — Transparent Yellow */

.chapter-item:nth-child(4) {
    --folder-color: #F3E5C2;
    --folder-text: #1D120E;
    --tab-position: 0.85;
}

/* V — Java Brown */

.chapter-item:nth-child(5) {
    --folder-color: #1D120E;
    --folder-text: #F3E5C2;
    --tab-position: 0.25;
}

/* VI — Cerulean Blue */

.chapter-item:nth-child(6) {
    --folder-color: #A4BCD4;
    --folder-text: #1D120E;
    --tab-position: 0.70;
}

/* VII — Potting Soil */

.chapter-item:nth-child(7) {
    --folder-color: #462E24;
    --folder-text: #F3E5C2;
    --tab-position: 0.15;
}

/* VIII — Sceptre Red */

.chapter-item:nth-child(8) {
    --folder-color: #490B0C;
    --folder-text: #F3E5C2;
    --tab-position: 0.80;
}

/* IX — Transparent Yellow */

.chapter-item:nth-child(9) {
    --folder-color: #F3E5C2;
    --folder-text: #1D120E;
    --tab-position: 0.30;
}

/* X — Cerulean Blue */

.chapter-item:nth-child(10) {
    --folder-color: #A4BCD4;
    --folder-text: #1D120E;
    --tab-position: 0.85;
}

/* XI — Java Brown */

.chapter-item:nth-child(11) {
    --folder-color: #1D120E;
    --folder-text: #F3E5C2;
    --tab-position: 0.45;
}


/* =========================================
   FINAL FOLDER — EMPTY COVER
========================================= */

.chapter-item:last-child {
    flex: 1;
    min-height: 280px;
    height: auto;
}

.chapter-item:last-child:hover {
    transform: none;
}

.contents-footer {
    display: none;
}


/* =========================================
   MOBILE RESPONSIVE
========================================= */

@media (max-width: 600px) {

    .contents-header {
        padding: 20px 6%;
    }

    .contents-heading {
        padding: 55px 15px 85px;
    }

    .contents-heading h2 {
        font-size: 48px;
    }

    .contents-heading p {
        font-size: 9px;
    }

    .chapter-item {
        --tab-width: 78%;

        height: 98px;
        min-height: 98px;
    }

    .chapter-name {
        font-size: 10px;
        padding: 4px 15px;
    }

    .chapter-item:last-child {
        min-height: 240px;
    }

}
/* =========================================
   STACKED FOLDER — LIFT HOVER EFFECT
========================================= */

.contents-page .chapter-item {
    transition: transform 0.45s
        cubic-bezier(0.22, 1, 0.36, 1);

    transform: translateY(0);
}

/* Preserve color and linen on hover */

.contents-page .chapter-item:hover {
    background-color: var(--folder-color);
    background-image: url("./linen.jpg");

    background-size: 550px auto;
    background-repeat: repeat;
    background-blend-mode: multiply;

    transform: translateY(-14px);

    filter: none;
    padding: 0;
}

/* Keep the final folder flush with the bottom */

.contents-page .chapter-item:last-child:hover {
    transform: none;
}
/* =========================================
   SEAMLESS STACKED FOLDER HOVER
========================================= */

.contents-page .chapter-item {
    margin-top: -68px;
}

.contents-page .chapter-item:not(:last-child) {
    height: 136px;
    min-height: 136px;
}

.contents-page .chapter-item:first-child {
    margin-top: 0;
}

.contents-page .chapter-item:hover {
    transform: translateY(-14px);
}

.contents-page .chapter-item:last-child:hover {
    transform: none;
}

/* MOBILE */

@media (max-width: 600px) {
    .contents-page .chapter-item:not(:last-child) {
        height: 122px;
        min-height: 122px;
    }
}
/* Remove chapter title underline */

.chapter-heading::after {
    content: none !important;
    display: none !important;
}

/* Reduce spacing around chapter titles */

.chapter-heading {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-bottom: 5px !important;
}
/* =========================================
   TIGHT EDITORIAL TITLE SPACING
   Applies to all 11 chapters
========================================= */

.chapter-heading::after {
    content: none !important;
    display: none !important;
}

.chapter-heading {
    padding: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 3px !important;
}

/* All left-aligned titles */

.title-top-left > .chapter-heading,
.title-center-left .embedded-heading,
.title-bottom-left .embedded-heading {
    margin-left: 0 !important;
    margin-right: 10px !important;
}

/* All right-aligned titles */

.title-top-right > .chapter-heading,
.title-center-right .embedded-heading,
.title-bottom-right .embedded-heading {
    margin-left: 10px !important;
    margin-right: 0 !important;
}
/* =========================================
   EPILOGUE — THE FINAL FAREWELL
========================================= */

#ending-page .ending-content {
    width: 100%;
    max-width: 1000px;
    padding: 60px 24px;
    text-align: center;
    margin: auto;
}

#ending-page .ending-label {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 0.45em;
    margin-bottom: 28px;
    color: var(--ivory);
}

#ending-page .ending-title {
    font-family: 'Pinyon Script', cursive;
    font-weight: 400;
    font-size: clamp(68px, 9vw, 150px);
    line-height: 0.9;
    color: var(--ivory);
    margin: 0;
}

#ending-page .ending-title span {
    display: block;
}

#ending-page .ending-title span:nth-child(2) {
    font-size: 1.2em;
}

#ending-page .ending-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(18px, 2vw, 26px);
    font-style: italic;
    font-weight: 400;
    line-height: 1.5;
    color: var(--ivory);
    max-width: 580px;
    margin: 40px auto 32px;
}

#restart-button {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 0.45em;
    color: var(--ivory);

    background: transparent;
    border: none;
    border-radius: 0;
    padding: 8px 0;

    text-decoration: underline;
    text-underline-offset: 7px;
    text-decoration-thickness: 1px;

    cursor: pointer;
    transition: opacity 0.4s ease;
}

#restart-button:hover {
    opacity: 0.5;
}

@media (max-width: 600px) {

    #ending-page .ending-content {
        padding: 40px 24px;
    }

    #ending-page .ending-title {
        font-size: clamp(52px, 11vw, 80px);
    }

    #ending-page .ending-text {
        max-width: 290px;
        font-size: 19px;
        margin: 30px auto;
    }

}
#enter-button,
#restart-button {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 0.15em;
    color: var(--ivory);

    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 8px 0;

    text-decoration: underline;
    text-underline-offset: 7px;
    text-decoration-thickness: 1px;

    cursor: pointer;
    transition: opacity 0.4s ease;
}

#enter-button:hover,
#restart-button:hover {
    background: transparent;
    color: var(--ivory);
    opacity: 0.5;
}


/* =============================================
   CHAPTER IMAGES — CINEMATIC FILM STILLS
   A Funeral for an Unwritten Future
============================================= */

.chapter-visual {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

#chapter-image {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    object-position: center;
    border: none;
    border-radius: 0;
    opacity: 1;
    visibility: visible;
}

#chapter-image[hidden] {
    display: none;
}

.chapter-visual.has-image {
    background: transparent;
}

.chapter-visual.has-image::before,
.chapter-visual.has-image::after {
    display: none;
}

/* =============================================
   MOBILE RESPONSIVE
============================================= */

@media screen and (max-width: 600px) {

    .chapter-visual {
        width: 100%;
        aspect-ratio: 16 / 9;
        overflow: hidden;
    }

    #chapter-image {
        width: 100%;
        height: 100%;
        aspect-ratio: 16 / 9;
        object-fit: cover;
        object-position: center;
    }

}

/* =========================================
   SLOW CINEMATIC EPILOGUE
========================================= */

#ending-page.is-active {
    animation: epilogueFadeIn 2s ease-in-out both !important;
}

#ending-page.is-active .ending-content {
    animation: epilogueContentReveal 2.5s ease-in-out both !important;
}

@keyframes epilogueFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes epilogueContentReveal {
    0% {
        opacity: 0;
        transform: translateY(12px);
    }

    20% {
        opacity: 0;
    }

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





/* =========================================
   END OF STYLESHEET
========================================= */
