/* =========================================================================
   licensor.directory  —  styles.css
   A clandestine pawnshop ledger of intellectual property rights-holders.
   Five-family typographic policy. Marbled-paper substrate. One candle.
   ========================================================================= */

/* TYPE POLICY ---------------------------------------------------------------
   1. UnifrakturCook    : wordmark + ornamental capitals only (>= 64pt)
   2. Cormorant Garamond: section titles, dropcap, mission, preface
   3. Old Standard TT   : directory register body (13.5px / 1.63)
   4. Special Elite     : stamps, colophon, dateline, marginalia, citations
   5. Italiana          : index-card section letters (96pt)
   ------------------------------------------------------------------------- */

:root {
    --ink: #1A0F08;
    --oxblood: #5C1F1F;
    --leather: #3A2418;
    --bone: #EDE4D2;
    --marbleVein: #A89274;
    --candle: #F7C56B;
    --candleHalo: #FFE9B0;
    --violetStamp: #5B4A8A;
    --phosphorCyan: #7BD8E0;
    --shadow: #0D0703;

    --grid-gutter: 24px;
    --baseline: 8px;
    --textblock: 760px;

    --paper-curve: cubic-bezier(0.16, 0.84, 0.30, 1.0);
}

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

html {
    scroll-behavior: smooth;
    background: var(--leather);
}

body {
    background: var(--leather);
    color: var(--ink);
    font-family: 'Old Standard TT', 'Cormorant Garamond', serif;
    font-size: 13.5px;
    line-height: 1.63;
    font-feature-settings: "onum" 1, "liga" 1, "dlig" 1, "swsh" 1;
    min-height: 100vh;
    overflow-x: hidden;
    cursor: none;
    position: relative;
}

/* MARBLED PAPER SUBSTRATE -------------------------------------------------- */
#marble-paper {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    opacity: 0.86;
    pointer-events: none;
}

/* Body falls toward shadow at edges */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 50% 30%, transparent 0%, transparent 30%, rgba(13, 7, 3, 0.55) 80%, rgba(13, 7, 3, 0.85) 100%),
        linear-gradient(180deg, rgba(58, 36, 24, 0.0) 0%, rgba(13, 7, 3, 0.4) 100%);
}

/* Subtle bone panel under the central textblock */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(820px, 92vw);
    height: 100vh;
    background: linear-gradient(180deg, rgba(237, 228, 210, 0.18) 0%, rgba(237, 228, 210, 0.08) 100%);
    z-index: -1;
    pointer-events: none;
    box-shadow: 0 0 80px 8px rgba(13, 7, 3, 0.4);
}

/* MAIN LEDGER -------------------------------------------------------------- */
.ledger {
    max-width: var(--textblock);
    margin: 0 auto;
    padding: 64px 32px 96px;
    position: relative;
    z-index: 1;
}

/* ============== FRONTISPIECE ============== */
.frontispiece {
    position: relative;
    padding-top: 24px;
    padding-bottom: 80px;
    border-top: 1px solid var(--ink);
    margin-top: 24px;
}

.dateline {
    font-family: 'Special Elite', monospace;
    font-size: 10px;
    letter-spacing: 0.32em;
    color: var(--candle);
    text-transform: uppercase;
    margin-bottom: 8px;
    padding-top: 16px;
}

.subdateline {
    font-family: 'Special Elite', monospace;
    font-size: 9.5px;
    letter-spacing: 0.18em;
    color: var(--marbleVein);
    text-transform: uppercase;
    margin-top: 12px;
    padding-left: 4px;
}

/* WORDMARK -- UnifrakturCook only */
.wordmark {
    font-family: 'UnifrakturCook', 'Cormorant Garamond', serif;
    font-weight: 700;
    font-size: clamp(3.6rem, 9vw, 7.2rem);
    line-height: 0.95;
    color: var(--ink);
    letter-spacing: -0.01em;
    /* Off-grid: italic descender breaks down 18px into row 2 */
    margin-top: -8px;
    margin-bottom: -18px;
    transform: translateY(18px);
    text-shadow:
        0 1px 0 rgba(13, 7, 3, 0.3),
        0 2px 6px rgba(13, 7, 3, 0.25);
    position: relative;
}

/* Tipped-in photographs ----------------------------------------------------- */
.tipped-in {
    position: relative;
    display: block;
    width: 320px;
    max-width: 76%;
    margin: 64px auto 56px;
    background: var(--bone);
    padding: 12px 12px 4px;
    box-shadow: 8px 14px 28px rgba(13, 7, 3, 0.55);
    will-change: transform, box-shadow;
    transition: box-shadow 240ms linear;
}

.tipped-in--candle {
    margin-left: auto;
    margin-right: -22px; /* off-grid: pokes 22px past right margin */
    transform: rotate(1.7deg);
}
.tipped-in--folio {
    margin-right: auto;
    margin-left: -16px;
    width: 280px;
    transform: rotate(-2.1deg);
}
.tipped-in--printer {
    margin-left: auto;
    margin-right: 16px;
    width: 300px;
    transform: rotate(2deg);
}

.tipped-in .duotone-photo {
    display: block;
    width: 100%;
    height: auto;
    filter: contrast(1.1) brightness(0.92);
}

.tipped-in figcaption {
    font-family: 'Special Elite', monospace;
    font-size: 8.5pt;
    line-height: 14pt;
    color: var(--ink);
    text-align: center;
    padding: 6px 4px 4px;
    letter-spacing: 0.04em;
}

/* Paper-tape T hinges */
.hinge {
    position: absolute;
    width: 36px;
    height: 14px;
    background: rgba(237, 228, 210, 0.78);
    border: 0.5px solid rgba(13, 7, 3, 0.3);
    box-shadow: 0 1px 2px rgba(13, 7, 3, 0.25);
    z-index: 2;
}
.hinge::before {
    content: "";
    position: absolute;
    width: 14px;
    height: 18px;
    background: rgba(237, 228, 210, 0.78);
    border: 0.5px solid rgba(13, 7, 3, 0.3);
    box-shadow: 0 1px 2px rgba(13, 7, 3, 0.25);
}
.hinge--tl {
    top: -8px;
    left: 12px;
    transform: skewX(-8deg);
}
.hinge--tl::before {
    top: -2px;
    left: 12px;
    transform: skewX(8deg);
}
.hinge--tr {
    top: -8px;
    right: 12px;
    transform: skewX(8deg);
}
.hinge--tr::before {
    top: -2px;
    right: 12px;
    transform: skewX(-8deg);
}

/* ============== PREFACE (3-col ragged-right 9pt) ============== */
.preface {
    position: relative;
    padding: 56px 0 40px;
    margin-top: 16px;
}

.preface-body {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: 16px;
    line-height: 1.62;
    color: var(--ink);
    text-align: justify;
    text-justify: inter-word;
    margin-bottom: 18px;
    column-fill: balance;
    hyphens: auto;
}

.preface-body:not(:first-child) {
    columns: 2;
    column-gap: 32px;
    font-size: 13px;
    line-height: 1.6;
    text-align: justify;
}

.preface-body--right {
    margin-left: 28px;
    margin-right: -8px;
}

/* Renaissance dropcap */
.dropcap {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 500;
    font-style: normal;
    font-size: 76px;
    line-height: 0.78;
    color: var(--oxblood);
    float: left;
    padding: 6px 12px 0 0;
    margin-top: 4px;
    text-shadow: 0 1px 0 rgba(13, 7, 3, 0.18);
}

.marginalia {
    font-family: 'Special Elite', monospace;
    font-size: 8.5pt;
    line-height: 14pt;
    color: var(--marbleVein);
    margin-top: 16px;
    margin-left: 480px; /* off-grid: marginalia at +14px baseline shift */
    transform: translateY(14px);
    max-width: 240px;
}

/* ============== INTERLUDE (full viewport beat) ============== */
.interlude {
    position: relative;
    height: 100vh;
    margin: 64px -32px 64px;
    background: linear-gradient(180deg, rgba(58, 36, 24, 0.85) 0%, rgba(13, 7, 3, 0.92) 100%);
    box-shadow: inset 0 0 200px 40px rgba(13, 7, 3, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    overflow: hidden;
}

.interlude::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at center, transparent 0%, rgba(13, 7, 3, 0.4) 70%, rgba(13, 7, 3, 0.85) 100%);
    pointer-events: none;
}

.interlude-body {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 500;
    font-style: italic;
    font-size: clamp(20px, 2.6vw, 30px);
    line-height: 1.55;
    color: var(--bone);
    max-width: 640px;
    text-align: center;
    z-index: 2;
    text-shadow: 0 1px 4px rgba(13, 7, 3, 0.6);
}

.interlude-attribution {
    font-family: 'Special Elite', monospace;
    font-size: 10px;
    color: var(--candle);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-top: 32px;
    z-index: 2;
}

/* ============== REGISTER (the directory proper) ============== */
.register {
    position: relative;
    padding: 80px 0 32px;
    margin-bottom: 24px;
}

/* Section card -- off-grid, slightly skewed */
.section-card {
    position: relative;
    width: 360px;
    max-width: 90%;
    aspect-ratio: 5 / 3;
    background: var(--bone);
    margin: 0 auto 56px;
    padding: 24px 28px 18px;
    box-shadow: 6px 10px 24px rgba(13, 7, 3, 0.55);
    transform-origin: 50% 50%;
    will-change: transform;
    transition: transform 220ms ease-out;
    overflow: hidden;
}
.section-card[data-skew="-5"] { transform: rotate(-5deg) translateY(0); margin-left: -22px; margin-right: auto; }
.section-card[data-skew="6"]  { transform: rotate(6deg);  margin-left: auto; margin-right: -22px; }
.section-card[data-skew="-4"] { transform: rotate(-4deg); margin-left: -16px; margin-right: auto; }
.section-card[data-skew="5"]  { transform: rotate(5deg);  margin-left: auto; margin-right: -16px; }
.section-card[data-skew="-6"] { transform: rotate(-6deg); margin-left: -28px; margin-right: auto; }
.section-card[data-skew="4"]  { transform: rotate(4deg);  margin-left: auto; margin-right: -28px; }

.section-card:hover {
    transform: rotate(0deg) !important;
}

.card-rules {
    position: absolute;
    inset: 56px 24px 18px 24px;
    pointer-events: none;
}
.card-rules .rule {
    display: block;
    height: 1px;
    margin-bottom: 22px;
}
.card-rules .rule--top { background: var(--oxblood); height: 1.5px; }
.card-rules .rule--mid,
.card-rules .rule--bot { background: var(--marbleVein); opacity: 0.65; }

.section-letter {
    font-family: 'Italiana', serif;
    font-size: 96pt;
    line-height: 0.78;
    color: var(--oxblood);
    position: absolute;
    top: 14px;
    left: 28px;
    letter-spacing: -0.02em;
}

.section-title {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 300;
    font-size: 22px;
    line-height: 1.1;
    color: var(--ink);
    position: absolute;
    top: 30px;
    left: 130px;
    right: 24px;
}

.call-number {
    font-family: 'Special Elite', monospace;
    font-size: 10px;
    letter-spacing: 0.18em;
    color: var(--ink);
    position: absolute;
    bottom: 38px;
    left: 28px;
}

.librarian-stamp {
    position: absolute;
    bottom: 12px;
    right: 16px;
    font-family: 'Special Elite', monospace;
    font-size: 7.5pt;
    color: var(--violetStamp);
    border: 1.5px solid var(--violetStamp);
    border-radius: 4px;
    padding: 4px 8px;
    letter-spacing: 0.12em;
    transform: rotate(-3.4deg);
    opacity: 0.78;
    text-transform: uppercase;
    background: rgba(91, 74, 138, 0.06);
}

/* Register rows ============================================================ */
.register-rows {
    list-style: none;
    counter-reset: row;
    border-top: 1px solid var(--ink);
    padding-top: 14px;
}

.row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(180px, 38%) 1fr;
    gap: 14px;
    padding: 10px 0;
    align-items: baseline;
    overflow: hidden;
    counter-increment: row;
    /* resting state for staggered reveal */
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 540ms var(--paper-curve), transform 540ms var(--paper-curve);
    will-change: opacity, transform;
}

.row.is-revealed {
    opacity: 1;
    transform: translateY(0);
}

.row .terms {
    /* terms are revealed 80ms after the name */
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 540ms var(--paper-curve) 80ms, transform 540ms var(--paper-curve) 80ms;
}
.row.is-revealed .terms {
    opacity: 1;
    transform: translateY(0);
}

.name {
    font-family: 'Old Standard TT', serif;
    font-weight: 700;
    font-size: 13.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink);
    line-height: 1.45;
    position: relative;
    z-index: 2;
    background: linear-gradient(90deg, rgba(237, 228, 210, 0.0) 0%, rgba(237, 228, 210, 0.4) 30%, rgba(237, 228, 210, 0.4) 70%, rgba(237, 228, 210, 0.0) 100%);
    padding-right: 8px;
    box-shadow: -8px 0 0 0 rgba(237, 228, 210, 0.22);
}

.terms {
    font-family: 'Old Standard TT', serif;
    font-style: italic;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--ink);
    position: relative;
    z-index: 2;
    padding-left: 8px;
    background: linear-gradient(90deg, rgba(237, 228, 210, 0.0) 0%, rgba(237, 228, 210, 0.35) 25%, rgba(237, 228, 210, 0.35) 100%);
}

.terms em {
    color: var(--oxblood);
    font-style: italic;
}

.terms .cite {
    display: inline-block;
    margin-left: 6px;
    font-family: 'Special Elite', monospace;
    font-size: 7pt;
    color: var(--marbleVein);
    font-style: normal;
    letter-spacing: 0.06em;
    vertical-align: 1px;
}

/* Diamond-glyph leaders */
.row::before {
    content: " \2666 \2666 \2666 \2666 \2666 \2666 \2666 \2666 \2666 \2666 \2666 \2666 \2666 \2666 \2666 \2666 \2666 \2666 \2666 \2666 \2666 \2666 \2666 \2666 \2666 \2666 \2666 \2666 \2666 \2666 \2666 \2666 \2666 \2666 \2666 \2666 ";
    letter-spacing: 0.62em;
    color: var(--ink);
    opacity: 0.45;
    overflow: hidden;
    white-space: nowrap;
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-30%);
    z-index: 1;
    font-size: 11px;
    pointer-events: none;
    transition: color 320ms ease, opacity 320ms ease;
}

.row:hover::before {
    color: var(--candle);
    opacity: 1;
}

.row:hover .name {
    color: var(--ink);
}

/* ============== SECTION CARD STAGGER ============== */
.section-card {
    opacity: 0;
}
.section-card.is-revealed {
    animation: settleCard 600ms var(--paper-curve) forwards;
}
@keyframes settleCard {
    0%   { opacity: 0; }
    20%  { opacity: 1; }
    100% { opacity: 1; }
}

/* ============== TABLE OF CONTENTS (side rail) ============== */
.toc {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    pointer-events: auto;
}

.toc ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px 12px;
    background: rgba(13, 7, 3, 0.55);
    border: 1px solid rgba(168, 146, 116, 0.22);
    border-radius: 2px;
}

.toc a {
    font-family: 'Italiana', serif;
    font-size: 18px;
    color: var(--bone);
    text-decoration: none;
    opacity: 0.55;
    transition: color 220ms ease, opacity 220ms ease;
    line-height: 1;
    padding: 4px 6px;
    display: block;
    text-align: center;
    letter-spacing: 0.04em;
}

.toc a:hover,
.toc a.is-active {
    color: var(--phosphorCyan);
    opacity: 1;
    border-bottom: 1px solid var(--phosphorCyan);
    text-shadow: 0 0 6px rgba(123, 216, 224, 0.5);
}

.toc-marker {
    display: block;
    text-align: center;
    color: var(--candle);
    font-size: 10px;
    margin-top: 4px;
    opacity: 0.6;
}

/* ============== COLOPHON ============== */
.colophon {
    position: relative;
    padding: 80px 0 56px;
    margin-top: 48px;
    text-align: center;
}

.colophon-rule {
    width: 240px;
    height: 1px;
    background: var(--ink);
    margin: 0 auto 28px;
}

.colophon-body {
    font-family: 'Special Elite', monospace;
    font-size: 7pt;
    line-height: 1.7;
    color: var(--ink);
    max-width: 540px;
    margin: 0 auto 14px;
    letter-spacing: 0.04em;
    font-style: italic;
}

.colophon-body em {
    font-style: normal;
    color: var(--oxblood);
    font-weight: 700;
}

.colophon-address {
    font-family: 'Special Elite', monospace;
    font-size: 8pt;
    color: var(--ink);
    margin-top: 24px;
    letter-spacing: 0.06em;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
}

.ornament {
    color: var(--oxblood);
    font-size: 14pt;
    line-height: 1;
}

.printer-flower {
    margin: 24px auto 16px;
    display: flex;
    justify-content: center;
}

.colophon-pilcrow {
    font-family: 'Special Elite', monospace;
    font-size: 7pt;
    color: var(--marbleVein);
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

/* ============== CANDLE CURSOR ============== */
#candle-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    z-index: 100;
    pointer-events: none;
    will-change: transform, opacity;
    mix-blend-mode: screen;
}

.candle-corona {
    position: absolute;
    width: 320px;
    height: 320px;
    left: -160px;
    top: -160px;
    background: radial-gradient(circle, rgba(255, 233, 176, 0.18) 0%, rgba(247, 197, 107, 0.12) 30%, rgba(247, 197, 107, 0.04) 60%, rgba(247, 197, 107, 0) 100%);
    border-radius: 50%;
    filter: blur(8px);
}

.candle-mid {
    position: absolute;
    width: 120px;
    height: 120px;
    left: -60px;
    top: -60px;
    background: radial-gradient(circle, rgba(255, 233, 176, 0.45) 0%, rgba(247, 197, 107, 0.28) 40%, rgba(247, 197, 107, 0) 80%);
    border-radius: 50%;
    filter: blur(4px);
}

.candle-flame {
    position: absolute;
    width: 24px;
    height: 36px;
    left: -12px;
    top: -22px;
    background: radial-gradient(ellipse at 50% 65%, rgba(255, 233, 176, 1) 0%, rgba(247, 197, 107, 0.95) 40%, rgba(247, 197, 107, 0) 100%);
    clip-path: ellipse(40% 60% at 50% 60%);
    filter: blur(0.6px);
    box-shadow: 0 0 18px 2px rgba(123, 216, 224, 0.18); /* phosphor-cyan halo edge */
}

/* live-now — phosphor-cyan accent */
.live-now {
    position: fixed;
    bottom: 14px;
    left: 14px;
    z-index: 60;
    font-family: 'Special Elite', monospace;
    font-size: 8pt;
    color: var(--phosphorCyan);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    opacity: 0.0;
    transition: opacity 320ms ease;
    border-bottom: 1px solid var(--phosphorCyan);
    padding-bottom: 2px;
    text-shadow: 0 0 4px rgba(123, 216, 224, 0.55);
    pointer-events: none;
}
.live-now.is-visible {
    opacity: 0.86;
}

/* Active link underline — phosphor cyan */
a:hover {
    color: var(--phosphorCyan);
}

/* Selection */
::selection {
    background: var(--candle);
    color: var(--ink);
}

/* Reduced motion ----------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .row,
    .row .terms,
    .section-card {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
        animation: none !important;
    }
    #candle-cursor .candle-flame,
    #candle-cursor .candle-mid,
    #candle-cursor .candle-corona {
        animation: none !important;
    }
    html { scroll-behavior: auto; }
}

/* Responsive --------------------------------------------------------------- */
@media (max-width: 700px) {
    .ledger { padding: 48px 18px 64px; }
    .preface-body--right { margin-left: 0; margin-right: 0; }
    .preface-body:not(:first-child) { columns: 1; }
    .marginalia { margin-left: 0; max-width: 100%; }
    .section-letter { font-size: 64pt; }
    .section-title { left: 100px; font-size: 17px; top: 24px; }
    .tipped-in--candle { margin-right: 0; }
    .tipped-in--folio { margin-left: 0; }
    .tipped-in--printer { margin-right: 0; }
    .row { grid-template-columns: 1fr; gap: 4px; }
    .row::before { display: none; }
    .name { box-shadow: none; }
    .toc { right: 8px; top: auto; bottom: 8px; transform: none; }
    .toc ul { flex-direction: row; gap: 6px; padding: 8px; }
    .toc a { font-size: 14px; }
    .toc-marker { display: none; }
    body { cursor: auto; }
    #candle-cursor { display: none; }
}
