@import url('https://fonts.googleapis.com/css2?family=Bodoni+Moda:ital,opsz,wght@0,6..96,400;0,6..96,500;0,6..96,800;1,6..96,500;1,6..96,800&family=Cormorant+Garamond:ital,wght@0,400;0,500;1,400&family=Cormorant+SC:wght@400;500&family=Major+Mono+Display&display=swap');

/* ============================================================
   hinagiku.quest — Vol. 1, No. 1: Daisy
   A lost issue of a 1973 Japanese cultural quarterly
   ============================================================ */

:root {
    --ink:       #0E0F12;   /* Pressroom Ink */
    --stock:     #F2EEE3;   /* Antique Stock */
    --mercury:   #A8B0B5;   /* Chrome Mercury */
    --silver:    #D9D2C2;   /* Tarnished Silver */
    --gunmetal:  #3B4147;   /* Gunmetal Shadow */
    --gold:      #E6C77D;   /* Daisy Mark Gold */

    --display: 'Bodoni Moda', 'Cormorant Garamond', serif;
    --stamp:   'Major Mono Display', 'Cormorant Garamond', monospace;
    --body:    'Cormorant Garamond', Georgia, serif;
    --caps:    'Cormorant SC', 'Cormorant Garamond', serif;

    --baseline: 8px;
    /* hairline rule with letterpress noise via inline SVG border-image */
    --hairline: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='3'><path d='M0 1.5 Q20 1.1 40 1.6 T80 1.4 T120 1.7 T160 1.5' stroke='%23A8B0B5' stroke-width='0.6' fill='none'/></svg>");
    --hairline-silver: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='3'><path d='M0 1.5 Q20 1.2 40 1.6 T80 1.3 T120 1.7 T160 1.5' stroke='%23D9D2C2' stroke-width='0.6' fill='none'/></svg>");
    /* chrome crosshair cursor */
    --crosshair: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14'><line x1='7' y1='1' x2='7' y2='13' stroke='%23A8B0B5' stroke-width='1'/><line x1='1' y1='7' x2='13' y2='7' stroke='%23A8B0B5' stroke-width='1'/></svg>") 7 7, crosshair;
}

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

html, body {
    height: 100%;
    background: var(--stock);
    color: var(--ink);
    font-family: var(--body);
    font-feature-settings: "onum" 1, "liga" 1;
    overflow: hidden;
}

body {
    /* faint paper grain */
    background-image:
        radial-gradient(circle at 18% 22%, rgba(59,65,71,0.018) 0, transparent 60%),
        radial-gradient(circle at 82% 78%, rgba(14,15,18,0.02) 0, transparent 55%);
}

/* ---------------- The Book: horizontal spread track ---------------- */
.book {
    display: flex;
    flex-direction: row;
    height: 100vh;
    width: 100vw;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    cursor: var(--crosshair);
    scrollbar-width: none;
}
.book::-webkit-scrollbar { display: none; }

/* ---------------- A spread = recto + verso ---------------- */
.spread {
    position: relative;
    flex: 0 0 100vw;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: row;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    /* page-turn shear, set on the active spread by JS via --turn */
    transform: translateX(var(--turn, 0)) skewY(0.4deg);
    transition: transform 600ms cubic-bezier(0.22, 0.61, 0.36, 1);
    transform-origin: top left;
    --progress: 0;
}
/* the gutter seam at 50vw */
.spread::after {
    content: "";
    position: absolute;
    top: 0; bottom: 0;
    left: 50%;
    width: 1px;
    background: var(--silver);
    border-image: var(--hairline-silver) 0 fill / 1px / 0 stretch;
    opacity: 0.7;
    pointer-events: none;
    z-index: 4;
}

.page {
    flex: 0 0 50vw;
    width: 50vw;
    height: 100vh;
    padding: clamp(2.2rem, 5vw, 5rem) clamp(2rem, 4.5vw, 4.6rem) clamp(3.4rem, 6vw, 5.5rem);
    position: relative;
    overflow: hidden;
}
.page--verso { /* left page: 5 columns of marginalia */ }
.page--recto { /* right page: 7 columns of principal text */
    display: flex;
    flex-direction: column;
}

/* ---------------- The Folio ---------------- */
.folio {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: calc(var(--baseline) * 1.5);
    margin-bottom: calc(var(--baseline) * 3);
    border-bottom: 1px solid var(--mercury);
    border-image: var(--hairline) 0 0 1 0 fill / 0 0 1px 0 / 0 stretch;
    position: relative;
    font-family: var(--caps);
    text-transform: uppercase;
    letter-spacing: 0.4em;
    font-size: 0.62rem;
    color: var(--gunmetal);
    line-height: calc(var(--baseline) * 2);
}
.folio__issue { white-space: nowrap; }
.folio__num {
    font-family: var(--display);
    letter-spacing: 0.1em;
    font-size: 0.78rem;
    font-weight: 500;
}
.daisy-mark--folio {
    position: absolute;
    top: -2px;
    right: -6px;
    width: 14px;
    height: 14px;
}

/* hairline rule helper (used at top of recto) */
.rule--folio-bottom {
    height: 1px;
    margin-bottom: calc(var(--baseline) * 3);
    border-bottom: 1px solid var(--mercury);
    border-image: var(--hairline) 0 0 1 0 fill / 0 0 1px 0 / 0 stretch;
}

/* ---------------- Principal text block (recto) ---------------- */
.text-block {
    max-width: 34em;
    margin-left: auto;
    margin-right: 0;
}
.spread-title {
    font-family: var(--display);
    font-weight: 500;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    letter-spacing: -0.01em;
    line-height: calc(var(--baseline) * 4);
    margin-bottom: calc(var(--baseline) * 3);
    color: var(--ink);
}
.text-block p {
    font-size: 1.05rem;
    line-height: 1.72;
    margin-bottom: calc(var(--baseline) * 1.5);
    text-align: left;            /* ragged-right */
    text-indent: 1.2em;          /* hand-set indent */
    hyphens: none;
}
.text-block p.opening { text-indent: 0; }
.text-block em { font-style: italic; }

/* drop-cap — Major Mono Display, 4 lines deep, chrome mercury */
.dropcap {
    font-family: var(--stamp);
    font-size: 8rem;
    line-height: 0.72;
    float: left;
    margin: 0.08em 0.14em -0.06em -0.02em;
    color: var(--mercury);
    position: relative;
}
.dropcap::after {
    /* printer's anchor: hairline serif rule beneath the cap */
    content: "";
    position: absolute;
    left: 0; right: 0.18em;
    bottom: 0.05em;
    height: 1px;
    background: var(--mercury);
    opacity: 0.55;
}

/* ---------------- Marginalia (verso) ---------------- */
.marginalia { max-width: 24em; }
.margin-label {
    font-family: var(--caps);
    text-transform: uppercase;
    letter-spacing: 0.32em;
    font-size: 0.72rem;
    color: var(--gunmetal);
    margin-bottom: calc(var(--baseline) * 2);
    padding-bottom: calc(var(--baseline) * 0.75);
    border-bottom: 1px solid var(--silver);
    border-image: var(--hairline-silver) 0 0 1 0 fill / 0 0 1px 0 / 0 stretch;
}
.margin-note {
    font-style: italic;
    font-size: 0.84rem;
    line-height: 1.6;
    color: var(--gunmetal);
    margin-bottom: calc(var(--baseline) * 1.5);
}
.margin-note em { font-style: normal; }
.footnote {
    font-size: 0.78rem;
    line-height: 1.55;
    color: var(--mercury);
    margin-top: calc(var(--baseline) * 2.5);
    padding-top: calc(var(--baseline) * 1);
    border-top: 1px solid var(--silver);
    border-image: var(--hairline-silver) 1 0 0 0 fill / 1px 0 0 0 / 0 stretch;
}
.fn-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.15em;
    height: 1.15em;
    margin-right: 0.4em;
    border: 0.5px solid var(--mercury);
    border-radius: 50%;
    font-size: 0.7em;
    font-family: var(--stamp);
    vertical-align: 0.05em;
    color: var(--gunmetal);
}

/* register list (§ IV) */
.register-list {
    list-style: none;
    margin-bottom: calc(var(--baseline) * 1.5);
}
.register-list li {
    font-size: 0.8rem;
    line-height: 1.55;
    color: var(--gunmetal);
    padding: calc(var(--baseline) * 0.75) 0;
    border-bottom: 1px solid var(--silver);
    border-image: var(--hairline-silver) 0 0 1 0 fill / 0 0 1px 0 / 0 stretch;
}
.register-list li em { font-style: italic; }
.reg-key {
    font-family: var(--stamp);
    font-size: 0.68rem;
    color: var(--mercury);
    margin-right: 0.6em;
    letter-spacing: 0.08em;
}
.reg-ink {
    font-family: var(--stamp);
    font-size: 0.7rem;
    color: var(--mercury);
}

/* pressed-flower silhouette in the deep margin (§ II) */
.pressed-flower {
    position: absolute;
    bottom: clamp(3rem, 7vw, 6rem);
    right: clamp(1.5rem, 3vw, 3rem);
    width: clamp(90px, 11vw, 150px);
    height: auto;
    opacity: 0.04;
    color: var(--silver);
    pointer-events: none;
    z-index: 0;
}

/* ---------------- Masthead spread ---------------- */
.spread--masthead .page--recto {
    align-items: center;
    justify-content: center;
    text-align: center;
}
.masthead-verso {
    position: absolute;
    bottom: clamp(3rem, 7vw, 6rem);
    left: clamp(2rem, 4.5vw, 4.6rem);
    right: clamp(2rem, 4.5vw, 4.6rem);
}
.masthead-kicker {
    font-family: var(--caps);
    text-transform: uppercase;
    letter-spacing: 0.34em;
    font-size: 0.72rem;
    color: var(--gunmetal);
    margin-bottom: calc(var(--baseline) * 1.5);
}
.masthead-meta {
    font-style: italic;
    font-size: 0.92rem;
    color: var(--mercury);
}
.masthead-recto {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.daisy-mark--seal {
    width: 220px;
    height: 220px;
    margin-bottom: calc(var(--baseline) * 4);
    animation: seal-rotate 36s linear infinite;
    transform-origin: 50% 50%;
}
@keyframes seal-rotate { to { transform: rotate(360deg); } }
.masthead-title {
    font-family: var(--display);
    font-weight: 800;
    font-size: clamp(3.2rem, 8.5vw, 7.6rem);
    line-height: 0.95;
    letter-spacing: -0.02em;
    color: var(--ink);
    display: flex;
    flex-direction: column;
    align-items: center;
}
.masthead-title__line { display: block; }
.masthead-title__flower {
    font-style: italic;
    font-size: 0.42em;
    font-weight: 500;
    color: var(--gunmetal);
    letter-spacing: 0.1em;
    margin-top: 0.2em;
}
.masthead-sub {
    margin-top: calc(var(--baseline) * 2.5);
    font-style: italic;
    font-size: 1rem;
    color: var(--mercury);
    max-width: 28em;
}

/* ---------------- The Plate (border-animate) ---------------- */
.plate {
    position: relative;
    width: 100%;
    aspect-ratio: 1.618 / 1;
    margin: calc(var(--baseline) * 2) 0 calc(var(--baseline) * 2);
    display: flex;
    align-items: center;
    justify-content: center;
    /* Gunmetal cast shadow under the plate */
    box-shadow: 0 calc(var(--baseline) * 1.5) calc(var(--baseline) * 4) -8px rgba(59,65,71,0.35);
}
.plate__frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.plate__rect {
    animation: plate-march 18s linear infinite;
    transition: stroke 400ms ease;
}
@keyframes plate-march { to { stroke-dashoffset: -28; } }
.plate:hover .plate__rect {
    animation-duration: 9s;
    stroke: var(--gold);
}
.plate__daisy {
    width: 46%;
    height: 46%;
}
.plate__caption {
    position: absolute;
    bottom: -1.6em;
    left: 0;
    font-family: var(--stamp);
    text-transform: lowercase;
    font-size: 0.66rem;
    letter-spacing: 0.14em;
    color: var(--mercury);
}

/* ---------------- Colophon spread ---------------- */
.spread--colophon::after { opacity: 0.4; }
.colophon-verso { max-width: 26em; }
.colophon-line {
    font-size: 0.86rem;
    line-height: 1.6;
    color: var(--gunmetal);
    margin-bottom: calc(var(--baseline) * 1.5);
}
.colophon-line em { font-style: italic; }
.col-key, .reg-key {
    font-family: var(--caps);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.66rem;
    color: var(--mercury);
    margin-right: 0.7em;
}
.colophon-recto {
    margin: auto 0 auto auto;
    max-width: 28em;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.daisy-mark--colophon {
    width: 96px;
    height: 96px;
    margin-bottom: calc(var(--baseline) * 3);
}
.colophon-close {
    font-family: var(--display);
    font-weight: 500;
    font-style: italic;
    font-size: clamp(1.4rem, 2.6vw, 2rem);
    color: var(--ink);
    margin-bottom: calc(var(--baseline) * 2);
}
.colophon-sign {
    font-size: 0.92rem;
    font-style: italic;
    line-height: 1.65;
    color: var(--mercury);
    margin-bottom: calc(var(--baseline) * 3);
}
.colophon-fin {
    font-family: var(--caps);
    text-transform: uppercase;
    letter-spacing: 0.4em;
    font-size: 0.72rem;
    color: var(--gunmetal);
}

/* ---------------- Lens-flare reading lamp ---------------- */
.lens-flare {
    position: fixed;
    width: 64vw;
    height: 64vw;
    left: 0;
    top: 0;
    pointer-events: none;
    mix-blend-mode: screen;
    z-index: 3;
    will-change: transform;
    /* initial: below the lower-right of the first spread */
    transform: translate(72vw, 88vh);
}
.flare-star { mix-blend-mode: screen; }

/* ---------------- Folio strip ---------------- */
.folio-strip {
    position: fixed;
    bottom: clamp(0.9rem, 2vw, 1.6rem);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: clamp(1.1rem, 2.6vw, 2rem);
    z-index: 6;
    padding: 0.4rem 0.9rem;
}
.folio-strip__item {
    font-family: var(--display);
    font-weight: 500;
    font-size: 0.86rem;
    letter-spacing: 0.1em;
    color: var(--silver);
    text-decoration: none;
    position: relative;
    padding-bottom: 0.3em;
    cursor: pointer;
    transition: color 200ms ease;
}
.folio-strip__item::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1px;
    background: var(--ink);
    transform: scaleX(0) translateX(0);
    transform-origin: left;
    transition: transform 200ms ease;
}
.folio-strip__item:hover {
    color: var(--gunmetal);
}
.folio-strip__item:hover::after {
    transform: scaleX(1) translateX(4px);
}
.folio-strip__item.is-current {
    color: var(--ink);
}
.folio-strip__item.is-current::after {
    transform: scaleX(1);
}

/* ---------------- Mobile: vertical book, seam rotated ---------------- */
@media (max-width: 880px) {
    .book {
        flex-direction: column;
        overflow-x: hidden;
        overflow-y: auto;
        scroll-snap-type: y mandatory;
    }
    .spread {
        flex: 0 0 100vh;
        flex-direction: column;
        transform: translateY(var(--turn, 0)) skewX(0.4deg);
    }
    .spread::after {
        top: 50%;
        left: 0; right: 0;
        bottom: auto;
        width: auto;
        height: 1px;
        border-image: var(--hairline-silver) 0 0 1 0 fill / 0 0 1px 0 / 0 stretch;
    }
    .page {
        flex: 0 0 50vh;
        width: 100vw;
        height: 50vh;
        padding: clamp(1.4rem, 5vw, 2.4rem) clamp(1.4rem, 6vw, 2.6rem) clamp(2rem, 6vw, 3rem);
    }
    .text-block { margin-left: 0; }
    .text-block p { font-size: 0.94rem; }
    .dropcap { font-size: 5rem; }
    .daisy-mark--seal { width: 130px; height: 130px; margin-bottom: calc(var(--baseline) * 2); }
    .masthead-verso { bottom: 1.4rem; }
    .pressed-flower { width: 90px; }
    .lens-flare { width: 90vw; height: 90vw; transform: translate(10vw, 88vh); }
    .colophon-recto { text-align: left; align-items: flex-start; margin: 0; }
}
