/* =========================================================
   THE ARCHIVE — website styles
   All colours and fonts live in :root for easy theming.
========================================================= */

:root {
    --paper: #efe6d3;
    --paper-2: #e6dbc4;
    --paper-light: #f8f2e4;
    --page: #f8f2e3;
    --card: #fbf7ec;
    --ink: #241f19;
    --ink-soft: #4a4238;
    --muted: #7d7262;
    --line: rgba(36, 31, 25, .15);
    --line-strong: rgba(36, 31, 25, .32);
    --red: #9a3f2f;
    --red-dark: #7d3124;
    --gold: #a68a58;
    --desk: #1d1813;
    --desk-2: #2b231c;
    --cream: #eee3cd;
    --cream-soft: rgba(238, 227, 205, .7);

    --display: "Cormorant Garamond", "EB Garamond", Georgia, serif;
    --serif: "EB Garamond", Georgia, "Times New Roman", serif;
    --hand: "Caveat", "Segoe Print", cursive;
    --type: "Courier Prime", "Courier New", monospace;

    --nav-h: 80px;
    --gutter: 88px;
    --ease: cubic-bezier(.2, .7, .2, 1);

    --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .2 0 0 0 0 .16 0 0 0 0 .1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    --mottle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600'%3E%3Cfilter id='m'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.006' numOctaves='3' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .34 0 0 0 0 .2 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23m)'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
    background-color: var(--paper);
    background-image: var(--mottle);
    color: var(--ink);
    font-family: var(--serif);
    font-size: 18px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}
/* Fine paper grain over everything */
body::after {
    content: ""; position: fixed; inset: 0; z-index: 1000; pointer-events: none;
    background-image: var(--noise); opacity: .2; mix-blend-mode: multiply;
}
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
::selection { background: rgba(154, 63, 47, .22); }

.skip-link {
    position: fixed; left: 16px; top: -60px; z-index: 2000;
    background: var(--ink); color: var(--paper-light); padding: 10px 16px;
    font-family: var(--type); font-size: 13px; text-decoration: none; transition: top .2s;
}
.skip-link:focus { top: 12px; }

.container { width: min(1180px, calc(100% - 2 * var(--gutter))); margin: 0 auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------
   LOADER
--------------------------------------------------------- */
.loader {
    position: fixed; inset: 0; z-index: 3000;
    display: grid; place-items: center; align-content: center; gap: 26px;
    background: var(--paper); transition: opacity .7s ease, visibility .7s;
}
.loader.is-done { opacity: 0; visibility: hidden; }
.loader-book {
    width: 74px; height: 96px; border-radius: 2px 7px 7px 2px;
    background: linear-gradient(90deg, rgba(0,0,0,.3), transparent 14%), #4a3a2c;
    display: grid; place-items: center; color: var(--cream);
    font-family: var(--display); font-style: italic; font-size: 38px;
    box-shadow: 10px 14px 24px rgba(0,0,0,.2);
    animation: loaderTilt 1.8s var(--ease) infinite alternate;
}
.loader-text { font-family: var(--type); font-size: 12px; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); }
@keyframes loaderTilt { from { transform: perspective(500px) rotateY(-22deg); } to { transform: perspective(500px) rotateY(8deg); } }

/* ---------------------------------------------------------
   NAVIGATION
--------------------------------------------------------- */
.site-nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: var(--nav-h); color: var(--ink);
    transition: background-color .35s ease, box-shadow .35s ease, color .35s ease, transform .4s var(--ease);
}
.site-nav.is-solid {
    background-color: rgba(239, 230, 211, .94);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 var(--line), 0 12px 30px rgba(36, 31, 25, .07);
}
body.on-dark .site-nav:not(.is-solid) { color: var(--cream); }
body.view-is-reader .site-nav { transform: translateY(-110%); }

.nav-inner {
    height: 100%; width: min(1400px, calc(100% - 48px)); margin: 0 auto;
    display: flex; align-items: center; gap: 34px;
}
.nav-brand { display: flex; align-items: center; gap: 13px; text-decoration: none; flex-shrink: 0; }
.brand-stamp {
    position: relative; width: 46px; height: 46px; border-radius: 50%;
    border: 1.5px solid currentColor; display: grid; place-items: center;
    font-family: var(--display); font-style: italic; font-weight: 600; font-size: 25px; line-height: 1;
    transition: transform .5s var(--ease);
}
.brand-stamp::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; border: 1px dashed currentColor; opacity: .45; }
.nav-brand:hover .brand-stamp { transform: rotate(-14deg); }
.brand-name { display: block; font-family: var(--hand); font-size: 31px; font-weight: 600; line-height: .85; }
.brand-sub { display: block; margin-top: 4px; font-family: var(--type); font-size: 10px; letter-spacing: .26em; text-transform: uppercase; opacity: .7; }

.nav-links { display: flex; align-items: center; gap: 2px; padding-left: 26px; border-left: 1px solid currentColor; border-left-color: color-mix(in srgb, currentColor 25%, transparent); }
.nav-links a {
    position: relative; padding: 10px 13px; text-decoration: none;
    font-family: var(--type); font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap;
    opacity: .82; transition: opacity .2s;
}
.nav-links a::after {
    content: ""; position: absolute; left: 13px; right: 13px; bottom: 3px; height: 2px;
    background: var(--red); border-radius: 2px;
    transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease);
}
.nav-links a:hover, .nav-links a.is-active { opacity: 1; }
.nav-links a:hover::after, .nav-links a.is-active::after { transform: scaleX(1); }

.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn {
    width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
    border: 1px solid transparent; transition: border-color .2s, background-color .2s;
}
.icon-btn:hover { border-color: currentColor; }
.nav-cta {
    display: inline-flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: 999px;
    border: 1px solid currentColor; text-decoration: none; white-space: nowrap;
    font-family: var(--type); font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
    transition: background-color .25s, color .25s, border-color .25s;
}
.nav-cta:hover { background: var(--ink); color: var(--paper-light); border-color: var(--ink); }
body.on-dark .site-nav:not(.is-solid) .nav-cta:hover { background: var(--cream); color: var(--ink); border-color: var(--cream); }

.nav-toggle { display: none; width: 46px; height: 46px; border-radius: 50%; border: 1px solid currentColor; position: relative; }
.nav-toggle span { position: absolute; left: 13px; right: 13px; height: 1.5px; background: currentColor; transition: transform .35s var(--ease), top .35s var(--ease); }
.nav-toggle span:first-child { top: 18px; }
.nav-toggle span:last-child { top: 26px; }
.nav-toggle[aria-expanded="true"] span:first-child { top: 22px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { top: 22px; transform: rotate(-45deg); }

/* Mobile menu */
.mobile-menu {
    position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column;
    padding: calc(var(--nav-h) + 24px) 24px 32px; overflow-y: auto;
    background-color: var(--paper); background-image: var(--mottle);
    opacity: 0; visibility: hidden; transform: translateY(-12px);
    transition: opacity .35s ease, transform .45s var(--ease), visibility .35s;
}
.mobile-menu.is-open { opacity: 1; visibility: visible; transform: none; }
.mobile-menu nav { display: grid; }
.mobile-menu nav a {
    display: flex; align-items: baseline; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line);
    text-decoration: none; font-family: var(--display); font-size: 34px; font-weight: 600; line-height: 1.1;
}
.mobile-menu nav a span { font-family: var(--type); font-size: 11px; letter-spacing: .2em; color: var(--red); }
.mobile-menu nav a.is-active { color: var(--red); }
.mobile-find { margin-top: auto; padding-top: 32px; }
.mobile-find p { font-family: var(--type); font-size: 11px; letter-spacing: .26em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
body.menu-open { overflow: hidden; }
body.menu-open .site-nav { color: var(--ink); background: transparent; box-shadow: none; backdrop-filter: none; }

/* Find me — fixed rail on the left */
.find-rail {
    position: fixed; left: 26px; bottom: 0; z-index: 80;
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    color: var(--ink); transition: color .35s ease, opacity .4s ease, transform .4s var(--ease);
}
body.rail-dark .find-rail { color: var(--cream); }
body.view-is-reader .find-rail { opacity: 0; pointer-events: none; transform: translateX(-30px); }
.rail-label {
    writing-mode: vertical-rl; transform: rotate(180deg); margin-bottom: 6px;
    font-family: var(--type); font-size: 11px; letter-spacing: .32em; text-transform: uppercase; opacity: .8;
}
.rail-line { width: 1px; height: 88px; background: currentColor; opacity: .35; }

.social-list { display: flex; gap: 10px; list-style: none; }
.find-rail .social-list { flex-direction: column; }
.social-link {
    width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
    border: 1px solid color-mix(in srgb, currentColor 35%, transparent); text-decoration: none;
    transition: background-color .25s, color .25s, transform .3s var(--ease), border-color .25s;
}
.social-link:hover { background: var(--red); border-color: var(--red); color: #fff; transform: translateY(-3px) rotate(-6deg); }

/* ---------------------------------------------------------
   VIEWS
--------------------------------------------------------- */
.view { display: none; }
.view.is-active { display: block; animation: viewIn .55s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Shared bits */
.kicker {
    display: inline-flex; align-items: center; gap: 12px;
    font-family: var(--type); font-size: 12px; letter-spacing: .24em; text-transform: uppercase;
}
.kicker .no { color: var(--red); }
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 12px;
    padding: 16px 26px; border-radius: 999px; border: 1px solid var(--ink);
    font-family: var(--type); font-size: 12.5px; letter-spacing: .18em; text-transform: uppercase; text-decoration: none;
    transition: background-color .25s, color .25s, border-color .25s, transform .3s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--ink); color: var(--paper-light); }
.btn-primary:hover { background: var(--red); border-color: var(--red); }
.btn-ghost:hover { background: var(--ink); color: var(--paper-light); }
.btn .arrow { transition: transform .3s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.hand-link {
    font-family: var(--hand); font-size: 27px; color: var(--red); text-decoration: none; white-space: nowrap;
    background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat; transition: background-size .35s var(--ease);
}
.hand-link:hover { background-size: 100% 1.5px; }
.stamp {
    display: inline-block; padding: 4px 10px 3px; border: 1.5px solid var(--red); border-radius: 3px;
    color: var(--red); font-family: var(--type); font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
    transform: rotate(-2deg);
}
.empty-note { padding: 50px 20px; text-align: center; font-style: italic; color: var(--muted); }

/* Reveal on scroll */
.js .reveal { opacity: 0; translate: 0 26px; transition: opacity .9s ease, translate .9s var(--ease), transform .45s var(--ease), box-shadow .45s var(--ease); }
.js .reveal.is-in { opacity: 1; translate: 0 0; }

/* ---------------------------------------------------------
   HERO
--------------------------------------------------------- */
.hero {
    position: relative; isolation: isolate; overflow: hidden;
    min-height: 100vh; min-height: 100svh;
    display: flex; flex-direction: column;
    padding-top: calc(var(--nav-h) + 30px);
}
.hero-bg, .hero-shade { position: absolute; inset: 0; z-index: -2; }
.hero-bg {
    background: var(--hero-image) center / cover no-repeat;
    transform: scale(1.08); animation: heroZoom 14s ease-out forwards;
}
.hero-shade { z-index: -1; }
@keyframes heroZoom { to { transform: scale(1); } }

/* Without an image: a soft paper hero */
.hero:not(.has-image) .hero-bg {
    background:
        radial-gradient(ellipse at 72% 45%, rgba(255, 252, 240, .65), transparent 55%),
        repeating-linear-gradient(0deg, transparent 0 41px, rgba(36, 31, 25, .045) 41px 42px);
    animation: none; transform: none;
}
.hero:not(.has-image) .hero-shade { background: linear-gradient(180deg, transparent 70%, rgba(36, 31, 25, .06)); }

/* With an image: photo with a warm dark wash */
.hero.has-image { color: var(--cream); }
.hero.has-image .hero-shade {
    background:
        linear-gradient(90deg, rgba(22, 17, 12, calc(var(--overlay) + .2)) 0%, rgba(22, 17, 12, var(--overlay)) 55%, rgba(22, 17, 12, calc(var(--overlay) - .15)) 100%),
        linear-gradient(0deg, rgba(22, 17, 12, .75) 0%, transparent 35%);
}

.hero-inner {
    flex: 1; display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 60px;
    padding: 40px 0 60px;
}
.hero-kicker { opacity: .85; margin-bottom: 30px; }
.hero-kicker .no { color: inherit; }
.hero.has-image .hero-kicker .dot, .hero:not(.has-image) .hero-kicker .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--red); }
.hero-title {
    font-family: var(--display); font-weight: 600;
    font-size: clamp(64px, 10.5vw, 158px); line-height: .84; letter-spacing: -.025em;
}
.hero-title em { position: relative; display: inline-block; font-style: italic; font-weight: 500; color: var(--red); }
.hero.has-image .hero-title em { color: #e9b9a6; }
.hero-title .scribble { position: absolute; left: 2%; right: -2%; bottom: -.12em; width: 100%; height: .22em; color: currentColor; opacity: .75; }
.hero-text { margin-top: 38px; max-width: 520px; font-size: 21px; line-height: 1.6; opacity: .92; }
.hero-quote {
    margin-top: 26px; padding-left: 18px; max-width: 480px; border-left: 2px solid var(--red);
    font-family: var(--hand); font-size: 30px; line-height: 1.1; opacity: .95;
}
.hero-actions { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 14px; }
.hero.has-image .btn-primary { background: var(--cream); color: var(--ink); border-color: var(--cream); }
.hero.has-image .btn-primary:hover { background: var(--red); color: #fff; border-color: var(--red); }
.hero.has-image .btn-ghost { border-color: var(--cream-soft); color: var(--cream); }
.hero.has-image .btn-ghost:hover { background: var(--cream); color: var(--ink); }

.hero-book { display: flex; justify-content: center; }
.hero-book-wrap { position: relative; width: min(340px, 100%); }
.hero-book-link { display: block; }
.hero-book .cover { width: 100%; font-size: 15px; }
.hero-book-note {
    position: absolute; bottom: -38px; right: -10px; transform: rotate(-5deg);
    font-family: var(--hand); font-size: 26px; color: var(--red); white-space: nowrap;
}
.hero.has-image .hero-book-note { color: #e9b9a6; }

.hero-index {
    display: grid; grid-template-columns: repeat(4, 1fr) auto;
    border-top: 1px solid color-mix(in srgb, currentColor 22%, transparent);
}
.hero-index a {
    padding: 20px 22px 24px 0; text-decoration: none; display: flex; align-items: baseline; gap: 12px;
    transition: color .25s;
}
.hero-index a:hover { color: var(--red); }
.hero.has-image .hero-index a:hover { color: #e9b9a6; }
.hero-index b { font-family: var(--display); font-size: 40px; font-weight: 600; line-height: 1; }
.hero-index span { font-family: var(--type); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; opacity: .8; }
.scroll-cue {
    align-self: center; display: flex; align-items: center; gap: 12px; text-decoration: none;
    font-family: var(--type); font-size: 11px; letter-spacing: .26em; text-transform: uppercase; opacity: .75;
}
.scroll-cue i { display: block; width: 1px; height: 34px; background: currentColor; position: relative; overflow: hidden; }
.scroll-cue i::after { content: ""; position: absolute; left: 0; top: -100%; width: 1px; height: 100%; background: var(--red); animation: cue 2s ease-in-out infinite; }
@keyframes cue { to { top: 100%; } }

/* ---------------------------------------------------------
   BOOK COVER (hero, shelf, book page)
--------------------------------------------------------- */
.cover {
    --cover-color: #4a3a2c;
    position: relative; display: block; aspect-ratio: 3 / 4.25; text-decoration: none;
    transform-style: preserve-3d;
    transform: perspective(1500px) rotateY(-16deg) rotateX(3deg);
    transition: transform .7s var(--ease);
}
.cover:hover, a:hover > .cover, a:focus-visible > .cover { transform: perspective(1500px) rotateY(-6deg) rotateX(1deg) translateY(-6px); }
.cover-pages {
    position: absolute; top: 1.6%; bottom: 1.6%; right: -3.5%; width: 7%;
    border-radius: 0 4px 4px 0; transform: translateZ(-2px);
    background: repeating-linear-gradient(90deg, #f3ead6 0 1px, #d9cdb4 1px 2px);
    box-shadow: 6px 10px 26px rgba(0, 0, 0, .28);
}
.cover-face {
    position: absolute; inset: 0; border-radius: 3px 9px 9px 3px; overflow: hidden;
    display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
    padding: 16% 13%; color: #efe4cc;
    background:
        linear-gradient(90deg, rgba(0, 0, 0, .42), rgba(255, 255, 255, .1) 4.5%, rgba(0, 0, 0, .12) 7%, transparent 12%, transparent 94%, rgba(0, 0, 0, .2)),
        var(--cover-image, linear-gradient(transparent, transparent)) center / cover no-repeat,
        var(--mottle),
        var(--cover-color);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06), 18px 28px 40px rgba(0, 0, 0, .32);
}
.cover-face::before {
    content: ""; position: absolute; inset: 7% 8% 7% 11%; border: 1px solid rgba(239, 228, 204, .32); pointer-events: none;
}
.cover.has-image .cover-face::before { display: none; }
.cover.has-image .cover-face > * { display: none; }
.cover-label { font-family: var(--type); font-size: clamp(8px, .75em, 11px); letter-spacing: .28em; text-transform: uppercase; opacity: .85; }
.cover-title { margin-top: 1.1em; font-family: var(--display); font-style: italic; font-weight: 500; font-size: 2.6em; line-height: .9; overflow-wrap: anywhere; }
.cover-rule { width: 30%; height: 1px; background: rgba(239, 228, 204, .45); margin: 1.6em 0 1.2em; }
.cover-author { font-family: var(--type); font-size: .72em; letter-spacing: .24em; text-transform: uppercase; }
.cover-ribbon { position: absolute; top: -2px; right: 18%; width: 14px; height: 22%; background: var(--red); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 86%, 0 100%); opacity: .9; }

/* ---------------------------------------------------------
   SECTIONS
--------------------------------------------------------- */
.section { position: relative; padding: clamp(84px, 10vw, 140px) 0; }
.section-alt { background-color: var(--paper-2); }
.section-dark { background: radial-gradient(ellipse at 50% 0%, #3a2f25, var(--desk) 70%); color: var(--cream); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; margin-bottom: clamp(40px, 5vw, 64px); }
.section-head .kicker { color: var(--red); margin-bottom: 18px; }
.section-dark .section-head .kicker { color: #e3a893; }
.section-title { font-family: var(--display); font-weight: 600; font-size: clamp(42px, 6vw, 82px); line-height: .92; letter-spacing: -.015em; }
.section-title em { font-weight: 500; color: var(--red); }
.section-dark .section-title em { color: #e3a893; }
.section-lead { margin-top: 18px; max-width: 520px; font-size: 19px; color: var(--ink-soft); }
.section-dark .section-lead { color: var(--cream-soft); }
.section-dark .hand-link { color: #e3a893; }

/* Optional photo banner at the top of a section (set from the dashboard) */
.section-banner {
    position: relative; height: clamp(200px, 30vw, 400px); margin-top: calc(-1 * clamp(84px, 10vw, 140px)); margin-bottom: clamp(60px, 7vw, 100px);
    background: var(--banner) center / cover no-repeat;
    clip-path: polygon(0 0, 100% 0, 100% 92%, 96% 95%, 91% 92.5%, 85% 96%, 78% 93%, 70% 96.5%, 62% 93.5%, 54% 96%, 46% 92.8%, 38% 96%, 30% 93%, 22% 96.5%, 14% 93%, 7% 95.5%, 0 92.5%);
}
.section-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(36, 31, 25, .05), rgba(36, 31, 25, .35)); mix-blend-mode: multiply; }
.section-banner figcaption {
    position: absolute; z-index: 1; left: max(var(--gutter), calc((100% - 1180px) / 2)); bottom: 13%;
    font-family: var(--hand); font-size: 26px; color: #fff; text-shadow: 0 2px 12px rgba(0, 0, 0, .5); transform: rotate(-2deg);
}

/* Introduction */
.intro-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(50px, 7vw, 110px); align-items: center; }
.intro-photo { position: relative; justify-self: center; width: min(420px, 100%); transform: rotate(-2.5deg); }
.intro-frame {
    background: #fbf8f0; padding: 16px 16px 70px; box-shadow: 0 2px 3px rgba(0, 0, 0, .08), 18px 26px 50px rgba(36, 31, 25, .22);
}
.intro-frame img, .intro-placeholder { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; filter: sepia(.12) contrast(1.02); }
.intro-placeholder {
    display: grid; place-items: center;
    background: radial-gradient(circle at 50% 40%, #e9dec6, #cbbb9b); color: rgba(74, 58, 44, .55);
    font-family: var(--display); font-style: italic; font-size: 150px; line-height: 1;
}
.intro-photo figcaption { position: absolute; left: 0; right: 0; bottom: 18px; text-align: center; font-family: var(--hand); font-size: 28px; color: var(--ink-soft); }
.intro-photo::before, .intro-photo::after {
    content: ""; position: absolute; z-index: 2; width: 120px; height: 34px;
    background: rgba(226, 214, 186, .78); box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}
.intro-photo::before { top: -14px; left: -26px; transform: rotate(-32deg); }
.intro-photo::after { top: -14px; right: -26px; transform: rotate(30deg); }
.intro-greeting { font-family: var(--hand); font-size: clamp(38px, 4vw, 52px); color: var(--red); line-height: 1; transform: rotate(-2deg); margin: 26px 0 22px; }
.intro-text p { font-size: 20px; line-height: 1.75; color: var(--ink-soft); margin-bottom: 1em; }
.intro-text p:first-child::first-letter { float: left; font-family: var(--display); font-weight: 600; font-size: 4.1em; line-height: .78; padding: .06em .08em 0 0; color: var(--ink); }
.signature { font-family: var(--hand); font-size: 34px; color: var(--red); transform: rotate(-3deg); display: inline-block; margin-top: 6px; }

/* Bookshelf */
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 60px 44px; }
.shelf-item { text-decoration: none; display: block; }
.shelf-item .cover { width: 82%; font-size: 13px; }
.shelf-meta { margin-top: 28px; }
.shelf-no { font-family: var(--type); font-size: 11px; letter-spacing: .2em; color: var(--red); }
.shelf-title { font-family: var(--display); font-size: 30px; font-weight: 600; line-height: 1.05; margin-top: 6px; }
.shelf-sub { font-style: italic; color: var(--muted); margin-top: 2px; }
.shelf-stats { margin-top: 10px; font-family: var(--type); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.shelf-plank { height: 14px; margin-top: -36px; border-radius: 2px; background: linear-gradient(180deg, #8c6c4d, #5f4632); box-shadow: 0 12px 20px rgba(36, 31, 25, .25); position: relative; z-index: -1; }

/* Notebook cards */
.notes-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.note-card {
    position: relative; display: flex; flex-direction: column; text-decoration: none;
    background-color: var(--card);
    border: 1px solid var(--line); border-radius: 3px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 12px 30px rgba(36, 31, 25, .06);
    transition: transform .45s var(--ease), box-shadow .45s var(--ease);
}
.note-card:hover { transform: translateY(-6px) rotate(-.4deg); box-shadow: 0 24px 50px rgba(36, 31, 25, .14); }
.note-card-media { aspect-ratio: 16 / 10; overflow: hidden; border-bottom: 1px solid var(--line); background: var(--paper-2); }
.note-card-media img { width: 100%; height: 100%; object-fit: cover; filter: sepia(.35) saturate(.85); transition: filter .6s, transform .9s var(--ease); }
.note-card:hover .note-card-media img { filter: none; transform: scale(1.04); }
.note-card-body {
    flex: 1; display: flex; flex-direction: column; padding: 26px 26px 24px;
    background-image: repeating-linear-gradient(180deg, transparent 0 31px, rgba(154, 63, 47, .07) 31px 32px);
    background-position: 0 14px;
}
.note-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.note-card-label { font-family: var(--type); font-size: 11px; letter-spacing: .14em; color: var(--muted); }
.note-card h3 { margin-top: 22px; font-family: var(--display); font-weight: 600; font-size: 29px; line-height: 1.06; overflow-wrap: anywhere; }
.note-card p { margin-top: 12px; color: var(--ink-soft); font-size: 17px; line-height: 1.6; }
.note-card .read-more { margin-top: auto; padding-top: 22px; font-family: var(--hand); font-size: 24px; color: var(--red); }
.note-card .card-no { position: absolute; bottom: 30px; right: 26px; font-family: var(--type); font-size: 10.5px; letter-spacing: .14em; color: var(--muted); }

/* Random writes — paper slips pinned to the desk */
.scrap-wall { columns: 3 280px; column-gap: 30px; }
.scrap {
    break-inside: avoid; position: relative; margin: 0 0 30px; padding: 34px 28px 22px;
    background-color: #fbf6e9; background-image: repeating-linear-gradient(180deg, transparent 0 29px, rgba(47, 74, 107, .12) 29px 30px);
    color: var(--ink); box-shadow: 0 2px 2px rgba(0, 0, 0, .12), 10px 16px 28px rgba(0, 0, 0, .28);
    transform: rotate(var(--tilt, 0deg)); transition: transform .45s var(--ease);
}
.scrap:hover { transform: rotate(0deg) scale(1.02); }
.scrap::before {
    content: ""; position: absolute; top: 12px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #e57a63, var(--red) 55%, #5d2318); box-shadow: 2px 3px 4px rgba(0, 0, 0, .35);
}
.scrap blockquote { font-family: var(--hand); font-size: 29px; line-height: 1.05; white-space: pre-line; overflow-wrap: anywhere; }
.scrap figcaption { margin-top: 16px; font-family: var(--type); font-size: 11px; letter-spacing: .2em; color: var(--muted); text-transform: uppercase; }
.view-archive .scrap-wall .scrap { background-color: #fbf6ea; }

/* Footer */
.site-footer { position: relative; background: var(--desk); background-image: var(--mottle); color: var(--cream); padding: clamp(80px, 9vw, 120px) 0 30px; }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr .8fr; gap: 50px; padding-bottom: 60px; border-bottom: 1px solid rgba(238, 227, 205, .14); }
.footer-sign { font-family: var(--hand); font-size: clamp(54px, 7vw, 96px); line-height: .9; color: var(--cream); transform: rotate(-2deg); }
.footer-sign em { font-style: normal; color: #e3a893; }
.footer-title { font-family: var(--type); font-size: 11.5px; letter-spacing: .26em; text-transform: uppercase; color: #e3a893; margin-bottom: 18px; }
.footer-text { color: var(--cream-soft); max-width: 320px; margin-bottom: 22px; }
.footer-links { list-style: none; display: grid; gap: 8px; }
.footer-links a { text-decoration: none; color: var(--cream-soft); transition: color .2s; }
.footer-links a:hover { color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-top: 26px; font-family: var(--type); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: rgba(238, 227, 205, .5); }
body.view-is-reader .site-footer { display: none; }

/* ---------------------------------------------------------
   ARCHIVE VIEW
--------------------------------------------------------- */
.archive-head { position: relative; isolation: isolate; padding: calc(var(--nav-h) + 70px) 0 48px; overflow: hidden; }
.archive-head.has-image { color: var(--cream); }
.archive-head.has-image::before { content: ""; position: absolute; inset: 0; z-index: -2; background: var(--banner) center / cover no-repeat; }
.archive-head.has-image::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(22, 17, 12, .82), rgba(22, 17, 12, .5)); }
.archive-head-grid { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; }
.archive-title { font-family: var(--display); font-size: clamp(70px, 12vw, 170px); font-weight: 600; line-height: .82; letter-spacing: -.03em; }
.archive-title span { display: block; margin-top: 14px; font-family: var(--hand); font-size: 30px; font-weight: 500; letter-spacing: 0; color: var(--red); transform: rotate(-2deg); }
.archive-head.has-image .archive-title span { color: #e3a893; }
.archive-meta { text-align: right; font-family: var(--type); font-size: 12px; letter-spacing: .16em; line-height: 2; text-transform: uppercase; opacity: .75; }
.archive-search { position: relative; margin-top: 46px; max-width: 640px; }
.archive-search svg { position: absolute; left: 0; top: 50%; transform: translateY(-50%); opacity: .6; }
.archive-search input {
    width: 100%; padding: 14px 40px 14px 34px; border: 0; border-bottom: 1.5px solid currentColor; background: transparent;
    font-family: var(--serif); font-size: 22px; font-style: italic; outline: none;
}
.archive-search input::placeholder { color: inherit; opacity: .55; }
.archive-search input:focus { border-bottom-color: var(--red); }
.archive-search .clear { position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%; font-size: 20px; line-height: 1; }
.archive-search .clear:hover { background: rgba(0, 0, 0, .08); }

.tabs-bar { position: sticky; top: var(--nav-h); z-index: 20; background-color: var(--paper); background-image: var(--mottle); box-shadow: 0 1px 0 var(--line-strong); }
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-top: 14px; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
    position: relative; flex-shrink: 0; padding: 13px 22px 12px; border: 1px solid var(--line-strong); border-bottom: 0;
    border-radius: 9px 9px 0 0; background: var(--paper-2);
    font-family: var(--type); font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
    transition: background-color .2s, color .2s;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { background: var(--paper); color: var(--ink); margin-bottom: -1px; padding-bottom: 13px; }
.tab[aria-selected="true"]::before { content: ""; position: absolute; top: -1px; left: 14px; right: 14px; height: 3px; background: var(--red); border-radius: 0 0 3px 3px; }
.tab .count { margin-left: 8px; color: var(--red); }
.archive-body { padding: 56px 0 120px; min-height: 60vh; }
.panel[hidden] { display: none; }

/* Catalogue (episodes index) */
.catalogue-book { margin-bottom: 70px; }
.catalogue-book-head { display: flex; align-items: baseline; gap: 16px; padding-bottom: 14px; border-bottom: 2px solid var(--ink); }
.catalogue-book-head h3 { font-family: var(--display); font-weight: 600; font-size: 40px; line-height: 1; }
.catalogue-book-head a { margin-left: auto; }
.catalogue-part { display: flex; align-items: center; gap: 16px; margin: 34px 0 6px; }
.catalogue-part span { font-family: var(--type); font-size: 11.5px; letter-spacing: .2em; color: var(--red); text-transform: uppercase; }
.catalogue-part strong { font-family: var(--display); font-size: 25px; font-weight: 600; }
.catalogue-part i { flex: 1; height: 1px; background: var(--line); }
.cat-row {
    display: grid; grid-template-columns: 90px 1fr auto 40px; align-items: center; gap: 24px;
    padding: 22px 14px; border-bottom: 1px solid var(--line); text-decoration: none;
    transition: background-color .25s, padding-left .35s var(--ease);
}
.cat-row:hover { background: rgba(255, 255, 255, .35); padding-left: 26px; }
.cat-no { font-family: var(--type); font-size: 12px; letter-spacing: .14em; color: var(--muted); }
.cat-no b { display: block; font-family: var(--display); font-size: 34px; font-weight: 600; letter-spacing: 0; color: var(--ink); line-height: 1; }
.cat-title, .cat-desc { display: block; }
.cat-title { font-family: var(--display); font-size: 28px; font-weight: 600; line-height: 1.1; }
.cat-desc { margin-top: 4px; color: var(--muted); font-size: 17px; }
.cat-pages { font-family: var(--type); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.cat-arrow { font-family: var(--hand); font-size: 30px; color: var(--red); transition: transform .3s var(--ease); }
.cat-row:hover .cat-arrow { transform: translateX(6px); }

.filter-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 36px; }
.filter-row > span { font-family: var(--type); font-size: 11.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-right: 6px; }
.chip {
    padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line-strong);
    font-family: var(--type); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; transition: all .2s;
}
.chip:hover, .chip.is-active { background: var(--ink); color: var(--paper-light); border-color: var(--ink); }

.results-group { margin-bottom: 50px; }
.results-group h3 { font-family: var(--type); font-size: 12px; letter-spacing: .24em; text-transform: uppercase; color: var(--red); padding-bottom: 12px; border-bottom: 1px solid var(--line-strong); }
.result { display: block; padding: 18px 4px; border-bottom: 1px solid var(--line); text-decoration: none; transition: padding-left .3s var(--ease); }
.result:hover { padding-left: 14px; }
.result strong { display: block; font-family: var(--display); font-size: 25px; font-weight: 600; line-height: 1.15; }
.result span { color: var(--muted); font-size: 16px; }
.result mark { background: rgba(154, 63, 47, .18); color: inherit; border-radius: 2px; padding: 0 2px; }

/* ---------------------------------------------------------
   BOOK DETAIL VIEW
--------------------------------------------------------- */
.book-detail { padding: calc(var(--nav-h) + 60px) 0 120px; }
.back-link { display: inline-flex; gap: 10px; margin-bottom: 44px; font-family: var(--type); font-size: 12px; letter-spacing: .18em; text-transform: uppercase; text-decoration: none; color: var(--muted); }
.back-link:hover { color: var(--red); }
.book-detail-grid { display: grid; grid-template-columns: 380px 1fr; gap: clamp(50px, 7vw, 100px); align-items: start; }
.book-detail-cover { position: sticky; top: calc(var(--nav-h) + 40px); }
.book-detail-cover .cover { width: 100%; font-size: 16px; }
.book-detail h1 { font-family: var(--display); font-weight: 600; font-size: clamp(52px, 7vw, 96px); line-height: .9; letter-spacing: -.02em; margin-top: 16px; }
.book-detail .subtitle { font-family: var(--display); font-style: italic; font-size: 28px; color: var(--muted); margin-top: 8px; }
.book-detail .description { margin-top: 24px; max-width: 580px; font-size: 20px; color: var(--ink-soft); }
.book-stats { display: flex; gap: 34px; margin: 34px 0; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.book-stats div { font-family: var(--type); font-size: 11.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.book-stats b { display: block; font-family: var(--display); font-size: 38px; color: var(--ink); letter-spacing: 0; line-height: 1; }
.toc { margin-top: 56px; }
.toc h2 { font-family: var(--type); font-size: 12px; letter-spacing: .26em; text-transform: uppercase; color: var(--red); margin-bottom: 10px; }

/* ---------------------------------------------------------
   NOTE (BLOG POST) VIEW
--------------------------------------------------------- */
.note-view { padding: calc(var(--nav-h) + 60px) 0 120px; }
.note-article { width: min(760px, calc(100% - 2 * var(--gutter))); margin: 0 auto; }
.note-header { text-align: center; }
.note-header .note-card-label { display: block; margin-top: 22px; }
.note-header h1 { margin-top: 18px; font-family: var(--display); font-weight: 600; font-size: clamp(44px, 6.5vw, 84px); line-height: .95; letter-spacing: -.015em; }
.note-date { margin-top: 18px; font-family: var(--hand); font-size: 26px; color: var(--red); }
.note-cover { margin: 50px calc(-1 * min(120px, 8vw)) 0; }
.note-cover img { width: 100%; max-height: 560px; object-fit: cover; border-radius: 3px; box-shadow: 0 30px 60px rgba(36, 31, 25, .18); }
.note-lede { margin-top: 50px; font-family: var(--display); font-style: italic; font-size: clamp(25px, 2.6vw, 31px); line-height: 1.4; color: var(--ink); text-align: center; }
.note-lede::after { content: "❦"; display: block; margin-top: 30px; font-style: normal; font-size: 22px; color: var(--red); }
.note-body { margin-top: 30px; font-size: 21px; line-height: 1.85; color: #2f2922; }
.note-body p { margin-bottom: 1.15em; }
.note-body > p:first-child::first-letter { float: left; font-family: var(--display); font-weight: 600; font-size: 4em; line-height: .78; padding: .06em .08em 0 0; color: var(--red); }
.note-body blockquote { margin: 1.6em 0; padding-left: 1.2em; border-left: 2px solid var(--red); font-family: var(--display); font-style: italic; font-size: 1.25em; line-height: 1.5; }
.note-body hr { border: 0; text-align: center; margin: 2em 0; }
.note-body hr::after { content: "* * *"; letter-spacing: .6em; color: var(--muted); }
.note-sign { margin-top: 40px; text-align: right; }
.note-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 80px; padding-top: 30px; border-top: 1px solid var(--line-strong); }
.note-nav a { text-decoration: none; display: block; }
.note-nav a:last-child { text-align: right; }
.note-nav small { font-family: var(--type); font-size: 11.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.note-nav strong { display: block; font-family: var(--display); font-size: 25px; font-weight: 600; line-height: 1.15; margin-top: 4px; }
.note-nav a:hover strong { color: var(--red); }

/* ---------------------------------------------------------
   READER
--------------------------------------------------------- */
.view-reader {
    min-height: 100vh; min-height: 100svh; overflow: hidden;
    display: none; flex-direction: column; padding: 14px 24px 16px;
    color: var(--cream);
    background:
        radial-gradient(ellipse at 50% 42%, rgba(120, 92, 62, .55), transparent 62%),
        var(--mottle),
        linear-gradient(180deg, #2b231c, #18130f);
}
.view-reader.is-active { display: flex; }
.reader-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; min-height: 56px; }
.reader-back { justify-self: start; display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--type); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; opacity: .85; padding: 10px 0; }
.reader-back:hover { opacity: 1; color: #e3a893; }
.reader-where { text-align: center; min-width: 0; }
.reader-where strong { display: block; font-family: var(--display); font-style: italic; font-weight: 500; font-size: 24px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-where span { display: block; font-family: var(--type); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; opacity: .65; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-tools { justify-self: end; display: flex; gap: 8px; }
#readerSize { text-transform: none; font-family: var(--display); font-size: 18px; letter-spacing: 0; }
.reader-tool {
    height: 42px; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(238, 227, 205, .28);
    font-family: var(--type); font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
    transition: background-color .2s, border-color .2s;
}
.reader-tool:hover { background: rgba(238, 227, 205, .1); border-color: rgba(238, 227, 205, .6); }

.book-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 14px 0; }
.book {
    --page-fs: clamp(14px, 1.18vw, 18px);
    position: relative; display: flex;
    width: min(1240px, 94vw, calc((100svh - 180px) * 1.5));
    aspect-ratio: 3 / 2;
    perspective: 2600px;
    user-select: none; -webkit-user-select: none;
}
.book-shadow { position: absolute; left: 1%; right: 1%; top: 4%; bottom: -3%; background: rgba(0, 0, 0, .55); filter: blur(28px); border-radius: 12px; pointer-events: none; }
.page {
    position: relative; width: 50%; height: 100%; overflow: hidden;
    background-color: var(--page);
    color: #2b251e;
}
.page::before { /* paper grain + gutter shading */
    content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
    background-image: var(--noise), var(--mottle);
    opacity: .28; mix-blend-mode: multiply;
}
.page-left {
    border-radius: 5px 0 0 5px;
    background-image: linear-gradient(270deg, rgba(60, 40, 20, .2), rgba(60, 40, 20, .05) 5%, transparent 13%, transparent 96%, rgba(60, 40, 20, .06));
    box-shadow: -1px 1px 0 #d8cbb0, -2px 2px 0 #f2e9d6, -3px 3px 0 #d6c8ab, -4px 4px 0 #efe5cf, -5px 5px 0 #cfc0a2;
}
.page-right {
    border-radius: 0 5px 5px 0;
    background-image: linear-gradient(90deg, rgba(60, 40, 20, .22), rgba(60, 40, 20, .05) 5%, transparent 13%, transparent 96%, rgba(60, 40, 20, .06));
    box-shadow: 1px 1px 0 #d8cbb0, 2px 2px 0 #f2e9d6, 3px 3px 0 #d6c8ab, 4px 4px 0 #efe5cf, 5px 5px 0 #cfc0a2;
}
.page-content {
    position: absolute; inset: 0; z-index: 2; overflow-y: auto; overflow-x: hidden;
    padding: 9% 10% 12%;
    scrollbar-width: thin; scrollbar-color: rgba(60, 40, 20, .25) transparent;
}
.page-left .page-content { padding-right: 11%; }
.page-right .page-content { padding-left: 11%; }
.folio { position: absolute; z-index: 3; bottom: 4.6%; font-family: var(--type); font-size: 11px; letter-spacing: .14em; color: var(--muted); }
.page-left .folio { left: 10%; }
.page-right .folio { right: 10%; }
.running-head { position: absolute; z-index: 3; top: 4.2%; left: 0; right: 0; text-align: center; font-family: var(--type); font-size: 10px; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); opacity: .8; }
.page-shade { position: absolute; inset: 0; z-index: 4; pointer-events: none; opacity: 0; }
.page-right .page-shade { background: linear-gradient(90deg, rgba(20, 12, 4, .55), rgba(20, 12, 4, .15) 60%, rgba(20, 12, 4, .05)); }
.page-left .page-shade { background: linear-gradient(270deg, rgba(20, 12, 4, .55), rgba(20, 12, 4, .15) 60%, rgba(20, 12, 4, .05)); }
.spine { position: absolute; z-index: 6; top: 0; bottom: 0; left: 50%; width: 46px; transform: translateX(-50%); pointer-events: none; background: linear-gradient(90deg, transparent, rgba(40, 24, 10, .12) 40%, rgba(40, 24, 10, .26) 50%, rgba(40, 24, 10, .12) 60%, transparent); }

/* Page-corner curl hints */
.page-right::after, .page-left::after {
    content: ""; position: absolute; z-index: 5; bottom: 0; width: 0; height: 0; pointer-events: none;
    transition: width .35s var(--ease), height .35s var(--ease);
}
.page-right::after { right: 0; background: linear-gradient(315deg, transparent 50%, #e2d6bd 50%, #fbf5e8 75%); box-shadow: -4px -4px 10px rgba(0, 0, 0, .12); border-top-left-radius: 4px; }
.page-left::after { left: 0; background: linear-gradient(45deg, transparent 50%, #e2d6bd 50%, #fbf5e8 75%); box-shadow: 4px -4px 10px rgba(0, 0, 0, .12); border-top-right-radius: 4px; }
.book.can-next .page-right:hover::after, .book.can-prev .page-left:hover::after { width: 44px; height: 44px; }
.book.can-next .page-right, .book.can-prev .page-left { cursor: pointer; }

/* The turning leaf */
.leaf { position: absolute; top: 0; z-index: 10; width: 50%; height: 100%; transform-style: preserve-3d; will-change: transform; pointer-events: none; }
.leaf.is-next { left: 50%; transform-origin: 0 50%; }
.leaf.is-prev { left: 0; transform-origin: 100% 50%; }
.leaf-face { position: absolute; inset: 0; width: 100%; height: 100%; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.leaf-face.page { position: absolute; width: 100%; box-shadow: none; }
.leaf-back { transform: rotateY(180deg); }

/* Single page (phones / narrow screens) */
.book.is-single { width: min(600px, 100%, calc((100svh - 170px) * .74)); aspect-ratio: .74; perspective: 1700px; }
.book.is-single .page-left, .book.is-single .spine { display: none; }
.book.is-single .page-right { width: 100%; border-radius: 4px 6px 6px 4px; background-image: linear-gradient(90deg, rgba(60, 40, 20, .14), transparent 6%, transparent 96%, rgba(60, 40, 20, .06)); }
.book.is-single .leaf { left: 0; width: 100%; transform-origin: 0 50%; }
.book.is-single .page-content { padding: 11% 9% 15%; }

/* Special pages */
.quote-page, .photo-page, .blank-page, .title-page, .end-page {
    position: relative; min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
    font-size: calc(var(--page-fs) * var(--page-scale, 1));
}
.quote-mark { font-family: var(--display); font-size: 5em; line-height: .6; color: #9a3f2f; opacity: .6; height: .5em; }
.quote-text { max-width: 15em; font-family: var(--display); font-style: italic; font-weight: 500; font-size: 1.85em; line-height: 1.35; color: #2b251e; }
.quote-author { margin-top: 1.4em; font-family: var(--hand); font-size: 1.6em; color: #9a3f2f; }
.photo-page figure { width: 86%; padding: 4% 4% 13%; background: #fdfaf3; box-shadow: 0 2px 2px rgba(0, 0, 0, .08), 8px 14px 26px rgba(40, 24, 10, .22); transform: rotate(-2.4deg); position: relative; }
.photo-page img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.photo-page .photo-empty { width: 100%; aspect-ratio: 4 / 3; background: linear-gradient(135deg, #cdbfa2, #9c8d74); }
.photo-page figcaption { position: absolute; left: 0; right: 0; bottom: 3%; font-family: var(--hand); font-size: 1.5em; color: #4a4238; }
.photo-page figure::before { content: ""; position: absolute; top: -12px; left: 50%; width: 90px; height: 26px; margin-left: -45px; background: rgba(226, 214, 186, .82); transform: rotate(-3deg); }
.title-page .t-label { font-family: var(--type); font-size: .66em; letter-spacing: .3em; text-transform: uppercase; color: #7d7262; }
.title-page .t-title { margin-top: .5em; font-family: var(--display); font-style: italic; font-weight: 500; font-size: 3.4em; line-height: .9; color: #211c16; }
.title-page .t-sub { margin-top: .6em; font-family: var(--display); font-size: 1.3em; color: #4a4238; }
.title-page .t-rule { width: 3.5em; height: 1px; background: #9a3f2f; margin: 1.8em auto; opacity: .7; }
.title-page .t-author { font-family: var(--hand); font-size: 1.9em; color: #9a3f2f; }
.title-page .t-desc { margin-top: 1.6em; max-width: 18em; font-style: italic; color: #6a6052; }
.end-page .e-orn, .blank-page .e-orn { font-size: 1.6em; color: #9a3f2f; opacity: .7; }
.end-page .e-label, .blank-page .e-label { margin-top: 1em; font-family: var(--type); font-size: .66em; letter-spacing: .28em; text-transform: uppercase; color: #7d7262; }
.end-page .e-title { margin-top: .5em; font-family: var(--display); font-style: italic; font-size: 2em; line-height: 1.1; color: #211c16; max-width: 12em; }
.end-page .e-hint { margin-top: 1.4em; font-family: var(--hand); font-size: 1.5em; color: #9a3f2f; }

.reader-bottom { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; padding-top: 6px; }
.turn { font-family: var(--hand); font-size: 28px; line-height: 1; padding: 8px 4px; opacity: .9; transition: opacity .2s, transform .3s var(--ease); }
.turn:hover:not(:disabled) { opacity: 1; color: #e3a893; }
.turn.prev { justify-self: start; }
.turn.next { justify-self: end; }
.turn.prev:hover:not(:disabled) { transform: translateX(-4px); }
.turn.next:hover:not(:disabled) { transform: translateX(4px); }
.turn:disabled { opacity: .25; cursor: default; }
.reader-status { text-align: center; min-width: 200px; }
.reader-pages { font-family: var(--type); font-size: 12px; letter-spacing: .2em; }
.reader-progress { width: 220px; height: 2px; margin: 10px auto 0; background: rgba(238, 227, 205, .16); border-radius: 2px; overflow: hidden; }
.reader-progress span { display: block; height: 100%; width: 0; background: #e3a893; transition: width .6s var(--ease); }
.reader-hint { margin-top: 6px; font-family: var(--hand); font-size: 18px; opacity: .45; }

/* Contents drawer */
.toc-drawer { position: fixed; inset: 0; z-index: 200; visibility: hidden; }
.toc-drawer.is-open { visibility: visible; }
.toc-backdrop { position: absolute; inset: 0; background: rgba(10, 8, 6, .55); opacity: 0; transition: opacity .35s; }
.toc-drawer.is-open .toc-backdrop { opacity: 1; }
.toc-panel {
    position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 92vw); overflow-y: auto;
    background-color: var(--paper); background-image: var(--mottle); color: var(--ink);
    padding: 30px 30px 40px; transform: translateX(100%); transition: transform .45s var(--ease);
    box-shadow: -20px 0 50px rgba(0, 0, 0, .35);
}
.toc-drawer.is-open .toc-panel { transform: none; }
.toc-panel header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 18px; border-bottom: 2px solid var(--ink); }
.toc-panel h2 { font-family: var(--display); font-size: 36px; font-weight: 600; line-height: 1; }
.toc-close { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line-strong); font-size: 22px; line-height: 1; }
.toc-part { margin-top: 26px; font-family: var(--type); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--red); }
.toc-part b { display: block; font-family: var(--display); font-size: 21px; letter-spacing: 0; text-transform: none; color: var(--ink); font-weight: 600; }
.toc-ep { display: grid; grid-template-columns: 44px 1fr; gap: 10px; width: 100%; text-align: left; padding: 12px 6px; border-bottom: 1px solid var(--line); transition: background-color .2s; }
.toc-ep:hover { background: rgba(255, 255, 255, .4); }
.toc-ep.is-current { background: rgba(154, 63, 47, .08); }
.toc-ep.is-current .toc-ep-title { color: var(--red); }
.toc-ep-no { font-family: var(--type); font-size: 12px; color: var(--muted); padding-top: 3px; }
.toc-ep-title { font-family: var(--display); font-size: 21px; font-weight: 600; line-height: 1.15; }

/* ---------------------------------------------------------
   RESPONSIVE
--------------------------------------------------------- */
@media (max-width: 1180px) {
    :root { --gutter: 64px; }
    .nav-links a { padding: 10px 10px; letter-spacing: .1em; }
    .nav-links a::after { left: 10px; right: 10px; }
    .nav-inner { gap: 22px; }
}
@media (max-width: 1080px) {
    :root { --gutter: 32px; --nav-h: 72px; }
    .nav-links, .find-rail, .nav-cta { display: none; }
    .nav-toggle { display: block; }
    .hero-inner { grid-template-columns: 1fr 300px; gap: 40px; }
    .notes-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-top { grid-template-columns: 1fr 1fr; }
    .footer-top > :first-child { grid-column: 1 / -1; }
    .book-detail-grid { grid-template-columns: 300px 1fr; }
}
@media (max-width: 820px) {
    body { font-size: 17px; }
    .hero-inner { grid-template-columns: 1fr; padding: 20px 0 50px; }
    .hero-book { order: -1; }
    .hero-book-wrap { width: 210px; }
    .hero-book .cover { font-size: 10px; }
    .hero-book-note { display: none; }
    .hero-text { margin-top: 28px; font-size: 19px; }
    .hero-index { grid-template-columns: repeat(2, 1fr); }
    .hero-index .scroll-cue { display: none; }
    .hero-index a { padding: 14px 10px 16px 0; }
    .hero-index b { font-size: 32px; }
    .section-head { flex-direction: column; align-items: flex-start; gap: 18px; }
    .intro-grid { grid-template-columns: 1fr; }
    .intro-photo { width: min(330px, 86%); }
    .shelf { grid-template-columns: repeat(2, 1fr); gap: 50px 24px; }
    .shelf-title { font-size: 24px; }
    .archive-head-grid { flex-direction: column; align-items: flex-start; }
    .archive-meta { text-align: left; }
    .cat-row { grid-template-columns: 58px 1fr 26px; gap: 14px; padding: 18px 6px; }
    .cat-row:hover { padding-left: 12px; }
    .cat-pages { display: none; }
    .cat-no b { font-size: 26px; }
    .cat-title { font-size: 23px; }
    .book-detail-grid { grid-template-columns: 1fr; }
    .book-detail-cover { position: static; width: min(260px, 70%); margin: 0 auto; }
    .note-cover { margin: 40px 0 0; }
    .note-body { font-size: 19px; }
    .reader-tool .label { display: none; }
}
@media (max-width: 640px) {
    :root { --gutter: 16px; --nav-h: 66px; }
    .nav-inner { width: calc(100% - 32px); }
    .brand-stamp { width: 40px; height: 40px; font-size: 21px; }
    .brand-name { font-size: 27px; }
    .hero-title { font-size: clamp(58px, 18vw, 92px); }
    .hero-quote { font-size: 26px; }
    .hero-actions .btn { flex: 1 1 100%; }
    .notes-grid { grid-template-columns: 1fr; }
    .scrap-wall { columns: 1; }
    .footer-top { grid-template-columns: 1fr; gap: 36px; }
    .tab { padding: 11px 15px 10px; font-size: 11.5px; }
    .tab[aria-selected="true"] { padding-bottom: 11px; }
    .catalogue-book-head { flex-wrap: wrap; }
    .catalogue-book-head h3 { font-size: 32px; }
    .catalogue-book-head a { margin-left: 0; }
    .book-stats { gap: 22px; }
    .note-nav { grid-template-columns: 1fr; }
    .note-nav a:last-child { text-align: left; }
    .view-reader { padding: 8px 12px 10px; }
    .book.is-single { aspect-ratio: .64; width: min(100%, calc((100svh - 150px) * .64)); }
    .reader-top { grid-template-columns: auto 1fr auto; gap: 10px; min-height: 50px; }
    .reader-back .label { display: none; }
    .reader-where strong { font-size: 19px; }
    .reader-where span { font-size: 10px; letter-spacing: .12em; }
    .reader-tool { height: 38px; padding: 0 12px; }
    .reader-status { min-width: 0; }
    .reader-progress { width: 120px; }
    .reader-hint { display: none; }
    .turn { font-size: 24px; }
    .turn .label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
    .js .reveal { opacity: 1; translate: none; }
}
