/* ======================================================
   scriptswirl.com -- Editorial Folio
   Diagonal-sections, variable-fluid, warm-earthy.
   ====================================================== */

:root {
    --espresso: #2C1810;
    --ink-brown: #3D2B1F;
    --bark:     #6B4F3A;
    --leather:  #8B7355;
    --sage:     #8A9A7E;
    --cream:    #F7F2EA;
    --linen:    #EDE5D8;

    --wonk: 0;
    --opsz: 72;
    --wght: 900;

    --font-display: "Fraunces", "Playfair Display", Georgia, serif;
    --font-body:    "Crimson Pro", "Crimson Text", Georgia, serif;
    --font-mono:    "Overpass Mono", "IBM Plex Mono", ui-monospace, monospace;
}

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

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

body {
    font-family: var(--font-body);
    color: var(--ink-brown);
    background: var(--cream);
    overflow-x: hidden;
    font-size: clamp(1rem, 1.1vw, 1.1rem);
    line-height: 1.76;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

em { font-style: italic; }

/* --------------------------------------------------
   Particle field -- ink motes spiraling
   -------------------------------------------------- */

.particle-field {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.particle-paths { display: none; }

.mote {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--bark);
    border-radius: 50%;
    opacity: 0.22;
    top: 0;
    left: 0;
    offset-rotate: 0deg;
    will-change: offset-distance, opacity, transform;
}

/* Spiral path 1 -- center swirl */
.mote-1 {
    offset-path: path('M 800,500 C 900,500 950,600 880,660 C 790,730 660,700 640,580 C 610,420 820,320 960,420 C 1120,540 1080,780 860,840 C 600,910 360,740 380,500 C 400,220 720,60 980,160');
    animation: drift-1 18s linear infinite;
}
.mote-2 {
    offset-path: path('M 800,500 C 900,500 950,600 880,660 C 790,730 660,700 640,580 C 610,420 820,320 960,420 C 1120,540 1080,780 860,840 C 600,910 360,740 380,500 C 400,220 720,60 980,160');
    animation: drift-1 22s linear infinite;
    animation-delay: -6s;
    width: 2px; height: 2px;
    opacity: 0.18;
}
.mote-3 {
    offset-path: path('M 800,500 C 900,500 950,600 880,660 C 790,730 660,700 640,580 C 610,420 820,320 960,420 C 1120,540 1080,780 860,840 C 600,910 360,740 380,500 C 400,220 720,60 980,160');
    animation: drift-1 16s linear infinite;
    animation-delay: -11s;
}
/* Spiral path 2 -- left */
.mote-4 {
    offset-path: path('M 300,200 C 420,220 500,320 460,420 C 410,550 240,570 190,460 C 130,330 290,160 440,200 C 640,260 720,500 580,660 C 420,840 140,800 80,580 C 20,330 220,80 520,60');
    animation: drift-2 20s linear infinite;
}
.mote-5 {
    offset-path: path('M 300,200 C 420,220 500,320 460,420 C 410,550 240,570 190,460 C 130,330 290,160 440,200 C 640,260 720,500 580,660 C 420,840 140,800 80,580 C 20,330 220,80 520,60');
    animation: drift-2 15s linear infinite;
    animation-delay: -4s;
    width: 2px; height: 2px;
}
.mote-6 {
    offset-path: path('M 300,200 C 420,220 500,320 460,420 C 410,550 240,570 190,460 C 130,330 290,160 440,200 C 640,260 720,500 580,660 C 420,840 140,800 80,580 C 20,330 220,80 520,60');
    animation: drift-2 19s linear infinite;
    animation-delay: -9s;
    opacity: 0.15;
}
/* Spiral path 3 -- right */
.mote-7 {
    offset-path: path('M 1300,800 C 1180,810 1080,720 1120,600 C 1170,450 1380,420 1440,540 C 1510,680 1360,860 1180,860 C 940,860 780,680 820,460 C 860,220 1140,80 1380,180 C 1580,260 1640,520 1520,700');
    animation: drift-3 14s linear infinite;
}
.mote-8 {
    offset-path: path('M 1300,800 C 1180,810 1080,720 1120,600 C 1170,450 1380,420 1440,540 C 1510,680 1360,860 1180,860 C 940,860 780,680 820,460 C 860,220 1140,80 1380,180 C 1580,260 1640,520 1520,700');
    animation: drift-3 17s linear infinite;
    animation-delay: -5s;
}
.mote-9 {
    offset-path: path('M 1300,800 C 1180,810 1080,720 1120,600 C 1170,450 1380,420 1440,540 C 1510,680 1360,860 1180,860 C 940,860 780,680 820,460 C 860,220 1140,80 1380,180 C 1580,260 1640,520 1520,700');
    animation: drift-3 20s linear infinite;
    animation-delay: -13s;
    width: 2px; height: 2px;
}
.mote-10 {
    offset-path: path('M 800,500 C 900,500 950,600 880,660 C 790,730 660,700 640,580 C 610,420 820,320 960,420 C 1120,540 1080,780 860,840 C 600,910 360,740 380,500 C 400,220 720,60 980,160');
    animation: drift-1 13s linear infinite;
    animation-delay: -3s;
    opacity: 0.2;
}

@keyframes drift-1 {
    0%   { offset-distance: 0%;   opacity: 0; }
    10%  { opacity: 0.24; }
    90%  { opacity: 0.22; }
    100% { offset-distance: 100%; opacity: 0; }
}
@keyframes drift-2 {
    0%   { offset-distance: 0%;   opacity: 0; }
    12%  { opacity: 0.2; }
    88%  { opacity: 0.18; }
    100% { offset-distance: 100%; opacity: 0; }
}
@keyframes drift-3 {
    0%   { offset-distance: 0%;   opacity: 0; }
    14%  { opacity: 0.22; }
    86%  { opacity: 0.2; }
    100% { offset-distance: 100%; opacity: 0; }
}

/* --------------------------------------------------
   Folio base -- every section is a folio
   -------------------------------------------------- */

.folio {
    position: relative;
    padding: clamp(4rem, 10vh, 9rem) clamp(1.5rem, 6vw, 7rem);
    min-height: 100vh;
    z-index: 2;
}

.kicker {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--leather);
    margin-bottom: 1.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(139, 115, 85, 0.4);
}

.kicker-light {
    color: var(--linen);
    border-color: rgba(237, 229, 216, 0.3);
}

/* --------------------------------------------------
   Folio I -- The Cover
   Diagonal split 5deg: upper espresso / lower cream
   -------------------------------------------------- */

.folio-cover {
    background: linear-gradient(175deg,
        var(--espresso) 0%,
        var(--espresso) 49.5%,
        var(--cream)   50.5%,
        var(--cream)   100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

.cover-split { display: none; }

.masthead {
    position: absolute;
    top: clamp(1.2rem, 3vw, 2.6rem);
    left: clamp(1.5rem, 6vw, 7rem);
    right: clamp(1.5rem, 6vw, 7rem);
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--linen);
    z-index: 4;
}

.cover-meta {
    position: absolute;
    top: clamp(5rem, 12vh, 9rem);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 1.6rem;
    flex-wrap: wrap;
    justify-content: center;
    z-index: 4;
}

.meta-tag {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--leather);
    padding: 0.35rem 0.9rem;
    border: 1px solid var(--leather);
    border-radius: 0;
    background: transparent;
}

.cover-title {
    position: relative;
    font-family: var(--font-display);
    font-size: clamp(3rem, 16vw, 13rem);
    font-weight: 900;
    line-height: 0.85;
    letter-spacing: -0.03em;
    font-variation-settings: "WONK" var(--wonk, 0), "opsz" 144, "wght" 900;
    margin: 0;
    z-index: 3;
    text-align: center;
    transform: rotate(-2deg);
}

.cover-word {
    display: inline-block;
    background: linear-gradient(175deg,
        var(--cream) 0%,
        var(--cream) 49.5%,
        var(--espresso) 50.5%,
        var(--espresso) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    padding: 0.12em 0.1em;
}

.cover-subtitle {
    position: absolute;
    bottom: clamp(6rem, 14vh, 10rem);
    left: 50%;
    transform: translateX(-50%);
    max-width: 38ch;
    font-family: var(--font-body);
    font-style: italic;
    font-size: clamp(1rem, 1.3vw, 1.25rem);
    line-height: 1.6;
    color: var(--ink-brown);
    z-index: 4;
    text-align: center;
}

.folio-number {
    position: absolute;
    bottom: clamp(2rem, 5vh, 3.6rem);
    left: clamp(1.5rem, 6vw, 7rem);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-brown);
    z-index: 4;
}

.folio-number span:first-child { color: var(--espresso); font-weight: 600; }

.cover-scroll-hint {
    position: absolute;
    bottom: clamp(2rem, 5vh, 3.6rem);
    right: clamp(1.5rem, 6vw, 7rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink-brown);
    z-index: 4;
    opacity: 0.7;
}

.cover-scroll-hint svg {
    animation: hint-bob 2.8s ease-in-out infinite;
    color: var(--ink-brown);
}

@keyframes hint-bob {
    0%, 100% { transform: translateY(0); opacity: 0.6; }
    50%      { transform: translateY(6px); opacity: 1; }
}

/* --------------------------------------------------
   Folio II -- The Spread
   Two-column with diagonal boundary between them.
   -------------------------------------------------- */

.folio-spread {
    background: var(--cream);
    clip-path: polygon(0 4%, 100% 0, 100% 96%, 0 100%);
    margin-top: -4vh;
    padding-top: clamp(7rem, 14vh, 12rem);
    padding-bottom: clamp(7rem, 14vh, 12rem);
}

.spread-head {
    max-width: 1200px;
    margin: 0 auto clamp(3rem, 6vh, 5rem) auto;
    padding-left: clamp(0rem, 4vw, 4rem);
}

.spread-title {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 5vw, 4.4rem);
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.015em;
    color: var(--espresso);
    font-variation-settings: "WONK" 0, "opsz" 36, "wght" 400;
    max-width: 16ch;
}

.spread-title em {
    font-style: italic;
    color: var(--bark);
    font-variation-settings: "WONK" 1, "opsz" 36, "wght" 500;
}

.spread-grid {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: clamp(2rem, 6vw, 6rem);
    align-items: start;
}

.spread-grid::before {
    /* Diagonal divider between columns */
    content: "";
    position: absolute;
    top: -3%;
    bottom: -3%;
    left: 50%;
    width: 1px;
    background: var(--bark);
    transform: rotate(4deg);
    transform-origin: center;
    opacity: 0.55;
}

.spread-column p {
    margin-bottom: 1.2rem;
    color: var(--ink-brown);
    font-size: clamp(1rem, 1.15vw, 1.12rem);
}

.spread-column p.drop { text-indent: 0; }

.dropcap {
    float: left;
    font-family: var(--font-display);
    font-size: 5.2rem;
    line-height: 0.82;
    padding: 0.35rem 0.55rem 0 0;
    margin-top: 0.1rem;
    color: var(--espresso);
    font-variation-settings: "WONK" 1, "opsz" 144, "wght" 900;
}

.cite {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--leather);
    margin-top: 1.6rem;
}

.spread-plate {
    position: relative;
    padding-left: clamp(1rem, 3vw, 3rem);
}

.fern-frond {
    width: 100%;
    max-width: 420px;
    height: auto;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 1px 0 rgba(44, 24, 16, 0.04));
}

.plate-caption {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    color: var(--leather);
    text-align: center;
    margin-top: 1.4rem;
    font-style: normal;
}

/* --------------------------------------------------
   Folio III -- The Plate
   Raw-linen background, full-width grand illustration.
   -------------------------------------------------- */

.folio-plate {
    background: var(--linen);
    clip-path: polygon(0 0, 100% 4%, 100% 100%, 0 96%);
    margin-top: -4vh;
    padding-top: clamp(8rem, 16vh, 13rem);
    padding-bottom: clamp(8rem, 16vh, 13rem);
}

.plate-head {
    max-width: 1200px;
    margin: 0 auto clamp(2.6rem, 5vh, 4rem) auto;
    text-align: right;
    padding-right: clamp(0rem, 4vw, 4rem);
}

.plate-head .spread-title {
    margin-left: auto;
    color: var(--espresso);
}

.plate-panel {
    max-width: 1400px;
    margin: 0 auto;
    padding: clamp(1rem, 4vw, 3rem);
    border-top: 1px solid var(--bark);
    border-bottom: 1px solid var(--bark);
    position: relative;
}

.plate-panel::before, .plate-panel::after {
    content: "";
    position: absolute;
    left: 4%;
    right: 4%;
    height: 1px;
    background: var(--bark);
    opacity: 0.3;
}
.plate-panel::before { top: 8px; }
.plate-panel::after  { bottom: 8px; }

.grand-plate {
    width: 100%;
    height: auto;
    display: block;
}

/* --------------------------------------------------
   Folio IV -- The Colophon
   Dark espresso, centered, diagonal top cut.
   -------------------------------------------------- */

.folio-colophon {
    background: var(--espresso);
    color: var(--cream);
    clip-path: polygon(0 6%, 100% 0, 100% 100%, 0 100%);
    margin-top: -4vh;
    padding-top: clamp(9rem, 18vh, 14rem);
    padding-bottom: clamp(6rem, 12vh, 10rem);
    text-align: center;
    position: relative;
}

.corner-leaf {
    position: absolute;
    width: clamp(70px, 10vw, 120px);
    height: clamp(70px, 10vw, 120px);
    opacity: 0.55;
}

.corner-leaf-tl {
    top: 14%;
    left: 8%;
}
.corner-leaf-br {
    bottom: 8%;
    right: 8%;
}

.colophon-inner {
    max-width: 62ch;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.colophon-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 6.5rem);
    font-weight: 400;
    line-height: 0.9;
    margin: 1rem 0 2rem 0;
    color: var(--cream);
    font-variation-settings: "WONK" 1, "opsz" 144, "wght" 400;
    letter-spacing: -0.01em;
}
.colophon-title em { font-style: italic; color: var(--sage); }

.colophon-text {
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.2vw, 1.18rem);
    line-height: 1.7;
    color: var(--linen);
    margin-bottom: 3rem;
    font-style: italic;
}

.colophon-text .pulse { color: var(--sage); font-style: normal; font-weight: 600; }

.colophon-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.3rem 2rem;
    max-width: 46ch;
    margin: 0 auto 2.6rem auto;
    text-align: left;
    padding-top: 1.6rem;
    border-top: 1px solid rgba(237, 229, 216, 0.2);
}

.colophon-meta div {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.colophon-meta dt {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--leather);
}

.colophon-meta dd {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--linen);
}

.colophon-mark {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 2.4rem;
    color: var(--sage);
    transform: rotate(90deg);
    margin-top: 0.6rem;
}

/* --------------------------------------------------
   Pulse attention -- living words
   -------------------------------------------------- */

.pulse {
    display: inline-block;
    color: var(--bark);
    font-style: italic;
    animation: pulse-attention 4s ease-in-out infinite;
}

.folio-colophon .pulse { color: var(--sage); }

@keyframes pulse-attention {
    0%, 100% { opacity: 0.7; }
    50%      { opacity: 1;   }
}

/* --------------------------------------------------
   Responsive
   -------------------------------------------------- */

@media (max-width: 860px) {
    .spread-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    .spread-grid::before { display: none; }
    .plate-head { text-align: left; padding-right: 0; }
    .plate-head .spread-title { margin-left: 0; }
    .masthead { font-size: 0.6rem; }
    .cover-meta { top: 4.5rem; gap: 0.7rem; }
    .meta-tag { font-size: 0.58rem; padding: 0.25rem 0.6rem; }
    .cover-subtitle { bottom: 7rem; font-size: 0.95rem; padding: 0 1rem; }
    .cover-scroll-hint, .folio-number { font-size: 0.6rem; }
    .corner-leaf-tl, .corner-leaf-br { opacity: 0.35; }
    .colophon-meta { grid-template-columns: 1fr; }
    .dropcap { font-size: 4rem; }
}

@media (max-width: 560px) {
    .cover-title { font-size: clamp(2.6rem, 18vw, 5rem); }
    .folio { padding: 4rem 1.2rem; }
    .folio-spread, .folio-plate, .folio-colophon {
        padding-top: 6rem; padding-bottom: 6rem;
    }
}
