/* ===================================================================
   p9.rs -- A horizontal scrolling codex
   Palette: Aged Vellum / Foxed Page / Lamp Black / Sepia / Gilt /
            Verdigris / Cordovan / Red Ochre
   Type:    Playfair Display, Source Serif 4, Libre Franklin
   =================================================================== */

:root {
    --c-bg:        #F4ECDF; /* Aged Vellum */
    --c-bg-alt:    #E8DDD0; /* Foxed Page  */
    --c-ink:       #2C2418; /* Lamp Black  */
    --c-sepia:     #6B5D4F; /* Sepia Margin */
    --c-gilt:      #C4A47A; /* Gilt Edge   */
    --c-verdigris: #7B9E87; /* Verdigris   */
    --c-cordovan:  #8E6F5E; /* Cordovan    */
    --c-ochre:     #D4725C; /* Red Ochre   */

    --f-display: 'Playfair Display', 'Playfair Display SC', Georgia, serif;
    --f-serif:   'Source Serif 4', 'Source Serif Pro', Georgia, serif;
    --f-sans:    'Libre Franklin', 'Inter', system-ui, sans-serif;

    --header-h: 60px;
    --index-h:  44px;
    --gutter-w: 80px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    width: 100%;
    background: var(--c-bg);
    color: var(--c-ink);
    font-family: var(--f-serif);
    font-size: 18px;
    line-height: 1.75;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'liga' 1, 'kern' 1, 'calt' 1;
}

body {
    position: relative;
}

/* ===== Paper grain texture (background layer, parallax 0.3:1) ===== */
.paper-grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.17 0 0 0 0 0.14 0 0 0 0 0.09 0 0 0 0.09 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
    background-size: 220px 220px;
    mix-blend-mode: multiply;
}

/* ===== Golden-hour radial wash ===== */
.golden-hour {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background: radial-gradient(ellipse at 85% 15%, rgba(196,164,122,0.22) 0%, rgba(196,164,122,0.08) 30%, transparent 60%);
    animation: drift 32s ease-in-out infinite alternate;
}

@keyframes drift {
    0%   { background-position: 85% 15%; transform: translate(0,0); }
    100% { background-position: 78% 22%; transform: translate(-12px, 8px); }
}

/* ===== Header band ===== */
.header-band {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-h);
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 36px;
    background: linear-gradient(to bottom, rgba(244,236,223,0.96), rgba(244,236,223,0.82) 80%, rgba(244,236,223,0));
    border-bottom: 1px solid rgba(196,164,122,0.4);
}

.header-mark {
    font-family: var(--f-display);
    font-variant: small-caps;
    font-weight: 700;
    letter-spacing: 0.18em;
    font-size: 16px;
    color: var(--c-ink);
}

.header-progress {
    font-family: var(--f-sans);
    font-weight: 300;
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--c-sepia);
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.progress-current {
    color: var(--c-ochre);
    font-family: var(--f-display);
    font-variant: small-caps;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.05em;
    min-width: 28px;
    text-align: center;
    transition: color 300ms ease;
}

.progress-total {
    color: var(--c-gilt);
    font-family: var(--f-display);
    font-variant: small-caps;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.05em;
}

.progress-sep {
    font-style: italic;
    text-transform: lowercase;
    letter-spacing: 0;
}

/* ===== Codex container (horizontal scroll) ===== */
.codex {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow-x: scroll;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    z-index: 10;
    /* hide native scrollbar but keep functional */
    scrollbar-width: none;
}

.codex::-webkit-scrollbar { display: none; }

/* Parallax background layers */
.parallax-bg, .parallax-mid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    will-change: transform;
    z-index: 2;
}

.parallax-bg {
    background-image:
        repeating-linear-gradient(90deg,
            transparent 0,
            transparent 119px,
            rgba(110,93,79,0.05) 120px,
            transparent 121px,
            transparent 240px);
}

.parallax-mid {
    z-index: 3;
}

.rule-line {
    position: absolute;
    left: 0;
    width: 400vw;
    height: 1px;
    background: linear-gradient(to right,
        transparent 0%,
        rgba(110,93,79,0.16) 10%,
        rgba(110,93,79,0.12) 50%,
        rgba(110,93,79,0.16) 90%,
        transparent 100%);
}

.watermark {
    position: absolute;
    top: 8%;
    left: 30vw;
    font-family: var(--f-display);
    font-variant: small-caps;
    font-weight: 400;
    font-size: 200px;
    letter-spacing: 0.25em;
    color: rgba(110,93,79,0.05);
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
}

/* ===== Folios (the lateral strip) ===== */
.folios {
    position: relative;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    height: 100vh;
    width: max-content;
    z-index: 10;
}

.folio {
    flex: 0 0 100vw;
    width: 100vw;
    height: 100vh;
    position: relative;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: grid;
    grid-template-columns: var(--gutter-w) 1fr var(--gutter-w);
    align-items: stretch;
    overflow: hidden;
}

.folio-inner {
    position: relative;
    height: 100%;
    width: 100%;
    padding: calc(var(--header-h) + 28px) 56px calc(var(--index-h) + 32px);
    display: flex;
    flex-direction: column;
}

/* Gutter (book spine) */
.gutter {
    position: relative;
    width: var(--gutter-w);
    height: 100%;
}

.gutter::before {
    content: '';
    position: absolute;
    top: 12%;
    bottom: 12%;
    left: 50%;
    width: 1px;
    background: linear-gradient(to bottom,
        transparent 0%,
        rgba(196,164,122,0.55) 18%,
        rgba(196,164,122,0.55) 82%,
        transparent 100%);
}

.gutter-right::before {
    background: linear-gradient(to bottom,
        transparent 0%,
        rgba(196,164,122,0.55) 18%,
        rgba(196,164,122,0.55) 82%,
        transparent 100%);
}

/* Folio number (upper right) */
.folio-num {
    position: absolute;
    top: calc(var(--header-h) + 16px);
    right: 56px;
    display: flex;
    align-items: center;
    gap: 14px;
    font-family: var(--f-display);
    font-variant: small-caps;
    font-weight: 700;
    color: var(--c-gilt);
    letter-spacing: 0.12em;
    font-size: 14px;
}

.folio-num span {
    display: inline-block;
}

.folio-rule {
    display: inline-block;
    width: 80px;
    height: 1px;
    background: var(--c-gilt);
}

/* Folio foot (catchword) */
.folio-foot {
    position: absolute;
    bottom: calc(var(--index-h) + 18px);
    right: 56px;
    display: flex;
    align-items: baseline;
    gap: 10px;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 500ms ease 1000ms, transform 500ms ease 1000ms;
}

.folio.is-active .folio-foot {
    opacity: 1;
    transform: translateX(0);
}

.catchword-label {
    font-family: var(--f-sans);
    font-weight: 300;
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--c-sepia);
}

.catchword {
    font-family: var(--f-serif);
    font-style: italic;
    font-size: 13px;
    color: var(--c-cordovan);
}

/* ===== Slide-reveal base state ===== */
.folio .recto,
.folio .verso,
.folio .title-main,
.folio .title-sub,
.folio .title-ornament,
.folio .marg-blocks,
.folio .marg-heading,
.folio .pull-quote,
.folio .colophon-block,
.folio .illus-stage,
.folio .ornament-frame,
.folio .constellation {
    opacity: 0;
    transform: translateX(36px);
    transition:
        opacity 600ms ease-out,
        transform 700ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.folio.is-active .recto         { opacity: 1; transform: translateX(0); transition-delay: 200ms; }
.folio.is-active .verso         { opacity: 1; transform: translateX(0); transition-delay: 480ms; }
.folio.is-active .title-ornament-top { opacity: 1; transform: translateX(0); transition-delay: 200ms; }
.folio.is-active .title-main    { opacity: 1; transform: translateX(0); transition-delay: 380ms; }
.folio.is-active .title-sub     { opacity: 1; transform: translateX(0); transition-delay: 620ms; }
.folio.is-active .title-ornament-bot { opacity: 1; transform: translateX(0); transition-delay: 760ms; }
.folio.is-active .marg-heading  { opacity: 1; transform: translateX(0); transition-delay: 200ms; }
.folio.is-active .marg-blocks   { opacity: 1; transform: translateX(0); transition-delay: 380ms; }
.folio.is-active .pull-quote    { opacity: 1; transform: translateX(0); transition-delay: 280ms; }
.folio.is-active .colophon-block{ opacity: 1; transform: translateX(0); transition-delay: 240ms; }
.folio.is-active .illus-stage   { opacity: 1; transform: translateX(0); transition-delay: 200ms; }
.folio.is-active .ornament-frame{ opacity: 1; transform: translateX(0); transition-delay: 600ms; }
.folio.is-active .constellation { opacity: 1; transform: translateX(0); transition-delay: 380ms; }

/* Marginalia stagger */
.marg-block {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 500ms ease-out, transform 500ms ease-out;
}
.folio.is-active .marg-block-a { opacity: 1; transform: translateY(0); transition-delay: 460ms; }
.folio.is-active .marg-block-b { opacity: 1; transform: translateY(0); transition-delay: 580ms; }
.folio.is-active .marg-block-c { opacity: 1; transform: translateY(0); transition-delay: 700ms; }
.folio.is-active .marg-block-d { opacity: 1; transform: translateY(0); transition-delay: 820ms; }

/* ===== SVG path-draw animation ===== */
.draw-path,
.constellation-line {
    stroke: var(--c-ink);
    fill: none;
    stroke-dasharray: var(--len, 1000);
    stroke-dashoffset: var(--len, 1000);
    transition: stroke-dashoffset 1000ms linear;
}

.constellation-line {
    stroke: var(--c-verdigris);
}

.crystal {
    stroke: var(--c-gilt);
}

.folio.is-active .draw-path,
.folio.is-active .constellation-line {
    stroke-dashoffset: 0;
}

.node-dot {
    fill: var(--c-ink);
    opacity: 0;
    transition: opacity 400ms ease;
}

.folio.is-active .node-dot {
    opacity: 1;
    transition-delay: 900ms;
}

/* SVG label text (drawn by JS as immediate fade-in) */
.diag-label {
    font-family: var(--f-sans);
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 0.08em;
    fill: var(--c-sepia);
    opacity: 0;
    transition: opacity 400ms ease;
}

.diag-letter {
    font-family: var(--f-display);
    font-style: italic;
    font-weight: 400;
    font-size: 14px;
    fill: var(--c-gilt);
    opacity: 0;
    transition: opacity 400ms ease;
}

.folio.is-active .diag-label,
.folio.is-active .diag-letter {
    opacity: 1;
    transition-delay: 1200ms;
}

/* ===== FOLIO I :: Title ===== */
.folio-title .folio-inner {
    align-items: center;
    justify-content: center;
    text-align: center;
}

.title-ornament {
    width: min(420px, 50vw);
    color: var(--c-cordovan);
    margin: 0 auto;
}

.title-ornament-top { margin-bottom: 36px; }
.title-ornament-bot { margin-top: 36px; }

.title-main {
    font-family: var(--f-display);
    font-weight: 700;
    color: var(--c-ink);
    line-height: 1.04;
    letter-spacing: -0.022em;
    font-size: clamp(56px, 8.4vw, 120px);
}

.title-line {
    display: block;
}

.title-line-2 {
    color: var(--c-cordovan);
    font-weight: 900;
    margin: 0.05em 0;
}

.title-line-2 em {
    font-style: italic;
    color: var(--c-ochre);
}

.title-sub {
    margin-top: 28px;
    font-family: var(--f-serif);
    font-style: italic;
    color: var(--c-sepia);
    font-size: 18px;
    max-width: 560px;
    line-height: 1.55;
}

/* ===== FOLIO II / V :: Text Folio (recto + verso) ===== */
.folio-text .folio-inner {
    display: grid;
    grid-template-columns: 61.8% 38.2%;
    gap: 0;
    padding: calc(var(--header-h) + 56px) 0 calc(var(--index-h) + 32px);
}

.folio-text .recto {
    padding: 0 48px 0 64px;
    border-right: 1px solid rgba(196,164,122,0.35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.folio-text .verso {
    padding: 0 56px 0 36px;
    position: relative;
}

.recto-heading {
    font-family: var(--f-display);
    font-weight: 700;
    color: var(--c-ink);
    font-size: clamp(32px, 3.4vw, 48px);
    line-height: 1.1;
    letter-spacing: -0.018em;
    margin-bottom: 28px;
}

.recto-heading em {
    font-style: italic;
    font-weight: 400;
    color: var(--c-cordovan);
}

.text-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 28px;
    overflow-y: auto;
    flex: 1;
    padding-right: 12px;
    scrollbar-width: thin;
    scrollbar-color: var(--c-gilt) transparent;
}

.text-cols::-webkit-scrollbar { width: 6px; }
.text-cols::-webkit-scrollbar-track { background: transparent; }
.text-cols::-webkit-scrollbar-thumb { background: var(--c-gilt); border-radius: 3px; }

.text-col p {
    margin-bottom: 0.9em;
    color: var(--c-ink);
    font-size: 17px;
    line-height: 1.78;
    text-align: justify;
    hyphens: auto;
}

.text-col p:last-child { margin-bottom: 0; }

.dropcap {
    float: left;
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 64px;
    line-height: 0.9;
    color: var(--c-gilt);
    margin: 6px 8px -4px -4px;
    padding-right: 4px;
}

.pilcrow {
    color: var(--c-gilt);
    font-weight: 700;
    margin-right: 0.35em;
    font-size: 1.05em;
    vertical-align: 0.06em;
}

.anno-trigger {
    color: var(--c-verdigris);
    font-family: var(--f-sans);
    font-weight: 500;
    font-size: 0.65em;
    cursor: pointer;
    padding: 0 0.18em;
    border-bottom: 1px dotted var(--c-verdigris);
    transition: color 200ms ease;
    user-select: none;
}

.anno-trigger:hover,
.anno-trigger.is-active {
    color: var(--c-ochre);
    border-bottom-color: var(--c-ochre);
}

/* Verso annotations */
.annotations {
    display: flex;
    flex-direction: column;
    gap: 28px;
    margin-top: 12px;
}

.anno {
    border-left: 2px solid var(--c-verdigris);
    padding: 6px 0 6px 16px;
    background: linear-gradient(to right, rgba(232,221,208,0.5), transparent 70%);
    transition: background 240ms ease, border-color 240ms ease, transform 240ms ease;
}

.anno.is-highlight {
    background: linear-gradient(to right, rgba(232,221,208,0.95), rgba(232,221,208,0.2));
    border-left-color: var(--c-ochre);
    transform: translateX(-4px);
}

.anno-num {
    display: inline-block;
    font-family: var(--f-display);
    font-style: italic;
    font-weight: 400;
    color: var(--c-cordovan);
    font-size: 15px;
    margin-right: 6px;
}

.anno p {
    display: inline;
    font-family: var(--f-serif);
    font-size: 14px;
    line-height: 1.65;
    color: var(--c-sepia);
}

/* Marginalia doodles in verso */
.manicule, .key-doodle {
    position: absolute;
    bottom: 56px;
    right: 56px;
    color: var(--c-cordovan);
    text-align: center;
}

.manicule svg, .key-doodle svg {
    width: 80px;
    height: 60px;
    display: block;
}

.manicule .caption, .key-doodle .caption {
    display: block;
    margin-top: 8px;
    font-family: var(--f-sans);
    font-weight: 300;
    font-size: 11px;
    letter-spacing: 0.12em;
    color: var(--c-sepia);
}

/* ===== FOLIO III / VI :: Illustration ===== */
.folio-illus .folio-inner {
    padding: calc(var(--header-h) + 24px) 56px calc(var(--index-h) + 32px);
}

.illus-stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-top: 28px;
}

.illus-svg {
    width: min(820px, 88%);
    height: auto;
    color: var(--c-ink);
    overflow: visible;
}

.illus-svg-wide {
    width: min(1180px, 96%);
}

.illus-caption {
    margin-top: 22px;
    font-family: var(--f-serif);
    font-style: italic;
    font-size: 13px;
    color: var(--c-sepia);
    max-width: 720px;
    text-align: left;
    align-self: flex-start;
    line-height: 1.55;
}

.illus-caption em {
    color: var(--c-cordovan);
    font-style: italic;
}

/* ===== FOLIO IV / VII :: Marginalia ===== */
.folio-marg .folio-inner {
    padding: calc(var(--header-h) + 36px) 56px calc(var(--index-h) + 32px);
}

.marg-heading {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: clamp(36px, 4vw, 56px);
    color: var(--c-ink);
    line-height: 1.1;
    letter-spacing: -0.018em;
    max-width: 860px;
}

.marg-heading em {
    font-weight: 400;
    color: var(--c-cordovan);
    font-style: italic;
}

.constellation {
    position: absolute;
    top: 18%;
    left: 56px;
    width: calc(100% - 112px);
    height: 56%;
    pointer-events: none;
    z-index: 1;
}

.marg-blocks {
    position: relative;
    flex: 1;
    margin-top: 28px;
}

.marg-block {
    position: absolute;
    width: 240px;
    font-family: var(--f-serif);
    font-size: 14px;
    line-height: 1.65;
    color: var(--c-ink);
    z-index: 4;
}

.marg-block p {
    color: var(--c-ink);
}

.marg-block .initial {
    display: block;
    font-family: var(--f-display);
    font-variant: small-caps;
    font-weight: 700;
    color: var(--c-gilt);
    font-size: 56px;
    line-height: 1;
    margin-bottom: 4px;
}

.marg-block-a { top: -4%;  left: 6%;  }
.marg-block-b { top: 14%;  left: 38%; width: 260px; }
.marg-block-c { top: 38%;  left: 70%; }
.marg-block-d { top: 56%;  left: 18%; width: 260px; }

/* ===== FOLIO VII :: Quote variant ===== */
.folio-quote .folio-inner {
    justify-content: flex-start;
}

.pull-quote {
    margin-top: 28px;
    position: relative;
    padding: 28px 60px 28px 80px;
    max-width: 1080px;
    border-left: 2px solid var(--c-gilt);
    background: linear-gradient(to right, rgba(232,221,208,0.5), transparent 80%);
}

.pull-quote p {
    font-family: var(--f-display);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(22px, 2.4vw, 32px);
    line-height: 1.45;
    color: var(--c-ink);
    margin-bottom: 16px;
}

.pull-quote cite {
    display: block;
    font-family: var(--f-serif);
    font-style: italic;
    font-size: 14px;
    color: var(--c-sepia);
    text-align: right;
}

.quote-mark {
    position: absolute;
    top: -12px;
    left: 18px;
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 80px;
    line-height: 1;
    color: var(--c-gilt);
    opacity: 0.6;
}

.quote-close {
    position: relative;
    top: 10px;
    left: 8px;
    font-size: 56px;
    margin-left: 0.05em;
    vertical-align: -0.4em;
    display: inline;
    color: var(--c-gilt);
    opacity: 0.6;
}

.marg-blocks-quote {
    margin-top: 28px;
    height: 220px;
}

.marg-blocks-quote .marg-block-a { top: 10%; left: 6%; }
.marg-blocks-quote .marg-block-b { top: 30%; left: 56%; }

.ornament-frame {
    width: min(600px, 70%);
    height: 60px;
    align-self: center;
    color: var(--c-cordovan);
    margin: 24px auto 0;
}

/* ===== FOLIO VIII :: Colophon ===== */
.folio-colophon .folio-inner {
    align-items: center;
    justify-content: center;
    text-align: center;
}

.colophon-block {
    max-width: 640px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hourglass {
    width: 56px;
    height: 70px;
    color: var(--c-cordovan);
    margin-bottom: 24px;
}

.colophon-title {
    font-family: var(--f-display);
    font-weight: 400;
    font-style: italic;
    font-size: clamp(48px, 5vw, 76px);
    color: var(--c-ink);
    margin-bottom: 28px;
    letter-spacing: -0.012em;
}

.colophon-text {
    font-family: var(--f-serif);
    font-size: 16px;
    line-height: 1.75;
    color: var(--c-sepia);
    margin-bottom: 16px;
}

.colophon-text .caps {
    font-family: var(--f-display);
    font-variant: small-caps;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--c-ink);
    font-style: normal;
}

.colophon-domain {
    margin-top: 24px;
    color: var(--c-cordovan);
    font-style: italic;
}

.colophon-fin {
    margin-top: 24px;
    font-family: var(--f-display);
    font-style: italic;
    font-size: 18px;
    color: var(--c-gilt);
    letter-spacing: 0.18em;
}

/* ===== Annotation popover ===== */
.annotation-popover {
    position: fixed;
    z-index: 50;
    max-width: 320px;
    padding: 16px 20px;
    background: var(--c-bg-alt);
    border-left: 2px solid var(--c-verdigris);
    box-shadow: 0 2px 4px rgba(44,36,24,0.08);
    opacity: 0;
    transform: translateX(20px);
    pointer-events: none;
    transition: opacity 200ms ease, transform 200ms ease;
}

.annotation-popover.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.popover-num {
    font-family: var(--f-display);
    font-style: italic;
    color: var(--c-cordovan);
    font-size: 14px;
    margin-bottom: 4px;
}

.popover-body {
    font-family: var(--f-serif);
    font-size: 13px;
    line-height: 1.55;
    color: var(--c-ink);
}

/* ===== Folio index strip ===== */
.folio-index {
    position: fixed;
    left: 0; right: 0;
    bottom: 0;
    height: var(--index-h);
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to top, rgba(244,236,223,0.96), rgba(244,236,223,0.6) 80%, rgba(244,236,223,0));
    border-top: 1px solid rgba(196,164,122,0.4);
}

.folio-index-list {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 12px;
}

.folio-tick {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 4px 2px;
}

.tick-bar {
    display: block;
    width: 22px;
    height: 8px;
    border: 1px solid var(--c-sepia);
    background: transparent;
    transition: background 300ms ease, border-color 300ms ease;
}

.folio-tick.is-visited .tick-bar {
    background: var(--c-gilt);
    border-color: var(--c-gilt);
}

.folio-tick.is-active .tick-bar {
    background: var(--c-ochre);
    border-color: var(--c-ochre);
}

.tick-num {
    font-family: var(--f-display);
    font-variant: small-caps;
    font-weight: 700;
    font-size: 9px;
    letter-spacing: 0.12em;
    color: var(--c-sepia);
    transition: color 300ms ease;
}

.folio-tick.is-active .tick-num {
    color: var(--c-ochre);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    :root {
        --gutter-w: 32px;
    }

    .folio-inner {
        padding: calc(var(--header-h) + 16px) 28px calc(var(--index-h) + 24px);
    }

    .folio-num { right: 28px; }
    .folio-foot { right: 28px; }

    .folio-text .folio-inner {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
    }

    .folio-text .recto {
        padding: 0 28px;
        border-right: 0;
        border-bottom: 1px solid rgba(196,164,122,0.35);
    }

    .folio-text .verso {
        padding: 28px;
    }

    .text-cols {
        grid-template-columns: 1fr;
    }

    .marg-block { width: 78%; }
    .marg-block-a { left: 4%; }
    .marg-block-b { left: 14%; top: 22%; }
    .marg-block-c { left: 4%; top: 44%; }
    .marg-block-d { left: 14%; top: 64%; }

    .pull-quote { padding: 24px 32px 24px 48px; }

    .watermark { font-size: 90px; }
}

/* prevent layout cropping on very short heights */
@media (max-height: 640px) {
    .folio-inner { padding-top: calc(var(--header-h) + 12px); }
    .text-cols { font-size: 14px; line-height: 1.6; }
}
