/* ============================================================
   HECATE NAIR — BLACKMERE THEME
   This stylesheet affects ONLY the book page (.hn-page).
   Keep your main css/style.css unchanged.
   Palette: midnight navy, rose-pink, soft silver.
   ============================================================ */

.hn-page {
    --color-background: #0b1426;
    --color-surface: #152139;
    --color-primary: #e6b8c7;
    --color-primary-dark: #f1cbd8;
    --color-text: #faf5f7;
    --color-text-muted: #bec5d3;
    --color-border: #34415b;
    background: #0b1426;
    color: var(--color-text);
}

.hn-page .site-header {
    position: relative;
    z-index: 4;
    background: #101c31;
    border-bottom-color: rgba(235,195,211,.17);
}

.hn-page .brand-name,
.hn-page .main-nav a,
.hn-page .footer-logo,
.hn-page .footer-column a { color: var(--color-text); }

.hn-page .main-nav a:hover,
.hn-page .footer-column a:hover { color: var(--color-primary-dark); }

.hn-page .site-footer {
    position: relative;
    z-index: 2;
    background: #101c31;
    border-top-color: rgba(235,195,211,.18);
}

.hn-page .social-box { background: #101c31; }
.hn-page .social-link { background: #26314a; }
.hn-page .footer-column a.social-link { color: #efc3d1; }
.hn-page .footer-column a.social-link:hover { color: #1c2435; }
.hn-page .social-link:hover { background: #e6b8c7; }

.hn-page #hn-site { overflow: clip; }
.hn-page main { background: #0b1426; }

/* Discreet paper-grain overlay. Entirely decorative, non-interactive. */
.hn-page #hn-site::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    opacity: .10;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.76' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='.3'/%3E%3C/svg%3E");
}

/* ============================================================
   01. CINEMATIC INTRO — only if opened from the featured button
   ============================================================ */
.hn-intro-screen {
    display: none;
    position: fixed;
    z-index: 9999;
    inset: 0;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    background: #040712;
    color: #fff7fa;
    opacity: 1;
    transition: opacity 1050ms ease;
}

.hn-intro-pending .hn-intro-screen { display: flex; }
.hn-intro-screen.is-leaving { opacity: 0; pointer-events: none; }

.hn-intro-quote {
    max-width: 980px;
    margin: 0;
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: clamp(46px, 7.5vw, 112px);
    line-height: 1.04;
    letter-spacing: -.035em;
    text-align: center;
    text-wrap: balance;
}

.hn-intro-quote em,
.hn-opening-quote em {
    color: #edc2d0;
    font-weight: 400;
}

.hn-intro-pending .hn-intro-quote {
    animation: hn-quote-appears 1550ms cubic-bezier(.16,.7,.23,1) both;
}

@keyframes hn-quote-appears {
    from { opacity: 0; transform: translateY(18px); filter: blur(4px); }
    to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.hn-skip-intro {
    position: absolute;
    right: clamp(24px,4vw,65px);
    bottom: 29px;
    padding: 9px 2px;
    color: #e6b8c7;
    background: none;
    border: 0;
    border-bottom: 1px solid rgba(230,184,199,.38);
    font-size: 12px;
    letter-spacing: .06em;
    cursor: pointer;
}

.hn-skip-intro:hover { color: #fff; }
.hn-skip-intro:focus-visible { outline: 2px solid #f0c9d5; outline-offset: 5px; }

/* ============================================================
   02. GOTHIC OPENING — architecture, celestial movement, quote
   ============================================================ */
.hn-opening {
    position: relative;
    isolation: isolate;
    display: grid;
    place-items: center;
    min-height: clamp(620px, 87svh, 860px);
    padding: 100px 24px 120px;
    overflow: hidden;
    background:
      radial-gradient(ellipse at 50% 45%, rgba(94,70,112,.23), transparent 45%),
      radial-gradient(ellipse at 15% 12%, rgba(54,82,119,.15), transparent 48%),
      linear-gradient(180deg, #111e33 0%, #10192e 60%, #0b1426 100%);
    text-align: center;
}

.hn-opening::before {
    content: "";
    position: absolute;
    inset: 20px;
    pointer-events: none;
    border: 1px solid rgba(234,191,208,.13);
}

.hn-opening::after {
    content: "✦";
    position: absolute;
    bottom: 27px;
    left: 50%;
    transform: translateX(-50%);
    color: #e0b1c3;
    font-size: 12px;
    opacity: .7;
}

.hn-starfield,
.hn-gothic-arch,
.hn-astrolabe {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.hn-starfield { z-index: -1; }

.hn-starfield span {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: 4px;
    height: 4px;
    transform: rotate(45deg);
    background: #e7c5d2;
    box-shadow: 0 0 10px 2px rgba(231,197,210,.18);
    opacity: .46;
    animation: hn-star-pulse var(--speed, 8s) ease-in-out var(--delay, 0s) infinite alternate;
}

.hn-starfield span:nth-child(3n) { width: 6px; height: 6px; }
.hn-starfield span:nth-child(4n) { width: 2px; height: 2px; }

@keyframes hn-star-pulse {
    0%, 100% { opacity: .18; transform: rotate(45deg) scale(.8); }
    50% { opacity: .88; transform: rotate(45deg) scale(1.35); }
}

.hn-gothic-arch {
    z-index: -1;
    top: auto;
    bottom: -49px;
    left: 50%;
    right: auto;
    width: min(720px, 83vw);
    height: auto;
    transform: translateX(-50%);
    overflow: visible;
    stroke: rgba(238,194,211,.35);
    stroke-width: 1.5;
}

.hn-arch-major { stroke: rgba(242,203,218,.43); stroke-width: 2; }
.hn-arch-secondary { stroke: rgba(238,194,211,.32); }
.hn-arch-minor { stroke: rgba(238,194,211,.20); }
.hn-arch-tracery { stroke: rgba(238,194,211,.17); }
.hn-arch-rose { stroke: rgba(238,194,211,.27); }
.hn-arch-star { fill: rgba(238,194,211,.31); stroke: none; }
.hn-arch-base { stroke: rgba(238,194,211,.34); }

.hn-astrolabe {
    z-index: -2;
    width: min(900px, 90vw);
    height: auto;
    left: 50%;
    top: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
    stroke: rgba(231,188,207,.19);
    stroke-width: .8;
    animation: hn-celestial-drift 100s linear infinite;
}

.hn-astrolabe-cross { stroke: rgba(231,188,207,.08); }

@keyframes hn-celestial-drift {
    to { transform: translate(-50%,-50%) rotate(360deg); }
}

.hn-opening-content {
    position: relative;
    z-index: 1;
    width: min(100%, 950px);
    margin: 0 auto;
}

.hn-moon-phases {
    display: flex;
    justify-content: center;
    margin: 0 auto 38px;
    opacity: .84;
}

.hn-moon-outline { stroke: #e6b8c7; stroke-width: 1.3; }
.hn-moon-fill { fill: #e6b8c7; }

.hn-opening-quote {
    max-width: 930px;
    margin: 0 auto;
    color: #fdf8fa;
    font-family: var(--font-heading);
    font-size: clamp(55px, 7.6vw, 116px);
    line-height: 1.06;
    letter-spacing: -.037em;
    font-weight: 400;
    text-wrap: balance;
    text-shadow: 0 4px 24px rgba(5,8,16,.55);
}

.hn-ornament-line,
.hn-section-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    color: #dfafc0;
}

.hn-ornament-line {
    width: min(270px, 70vw);
    margin: 36px auto 0;
}

.hn-ornament-line::before,
.hn-ornament-line::after,
.hn-section-divider::before,
.hn-section-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: linear-gradient(90deg, transparent, rgba(231,190,205,.55));
}

.hn-ornament-line::after,
.hn-section-divider::after {
    transform: rotate(180deg);
}

.hn-scroll-down {
    position: absolute;
    z-index: 3;
    bottom: 58px;
    left: 50%;
    transform: translateX(-50%);
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    color: #eac2d0;
    border: 1px solid rgba(231,190,205,.38);
    border-radius: 50%;
    background: rgba(12,18,32,.65);
    transition: color .25s ease, border-color .25s ease, background .25s ease;
}

.hn-scroll-down svg { animation: hn-arrow-drift 3s ease-in-out infinite; }
.hn-scroll-down:hover { color: #fff; border-color: #eac2d0; background: #1c2a43; }
.hn-scroll-down:focus-visible { outline: 2px solid #f1cad7; outline-offset: 5px; }

@keyframes hn-arrow-drift {
    0%, 100% { transform: translateY(-2px); }
    50% { transform: translateY(4px); }
}

/* ============================================================
   03. THE BOOK — no decorative marketing labels or extra slogans
   ============================================================ */
.hn-story {
    position: relative;
    padding: clamp(95px, 11vw, 165px) 40px;
    scroll-margin-top: 32px;
    background:
        radial-gradient(ellipse at 18% 45%, rgba(108,75,113,.11), transparent 49%),
        #0b1426;
}

.hn-story-inner {
    max-width: 1120px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: .86fr 1.14fr;
    gap: clamp(50px, 8vw, 116px);
    align-items: center;
}

.hn-book-art {
    margin: 0;
    width: 100%;
    max-width: 385px;
    justify-self: center;
}

.hn-cover-frame {
    position: relative;
    padding: 13px;
    border: 1px solid rgba(232,189,205,.38);
    background: rgba(232,189,205,.04);
    box-shadow: 0 25px 72px rgba(0,0,0,.38);
}

.hn-cover-frame::before,
.hn-cover-frame::after {
    content: "";
    position: absolute;
    z-index: 1;
    width: 40px;
    height: 40px;
    pointer-events: none;
}

.hn-cover-frame::before {
    top: -7px;
    left: -7px;
    border-top: 1px solid #e7b9ca;
    border-left: 1px solid #e7b9ca;
}

.hn-cover-frame::after {
    bottom: -7px;
    right: -7px;
    border-bottom: 1px solid #e7b9ca;
    border-right: 1px solid #e7b9ca;
}

.hn-cover-frame img {
    display: block;
    width: 100%;
    aspect-ratio: 2/3;
    height: auto;
    object-fit: cover;
}

.hn-book-art figcaption {
    margin-top: 19px;
    color: #aeb6c7;
    font-size: 11px;
    line-height: 1.6;
    font-style: italic;
    text-align: center;
}

.hn-story-copy h1 {
    margin: 0 0 26px;
    font-family: var(--font-heading);
    font-size: clamp(55px, 5.5vw, 91px);
    font-weight: 400;
    line-height: 1;
    letter-spacing: -.03em;
}

.hn-story-copy h1 span {
    display: block;
    margin: 6px 0;
    color: #eab9c9;
    font-size: .51em;
    font-style: italic;
}

.hn-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    padding: 0;
    margin: 0 0 28px;
    list-style: none;
}

.hn-tag {
    padding: 7px 14px;
    border: 1px solid rgba(231,190,205,.37);
    border-radius: 100px;
    background: rgba(231,190,205,.055);
    color: #f0c6d5;
    font-size: 11px;
    line-height: 1.4;
}

.hn-tag-status {
    background: #e6b8c7;
    border-color: #e6b8c7;
    color: #162137;
    font-weight: 700;
    letter-spacing: .075em;
}

.hn-book-blurb {
    max-width: 520px;
    margin: 0;
    color: #f6edf2;
    font-family: var(--font-heading);
    font-size: clamp(25px, 2.6vw, 35px);
    line-height: 1.42;
    font-weight: 400;
}

.hn-section-divider {
    width: min(400px, 75vw);
    margin: 0 auto;
    padding: 0 0 6px;
    opacity: .8;
}

/* ============================================================
   04. THE THREE BLACKMERE FILES — JavaScript reveal
   ============================================================ */
.hn-dossier {
    padding: 100px 40px 125px;
    background:
      radial-gradient(ellipse at 50% 0%, rgba(92,72,111,.13), transparent 50%),
      #0b1426;
}

.hn-dossier-inner { max-width: 1100px; margin: 0 auto; }

.hn-dossier h2 {
    margin: 0 0 44px;
    font-family: var(--font-heading);
    font-size: clamp(56px, 6vw, 84px);
    line-height: 1;
    font-weight: 400;
    text-align: center;
    color: #faf5f7;
}

.hn-dossier-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 18px;
}

.hn-file-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: column;
    gap: 22px;
    width: 100%;
    min-height: 280px;
    padding: 26px 23px 29px;
    border: 1px solid rgba(238,197,212,.26);
    border-radius: 0;
    color: #f5edf1;
    background: linear-gradient(155deg, #1a2942 0%, #111e34 90%);
    cursor: pointer;
    transition: background .3s ease, transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}

.hn-file-card::before,
.hn-file-card::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    opacity: .8;
    pointer-events: none;
}

.hn-file-card::before {
    top: 8px;
    left: 8px;
    border-top: 1px solid #e6b8c7;
    border-left: 1px solid #e6b8c7;
}

.hn-file-card::after {
    bottom: 8px;
    right: 8px;
    border-right: 1px solid #e6b8c7;
    border-bottom: 1px solid #e6b8c7;
}

.hn-file-card:hover,
.hn-file-card[aria-expanded="true"] {
    transform: translateY(-5px);
    background: linear-gradient(155deg, #26334e, #17233c);
    border-color: rgba(238,197,212,.7);
    box-shadow: 0 17px 35px rgba(0,0,0,.25);
}

.hn-file-card:focus-visible { outline: 2px solid #f4d0dd; outline-offset: 5px; }
.hn-file-number { align-self: flex-start; font-size: 11px; letter-spacing: .18em; color: #efc4d2; }
.hn-file-icon { width: 66px; height: 66px; stroke: #dfb8c7; stroke-width: 1.2; opacity: .84; }
.hn-file-title { font-family: var(--font-heading); font-size: clamp(28px, 3vw, 42px); line-height: 1; font-weight: 400; text-align: center; }
.hn-file-corner { position: absolute; right: 23px; top: 20px; color: #e6b8c7; font-size: 20px; transition: transform .3s ease; }
.hn-file-card:hover .hn-file-corner { transform: translate(3px,-3px); }
.hn-file-card[aria-expanded="true"] .hn-file-corner { transform: rotate(90deg); }

.hn-file-panel {
    position: relative;
    margin-top: 20px;
    padding: 46px clamp(27px, 6vw, 75px) 52px;
    min-height: 220px;
    border: 1px solid rgba(238,197,212,.45);
    background: #18263f;
    text-align: center;
    box-shadow: 0 25px 45px rgba(0,0,0,.17);
}

.hn-file-panel[hidden] { display: none; }
.hn-file-panel.is-entering { animation: hn-file-unfold .5s cubic-bezier(.2,.7,.25,1) both; }

@keyframes hn-file-unfold {
    from { opacity: 0; transform: translateY(-11px); }
    to { opacity: 1; transform: translateY(0); }
}

.hn-file-close {
    position: absolute;
    top: 13px;
    right: 18px;
    border: 0;
    background: none;
    color: #ebc2d0;
    font-family: var(--font-body);
    font-size: 31px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
}

.hn-file-close:hover { color: #fff; }
.hn-file-close:focus-visible { outline: 2px solid #f1cbd8; outline-offset: 3px; }
.hn-panel-rule { color: #e6b8c7; font-size: 15px; }

.hn-panel-title {
    margin: 15px 0 17px;
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: clamp(36px, 4vw, 56px);
}

.hn-panel-copy {
    max-width: 590px;
    margin: 0 auto;
    font-size: 15px;
    line-height: 1.9;
    color: #c9ceda;
}

.hn-bottom-divider { margin-bottom: 85px; }

/* IntersectionObserver: reveal is optional; without JS, everything is visible. */
.hn-animations-on .hn-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .9s ease, transform .9s ease;
}

.hn-animations-on .hn-reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* ============================================================
   05. RESPONSIVE AND REDUCED MOTION
   ============================================================ */
@media (max-width: 1000px) {
    .hn-story-inner { gap: 50px; }
    .hn-story-copy h1 { font-size: clamp(51px, 6vw, 71px); }
}

@media (max-width: 900px) {
    .hn-story-inner { grid-template-columns: 1fr; gap: 65px; }
    .hn-story-copy { max-width: 620px; width: 100%; margin: auto; }
    .hn-story-copy h1 { font-size: clamp(53px, 8vw, 77px); }
}

@media (max-width: 680px) {
    .hn-opening { min-height: 640px; padding: 90px 26px 130px; }
    .hn-opening::before { inset: 11px; }
    .hn-opening::after { bottom: 20px; }
    .hn-gothic-arch { width: 118vw; bottom: -12px; opacity: .7; }
    .hn-astrolabe { width: 130vw; }
    .hn-opening-quote { font-size: clamp(53px, 12vw, 78px); }
    .hn-moon-phases { margin-bottom: 25px; }
    .hn-scroll-down { bottom: 48px; width: 46px; height: 46px; }
    .hn-story { padding: 95px 24px; }
    .hn-book-art { max-width: 340px; }
    .hn-dossier { padding: 75px 24px 90px; }
    .hn-dossier-grid { grid-template-columns: 1fr; gap: 13px; }
    .hn-file-card { min-height: 140px; flex-direction: row; gap: 20px; padding: 25px 35px; }
    .hn-file-number { align-self: auto; }
    .hn-file-icon { width: 42px; height: 42px; }
    .hn-file-title { font-size: 30px; }
    .hn-file-corner { top: 9px; right: 15px; font-size: 16px; }
    .hn-bottom-divider { margin-bottom: 50px; }
}

@media (max-width: 420px) {
    .hn-file-card { gap: 12px; padding: 22px 25px; }
    .hn-file-icon { width: 36px; height: 36px; }
    .hn-file-title { font-size: 27px; }
    .hn-story-copy h1 { font-size: 50px; }
    .hn-opening { min-height: 590px; }
}

@media (prefers-reduced-motion: reduce) {
    .hn-intro-screen { display: none !important; }
    .hn-starfield span,
    .hn-astrolabe,
    .hn-scroll-down svg { animation: none !important; }
    .hn-animations-on .hn-reveal { opacity: 1; transform: none; transition: none; }
    .hn-file-panel.is-entering { animation: none; }
    .hn-file-card,
    .hn-file-corner { transition: none; }
}


/* ========================================
   BOOK TITLE
======================================== */

.hn-page .hn-story-copy h1 {
    font-size: clamp(22px, 3vw, 40px);
    line-height: 1.2;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.hn-page .hn-story-copy h1 span {
    display: inline;
    margin: 0;
    font-size: 0.85em;
    font-style: italic;
    color: #eab9c9;
}


/* ========================================
   BOOK DESCRIPTION
======================================== */

.hn-page .hn-book-blurb {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.8;

    color: #BFC2CE;

    max-width: 460px;
    margin-top: 0;
}

/* Align the copy with the cover image, rather than its caption. */
.hn-page .hn-story-copy {
    align-self: end;
    margin-bottom: 37px;
}

@media (max-width: 900px) {
    .hn-page .hn-story-copy {
        align-self: auto;
        margin: 0 auto;
    }
}

@media (max-width: 680px) {
    .hn-page .hn-story-copy h1 {
        font-size: clamp(36px, 12vw, 50px);
        line-height: 1.05;
        white-space: normal;
        text-wrap: balance;
    }

    .hn-page .hn-book-blurb {
        max-width: none;
    }
}


/* ========================================
   COMING SOON
======================================== */

.hn-coming-soon {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 350px;
    padding: 90px 24px 110px;

    background-color: #0b1426;
    text-align: center;
}

.hn-coming-soon-title {
    margin: 0;

    font-family: var(--font-heading);
    font-size: clamp(48px, 7vw, 90px);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: 2px;

    color: #E6B8C7;
}


/* ========================================
   HECATE NAIR - DARK MODE
======================================== */

:root[data-theme="dark"] .hn-page {
    --color-background: #19191D;
    --color-surface: #252329;
    --color-text: #F8F5F6;
    --color-text-muted: #CCC3C9;
    --color-border: #443D46;

    background: #19191D;
}

/* Header and footer */

:root[data-theme="dark"] .hn-page .site-header,
:root[data-theme="dark"] .hn-page .site-footer {
    background: #222126;
}

/* Main content */

:root[data-theme="dark"] .hn-page main {
    background: #19191D;
}

:root[data-theme="dark"] .hn-page .hn-story {
    background:
        radial-gradient(
            circle at 75% 50%,
            rgba(230, 184, 199, 0.05),
            transparent 48%
        ),
        #19191D;
}

/* Coming Soon section */

:root[data-theme="dark"] .hn-page .hn-coming-soon {
    background: #151518;
}

/* Footer social icons */

:root[data-theme="dark"] .hn-page .social-box {
    background: #222126;
}

:root[data-theme="dark"] .hn-page .social-link {
    background: #322E35;
}
