/* ==========================================================================
   tanso.tech — A Compendium of Carbon Knowledge
   Editorial-flow folio with Victorian scientific illustration motifs.
   ========================================================================== */

:root {
    --parchment: #F5ECD7;
    --espresso: #2C1810;
    --charcoal: #3A2F28;
    --saddle: #8B4513;
    --goldenrod: #8B6914;
    --aged-gold: #C8A96E;
    --leather: #6B5B4F;
    --cream: #FDF8EE;
    --oxblood: #6B1C23;
    --ivory-black: #1A1510;

    --font-display: "Playfair Display", "EB Garamond", Georgia, serif;
    --font-body: "Crimson Pro", "EB Garamond", Georgia, serif;
    --font-petite: "Cormorant SC", "Cormorant Garamond", serif;

    --content-max: 740px;
    --margin-w: 200px;
}

/* ---------------------------------------- Reset & Base */

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

html, body {
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--parchment);
    color: var(--charcoal);
    font-family: var(--font-body);
    font-size: 1.125rem;
    line-height: 1.72;
    letter-spacing: 0.005em;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

img, svg { display: block; max-width: 100%; }

p { margin: 0 0 1.5em; }

i, em { font-style: italic; }

a {
    color: var(--oxblood);
    text-decoration: none;
    border-bottom: 1px dotted var(--aged-gold);
    transition: color 300ms ease, border-color 300ms ease;
}
a:hover { color: var(--saddle); border-bottom-color: var(--saddle); }

/* ---------------------------------------- Parchment textures */

.parchment-grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0.6;
    mix-blend-mode: multiply;
    background-image:
        radial-gradient(ellipse at 20% 30%, rgba(139, 105, 20, 0.06) 0%, transparent 40%),
        radial-gradient(ellipse at 80% 70%, rgba(107, 28, 35, 0.04) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 50%, rgba(58, 47, 40, 0.03) 0%, transparent 60%);
}

.parchment-grain::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.06;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.55  0 0 0 0 0.42  0 0 0 0 0.18  0 0 0 1 0'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
}

.parchment-hatch {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.03;
    background-image: repeating-linear-gradient(
        45deg,
        var(--charcoal) 0,
        var(--charcoal) 0.5px,
        transparent 0.5px,
        transparent 4px
    );
}

/* ---------------------------------------- Frontispiece */

.frontispiece {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4vh 6vw;
}

.frame {
    position: relative;
    width: 100%;
    max-width: 1100px;
    min-height: 86vh;
    padding: 8vh 8vw;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Corner cartouches */
.frame-corner {
    position: absolute;
    width: 80px;
    height: 80px;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 1.2s ease 0.2s, transform 1.2s ease 0.2s;
}
.frame-corner.tl { top: 0; left: 0; }
.frame-corner.tr { top: 0; right: 0; transform: scale(0.8) scaleX(-1); }
.frame-corner.bl { bottom: 0; left: 0; transform: scale(0.8) scaleY(-1); }
.frame-corner.br { bottom: 0; right: 0; transform: scale(0.8) scale(-1, -1); }
.is-revealed .frame-corner.tl { opacity: 1; transform: scale(1); }
.is-revealed .frame-corner.tr { opacity: 1; transform: scaleX(-1); }
.is-revealed .frame-corner.bl { opacity: 1; transform: scaleY(-1); }
.is-revealed .frame-corner.br { opacity: 1; transform: scale(-1, -1); }

/* Frame rules */
.frame-rule {
    position: absolute;
    overflow: visible;
}
.frame-top, .frame-bottom { left: 80px; right: 80px; height: 4px; }
.frame-top { top: 38px; }
.frame-bottom { bottom: 38px; }
.frame-left, .frame-right { top: 80px; bottom: 80px; width: 4px; }
.frame-left { left: 38px; }
.frame-right { right: 38px; }

.frame-rule .rule-path {
    stroke-dasharray: 1100;
    stroke-dashoffset: 1100;
    transition: stroke-dashoffset 1.4s ease 0.3s;
}
.is-revealed .frame-rule .rule-path { stroke-dashoffset: 0; }

/* Frontispiece content */
.frontispiece-inner {
    text-align: center;
    max-width: 760px;
    position: relative;
    animation: shimmer 6s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { filter: brightness(1); }
    50%      { filter: brightness(1.04); }
}

.printers-mark {
    width: 110px;
    height: 110px;
    margin: 0 auto 2.4rem;
    opacity: 0;
    transition: opacity 0.6s ease 0.8s;
}
.is-revealed .printers-mark { opacity: 1; }

.folio-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(3rem, 9vw, 6.5rem);
    letter-spacing: 0.02em;
    color: var(--espresso);
    margin: 0 0 1.5rem;
    line-height: 1.05;
    font-feature-settings: "liga" 1, "onum" 1;
}

.folio-title .ch {
    display: inline-block;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.folio-title .ch.dot {
    color: var(--saddle);
    font-style: italic;
    margin: 0 0.04em;
}
.is-revealed .folio-title .ch { opacity: 1; transform: translateY(0); }

.folio-rule {
    margin: 0 auto 1.6rem;
    opacity: 0;
    transition: opacity 0.6s ease 1.4s;
}
.is-revealed .folio-rule { opacity: 1; }

.folio-subtitle {
    font-family: var(--font-petite);
    font-weight: 600;
    color: var(--goldenrod);
    text-transform: uppercase;
    letter-spacing: 0.32em;
    font-size: clamp(0.85rem, 1.4vw, 1.05rem);
    margin: 0 0 1.4rem;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.7s ease 1.4s, transform 0.7s ease 1.4s;
}
.is-revealed .folio-subtitle { opacity: 1; transform: translateY(0); }

.folio-attribution {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 0.95rem;
    color: var(--leather);
    letter-spacing: 0.05em;
    opacity: 0;
    transition: opacity 0.7s ease 1.7s;
    margin: 0;
}
.is-revealed .folio-attribution { opacity: 1; }

/* ---------------------------------------- Folio Page Layout */

.folio-page {
    position: relative;
    z-index: 2;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 6vh 1.5rem;
}

.toc-section,
.chapter,
.colophon {
    position: relative;
    z-index: 2;
}

.page-head, .chapter-head {
    text-align: center;
    margin-bottom: 3.5rem;
}

.petite-cap {
    font-family: var(--font-petite);
    font-weight: 600;
    color: var(--goldenrod);
    text-transform: uppercase;
    letter-spacing: 0.28em;
    font-size: 0.85rem;
    margin: 0 0 0.6rem;
}

.section-title,
.chapter-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 4.5vw, 3.6rem);
    color: var(--espresso);
    margin: 0 0 1.4rem;
    letter-spacing: 0.015em;
    line-height: 1.1;
    font-feature-settings: "liga" 1, "onum" 1;
}

.chapter-numeral {
    font-family: var(--font-petite);
    font-weight: 600;
    color: var(--goldenrod);
    letter-spacing: 0.28em;
    text-transform: uppercase;
    font-size: 0.95rem;
    margin: 0 0 0.4rem;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.chapter.in-view .chapter-numeral { opacity: 1; transform: scale(1); }

.chapter-numeral .roman {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 700;
    font-size: 2.6rem;
    color: var(--saddle);
    display: inline-block;
    margin: 0 0.15em;
    vertical-align: -0.4em;
    letter-spacing: 0;
}

.ornament-divider,
.fleuron-rule {
    display: flex;
    justify-content: center;
    margin: 1.6rem auto 0;
}

.fleuron-rule svg {
    max-width: 600px;
    width: 100%;
    overflow: visible;
}

.fleuron-rule .rule-path {
    stroke-dasharray: 280;
    stroke-dashoffset: 280;
    transition: stroke-dashoffset 1s ease;
}
.chapter.in-view .fleuron-rule .rule-path { stroke-dashoffset: 0; }

/* ---------------------------------------- Body Paragraphs */

.body-para {
    font-family: var(--font-body);
    font-size: 1.125rem;
    line-height: 1.72;
    color: var(--charcoal);
    text-indent: 1.5em;
    margin: 0 0 1.5em;
}

.body-para.has-dropcap {
    text-indent: 0;
}

.dropcap {
    float: left;
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 4.5rem;
    line-height: 0.85;
    color: var(--saddle);
    margin: 0.05em 0.08em -0.05em 0;
    padding: 0;
    transform: rotate(0deg) scale(1);
    transform-origin: center;
}

.chapter:not(.in-view) .dropcap {
    transform: rotate(-2deg) scale(0.9);
    opacity: 0;
}
.chapter.in-view .dropcap {
    opacity: 1;
    transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.3, 1.2), opacity 0.9s ease;
}

/* ---------------------------------------- Pull Quote */

.pull-quote {
    margin: 3rem auto;
    padding: 2.4rem 3rem 1.8rem;
    background: var(--cream);
    border-left: 3px solid var(--aged-gold);
    border-right: 3px solid var(--aged-gold);
    position: relative;
    text-align: center;
    max-width: 640px;
}

.pull-quote::before,
.pull-quote::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 8px;
    background-image: repeating-linear-gradient(
        to right,
        var(--aged-gold) 0,
        var(--aged-gold) 4px,
        transparent 4px,
        transparent 12px
    );
    opacity: 0.4;
}
.pull-quote::before { top: 0; }
.pull-quote::after  { bottom: 0; }

.quote-mark {
    position: absolute;
    top: -0.4rem;
    left: 1.8rem;
    font-family: var(--font-display);
    font-size: 4rem;
    color: var(--aged-gold);
    line-height: 1;
    opacity: 0.6;
}

.pull-quote p {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.35rem;
    line-height: 1.5;
    color: var(--espresso);
    margin: 0 0 1rem;
}

.quote-attribution {
    font-family: var(--font-petite);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.78rem;
    color: var(--goldenrod);
}

/* ---------------------------------------- Marginalia */

.chapter {
    position: relative;
    margin-top: 4vh;
}

.marginalia {
    display: none;
}

@media (min-width: 1200px) {
    .marginalia {
        display: block;
        position: absolute;
        top: 24vh;
        left: max(2vw, calc(50vw - var(--content-max)/2 - var(--margin-w) - 24px));
        width: var(--margin-w);
    }
    .marg-block {
        position: sticky;
        top: 18vh;
        margin-bottom: 2.6rem;
        border-left: 2px solid var(--aged-gold);
        padding: 0.4rem 0.4rem 0.4rem 0.9rem;
        font-family: var(--font-body);
        font-style: italic;
        font-size: 0.85rem;
        line-height: 1.55;
        color: var(--leather);
    }
}

.marg-block { margin-bottom: 1.5rem; }

.marg-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    vertical-align: -0.18em;
    margin-right: 0.4rem;
}
.marg-icon svg { width: 100%; height: 100%; display: inline-block; }

.marg-block p { margin: 0; display: inline; }

@media (max-width: 1199px) {
    .marginalia {
        display: block;
        position: relative;
        max-width: var(--content-max);
        margin: 0 auto 2rem;
        padding: 0 1.5rem;
    }
    .marg-block {
        background: var(--cream);
        border-left: 2px solid var(--aged-gold);
        padding: 0.7rem 1rem;
        font-family: var(--font-body);
        font-style: italic;
        font-size: 0.92rem;
        line-height: 1.55;
        color: var(--leather);
        margin-bottom: 1rem;
    }
}

/* ---------------------------------------- Table of Contents */

.toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: chap;
}

.toc-item {
    display: grid;
    grid-template-columns: 64px 1fr auto auto;
    align-items: baseline;
    gap: 1rem;
    padding: 1.1rem 0;
    border-bottom: 1px solid rgba(139, 105, 20, 0.15);
    cursor: pointer;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.7s ease, transform 0.7s ease, color 0.3s ease, letter-spacing 0.3s ease;
}

.toc-section.in-view .toc-item { opacity: 1; transform: translateY(0); }
.toc-section.in-view .toc-item:nth-child(1) { transition-delay: 0.05s; }
.toc-section.in-view .toc-item:nth-child(2) { transition-delay: 0.13s; }
.toc-section.in-view .toc-item:nth-child(3) { transition-delay: 0.21s; }
.toc-section.in-view .toc-item:nth-child(4) { transition-delay: 0.29s; }
.toc-section.in-view .toc-item:nth-child(5) { transition-delay: 0.37s; }

.toc-item:hover {
    color: var(--saddle);
    letter-spacing: 0.025em;
}

.toc-numeral {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--saddle);
    text-align: right;
    letter-spacing: 0;
}

.toc-title {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 400;
    font-size: 1.15rem;
    color: var(--espresso);
    transition: color 0.3s ease;
}

.toc-item:hover .toc-title { color: var(--saddle); }

.toc-leader {
    height: 1.2em;
    min-width: 60px;
    background-image: radial-gradient(circle, var(--goldenrod) 1px, transparent 1.5px);
    background-size: 0% 100%;
    background-repeat: repeat-x;
    background-position: bottom 0.3em left;
    align-self: end;
    transition: background-size 1.2s ease;
}

.toc-section.in-view .toc-leader {
    background-size: 6px 100%;
}

.toc-item:hover .toc-leader {
    filter: drop-shadow(0 0 2px var(--aged-gold));
}

.toc-page {
    font-family: var(--font-petite);
    font-weight: 600;
    color: var(--goldenrod);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 0.85rem;
    text-align: right;
    min-width: 40px;
}

@media (max-width: 600px) {
    .toc-item {
        grid-template-columns: 40px 1fr auto;
        gap: 0.6rem;
    }
    .toc-leader { display: none; }
    .toc-numeral { font-size: 1.1rem; }
    .toc-title { font-size: 1rem; }
}

/* ---------------------------------------- Diagram Panel */

.diagram-panel {
    position: relative;
    margin: 3.5rem 0;
    padding: 2.4rem 1.8rem 1.8rem;
    background: var(--cream);
    border: 1px solid var(--aged-gold);
}

.diagram-corner {
    position: absolute;
    width: 30px;
    height: 30px;
    opacity: 0;
    transition: opacity 0.7s ease;
}
.diagram-corner.tl { top: -2px; left: -2px; }
.diagram-corner.tr { top: -2px; right: -2px; }
.diagram-corner.bl { bottom: -2px; left: -2px; }
.diagram-corner.br { bottom: -2px; right: -2px; }
.diagram-panel.is-drawn .diagram-corner { opacity: 1; }

.diagram-inner {
    position: relative;
    text-align: center;
}

.plate-label {
    font-family: var(--font-petite);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.32em;
    color: var(--goldenrod);
    font-size: 0.75rem;
    margin: 0 0 0.5rem;
}

.plate-title {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 400;
    font-size: 1.4rem;
    color: var(--espresso);
    margin: 0 0 1.6rem;
    letter-spacing: 0.02em;
}

.diagram-svg {
    width: 100%;
    max-width: 460px;
    height: auto;
    margin: 0 auto;
    overflow: visible;
}

.plate-caption {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 0.92rem;
    color: var(--leather);
    line-height: 1.55;
    max-width: 540px;
    margin: 1.6rem auto 0;
    text-align: center;
}

/* Diagram animations - bohr/cycle/bonds */

.shell { transition: stroke-dashoffset 1.2s ease 0.2s; }
.diagram-panel.is-drawn .shell-outer { stroke-dashoffset: 0; }
.diagram-panel.is-drawn .shell-inner { stroke-dashoffset: 0; }

.nucleus, .nucleus-label { transition: opacity 0.6s ease 1.0s; }
.diagram-panel.is-drawn .nucleus { opacity: 1; }
.diagram-panel.is-drawn .nucleus-label { opacity: 1; }

.diag-electron { transition: opacity 0.4s ease 1.4s; }
.diagram-panel.is-drawn .diag-electron { opacity: 1; }

.callout-line { stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset 0.8s ease 1.8s; }
.callout-label { opacity: 0; transition: opacity 0.5s ease 2.4s; }
.diagram-panel.is-drawn .callout-line { stroke-dashoffset: 0; }
.diagram-panel.is-drawn .callout-label { opacity: 1; }

.cycle-ring { transition: stroke-dashoffset 1.2s ease 0.2s; }
.diagram-panel.is-drawn .cycle-ring { stroke-dashoffset: 0; }
.cycle-node circle, .cycle-node text { transition: opacity 0.6s ease 1.4s; }
.diagram-panel.is-drawn .cycle-node circle,
.diagram-panel.is-drawn .cycle-node text { opacity: 1; }
.cycle-arrow { transition: stroke-dashoffset 1.6s ease 1.8s; }
.diagram-panel.is-drawn .cycle-arrow { stroke-dashoffset: 0; }

.diagram-panel.is-drawn .cycle-c { opacity: 1; transition: opacity 0.6s ease 2.4s; }
.diagram-panel[data-diagram="cycle"].is-drawn .diagram-svg > circle:last-of-type {
    opacity: 1;
    transition: opacity 0.6s ease 2.4s;
}

.bond-line { transition: stroke-dashoffset 0.8s ease 0.4s; }
.bond-line.dbl { transition: stroke-dashoffset 0.8s ease 0.8s; }
.diagram-panel.is-drawn .bond-line { stroke-dashoffset: 0; }
.bond-atom { transition: opacity 0.4s ease 1.2s; }
.diagram-panel.is-drawn .bond-atom { opacity: 1; }

/* ---------------------------------------- Taxonomic Icon Grid */

.taxonomy-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 3rem 0;
    padding: 1.5rem;
    background: linear-gradient(180deg, transparent, rgba(200, 169, 110, 0.06));
}

@media (max-width: 800px) {
    .taxonomy-grid { grid-template-columns: repeat(2, 1fr); }
}

.tax-tile {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.8rem;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.4s ease, border-color 0.4s ease, transform 0.4s ease;
    position: relative;
}

.tax-tile::before {
    content: "";
    position: absolute;
    inset: 4px;
    border: 1px dashed transparent;
    transition: border-color 0.4s ease;
}

.tax-tile:hover {
    background: var(--cream);
    border-color: var(--aged-gold);
    transform: translateY(-2px);
}

.tax-tile:hover::before { border-color: rgba(200, 169, 110, 0.4); }

.tax-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 0.6rem;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.tax-tile:hover .tax-icon { transform: scale(1.08) rotate(-3deg); }

.tax-icon svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.morph-path {
    transition: d 0.6s ease-in-out, fill-opacity 0.4s ease, stroke-width 0.4s ease;
}

.tax-tile:hover .morph-path {
    fill-opacity: 0.5;
    stroke-width: 1.8;
}

.tax-label {
    font-family: var(--font-petite);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 0.78rem;
    color: var(--charcoal);
    margin: 0;
    text-align: center;
    transition: color 0.3s ease, font-weight 0.3s ease;
}

.tax-tile:hover .tax-label {
    color: var(--saddle);
    font-weight: 700;
}

/* ---------------------------------------- Colophon */

.colophon {
    padding: 8vh 1.5rem 12vh;
    display: flex;
    justify-content: center;
}

.colophon-block {
    position: relative;
    max-width: 580px;
    width: 100%;
    padding: 4rem 2.5rem;
    background: var(--cream);
    border: 1px solid var(--aged-gold);
    text-align: center;
}

.colophon-block::before,
.colophon-block::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    height: 4px;
    background-image: repeating-linear-gradient(
        to right,
        var(--goldenrod) 0,
        var(--goldenrod) 3px,
        transparent 3px,
        transparent 9px
    );
    opacity: 0.45;
}
.colophon-block::before { top: 12px; }
.colophon-block::after  { bottom: 12px; }

.colo-corner {
    position: absolute;
    width: 50px;
    height: 50px;
    opacity: 0;
    transition: opacity 0.7s ease;
}
.colo-corner.tl { top: -2px; left: -2px; }
.colo-corner.tr { top: -2px; right: -2px; }
.colo-corner.bl { bottom: -2px; left: -2px; }
.colo-corner.br { bottom: -2px; right: -2px; }

.colophon.in-view .colo-corner { opacity: 1; }

.colophon-inner {
    position: relative;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.9s ease 0.4s, transform 0.9s ease 0.4s;
}
.colophon.in-view .colophon-inner { opacity: 1; transform: translateY(0); }

.colophon-block .printers-mark {
    width: 90px;
    height: 90px;
    margin: 1.4rem auto;
    opacity: 1;
}

.mark-rotating {
    animation: rotateMark 30s linear infinite;
}

@keyframes rotateMark {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.electron.pulse {
    animation: electronPulse 2.4s ease-in-out infinite;
}
.electron.pulse:nth-of-type(2) { animation-delay: 0.2s; }
.electron.pulse:nth-of-type(3) { animation-delay: 0.5s; }
.electron.pulse:nth-of-type(4) { animation-delay: 0.8s; }
.electron.pulse:nth-of-type(5) { animation-delay: 1.1s; }
.electron.pulse:nth-of-type(6) { animation-delay: 1.4s; }

@keyframes electronPulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}

.colophon-edition {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--espresso);
    margin: 0 0 1rem;
    letter-spacing: 0.05em;
}

.colophon-rule {
    margin: 1rem auto 1.4rem;
}

.colophon-text {
    font-family: var(--font-body);
    font-size: 0.98rem;
    line-height: 1.7;
    color: var(--charcoal);
    margin: 0 0 1.2rem;
    text-indent: 0;
}

.petite-cap-inline {
    font-family: var(--font-petite);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--goldenrod);
    font-size: 0.95em;
}

.colophon-finis {
    font-family: var(--font-petite);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5em;
    font-size: 0.85rem;
    color: var(--goldenrod);
    margin-top: 1.6rem;
}

/* ---------------------------------------- Mobile tweaks */

@media (max-width: 720px) {
    body { font-size: 1.05rem; }
    .frame { padding: 6vh 5vw; min-height: 80vh; }
    .frame-corner { width: 60px; height: 60px; }
    .frame-top, .frame-bottom { left: 60px; right: 60px; top: 28px; }
    .frame-bottom { top: auto; bottom: 28px; }
    .frame-left, .frame-right { top: 60px; bottom: 60px; }
    .frame-left { left: 28px; }
    .frame-right { right: 28px; }
    .printers-mark { width: 80px; height: 80px; }
    .folio-page { padding: 4vh 1.2rem; }
    .diagram-panel { padding: 1.6rem 1rem 1.4rem; }
    .pull-quote { padding: 1.8rem 1.4rem; margin: 2rem auto; }
    .pull-quote p { font-size: 1.1rem; }
    .colophon-block { padding: 2.6rem 1.5rem; }
    .dropcap { font-size: 3.4rem; }
}

/* ---------------------------------------- Reduced motion */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
