/* =========================
   HOLDFAST PAGE
========================= */

:root {
    --gold: #c9a96a;
    --gold-soft: rgba(201, 169, 106, 0.68);
    --paper: #e8ddc8;
    --white: rgba(255, 255, 255, 0.92);
    --muted: rgba(255, 255, 255, 0.68);
    --red: #8b2419;
    --black: #050505;
    --panel: rgba(5, 5, 5, 0.74);
    --border: rgba(201, 169, 106, 0.28);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body.holdfast-page {
    margin: 0;
    min-height: 100vh;
    background: #050505;
    color: var(--white);
    font-family: Georgia, "Times New Roman", serif;
    overflow-x: hidden;
}

#header-placeholder {
    position: relative;
    z-index: 100;
}

/* =========================
   ACCESSIBILITY
========================= */

.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    z-index: 9999;
    padding: 0.75rem 1rem;
    background: #2b1d12;
    color: #fff;
    border-radius: 8px;
    font-family: Arial, Helvetica, sans-serif;
}

.skip-link:focus {
    top: 1rem;
}

/* =========================
   PAGE BACKGROUND
========================= */

.holdfast-page-wrap {
    position: relative;
    min-height: 100vh;
    padding-top: 92px;
    background:
        linear-gradient(
            180deg,
            rgba(0, 0, 0, 0.82) 0%,
            rgba(0, 0, 0, 0.46) 42%,
            rgba(0, 0, 0, 0.88) 100%
        ),
        url("/assets/HOLDFAST_BG.png") center center / cover no-repeat fixed;
    isolation: isolate;
}

.holdfast-page-wrap::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(circle at center 38%, rgba(201, 169, 106, 0.12), transparent 34%),
        linear-gradient(90deg, rgba(0,0,0,0.72), transparent 30%, transparent 70%, rgba(0,0,0,0.78));
}

.holdfast-page-wrap::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: 0.14;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
}

/* =========================
   HERO / MAIN GRID
========================= */

.holdfast-hero {
    min-height: calc(100vh - 92px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 72px 22px 64px;
}

.holdfast-stage {
    width: min(100%, 1080px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    grid-template-areas:
        "title access"
        "prologue access";
    gap: 32px;
    align-items: start;
}

.holdfast-title-area {
    grid-area: title;
    position: relative;
    min-height: 560px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: clamp(30px, 5vw, 56px);
    border: 1px solid rgba(201, 169, 106, 0.14);
    background:
        linear-gradient(145deg, rgba(0,0,0,0.18), rgba(0,0,0,0.58));
    box-shadow: 0 30px 100px rgba(0,0,0,0.48);
}

.holdfast-title-area::before {
    content: "ARCHIVE FILE / Holdfast-04";
    position: absolute;
    top: 24px;
    left: 24px;
    color: rgba(201, 169, 106, 0.72);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.26em;
    text-transform: uppercase;
}

.holdfast-title-area::after {
    content: "";
    position: absolute;
    inset: 18px;
    border: 1px solid rgba(201, 169, 106, 0.08);
    pointer-events: none;
}

.holdfast-kicker {
    margin: 0 0 16px;
    color: var(--gold);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.76rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    text-shadow: 0 4px 20px rgba(0,0,0,0.9);
}

.holdfast-title {
    margin: 0;
    color: #fff;
    font-size: clamp(2.8rem, 6.2vw, 5.8rem);
    line-height: 0.94;
    font-weight: 500;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    text-shadow:
        0 8px 30px rgba(0,0,0,0.95),
        0 0 48px rgba(201, 169, 106, 0.12);
}

.holdfast-subtitle {
    max-width: 620px;
    margin: 28px 0 0;
    color: rgba(255,255,255,0.8);
    font-size: 1.1rem;
    line-height: 1.85;
    text-shadow: 0 4px 18px rgba(0,0,0,0.92);
}

/* =========================
   ACCESS PANEL
========================= */

.access-panel {
    grid-area: access;
    position: relative;
    align-self: start;
    padding: 34px 30px;
    border: 1px solid var(--border);
    background:
        linear-gradient(145deg, rgba(0,0,0,0.84), rgba(14,12,10,0.76)),
        var(--panel);
    box-shadow: 0 30px 100px rgba(0,0,0,0.62);
    backdrop-filter: blur(6px);
}

.access-panel::before {
    content: "";
    position: absolute;
    inset: 14px;
    border: 1px solid rgba(201, 169, 106, 0.08);
    pointer-events: none;
}

.access-status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
    padding: 8px 11px;
    border: 1px solid rgba(201,169,106,0.24);
    color: var(--gold);
    background: rgba(0,0,0,0.34);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.68rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.access-status::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--red);
    box-shadow: 0 0 18px rgba(139, 36, 25, 0.95);
}

.access-status.is-granted::before {
    background: var(--gold);
    box-shadow: 0 0 18px rgba(201, 169, 106, 0.95);
}

.access-title {
    margin: 0;
    color: #fff;
    font-size: clamp(1.9rem, 4vw, 3.05rem);
    line-height: 1.08;
    font-weight: 500;
}

.access-copy {
    margin: 18px 0 22px;
    color: var(--muted);
    line-height: 1.75;
    font-size: 1rem;
}

/* =========================
   FILE DESIGNATION / HINT
========================= */

.file-designation {
    margin: 0 0 18px;
    padding: 11px 13px;
    border: 1px solid rgba(201, 169, 106, 0.2);
    background: rgba(0, 0, 0, 0.28);
    color: rgba(255,255,255,0.58);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.file-designation span {
    color: rgba(201, 169, 106, 0.86);
    letter-spacing: 0.04em;
    text-transform: none;
}

.archivist-note {
    margin: 0 0 24px;
    padding: 16px 16px 15px;
    border-left: 2px solid rgba(201, 169, 106, 0.5);
    background:
        linear-gradient(90deg, rgba(201, 169, 106, 0.08), transparent),
        rgba(0,0,0,0.24);
}

.archivist-note-label {
    margin: 0 0 9px;
    color: var(--gold);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.66rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.archivist-note p:not(.archivist-note-label) {
    margin: 6px 0 0;
    color: rgba(255,255,255,0.58);
    font-size: 0.9rem;
    line-height: 1.55;
}

/* =========================
   FORM
========================= */

.access-form {
    display: grid;
    gap: 14px;
}

.access-panel.is-unlocked .access-form {
    display: none;
}

.access-panel.is-unlocked .access-copy {
    margin-bottom: 22px;
}

.access-panel.is-unlocked .file-designation {
    border-color: rgba(201, 169, 106, 0.36);
    background:
        linear-gradient(135deg, rgba(201, 169, 106, 0.08), transparent),
        rgba(0, 0, 0, 0.32);
}

.access-label {
    color: rgba(255,255,255,0.78);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.access-input {
    width: 100%;
    min-height: 56px;
    padding: 0 16px;
    border: 1px solid rgba(201, 169, 106, 0.36);
    border-radius: 0;
    outline: none;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.08rem;
    letter-spacing: 0.12em;
}

.access-input::placeholder {
    color: rgba(255,255,255,0.28);
}

.access-input:focus {
    border-color: rgba(201, 169, 106, 0.9);
    box-shadow: 0 0 0 3px rgba(201, 169, 106, 0.12);
}

/* =========================
   BUTTONS
========================= */

.access-button,
.play-button,
.seal-button,
.preorder-button,
.route-button,
.fragment-jump-button {
    min-height: 56px;
    border: 1px solid rgba(201, 169, 106, 0.55);
    background:
        linear-gradient(135deg, rgba(201, 169, 106, 0.2), rgba(201, 169, 106, 0.07)),
        rgba(0,0,0,0.46);
    color: #fff;
    cursor: pointer;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.76rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    text-decoration: none;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.preorder-button,
.route-button,
.fragment-jump-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 22px;
    text-align: center;
}

.access-button:hover,
.access-button:focus,
.play-button:hover,
.play-button:focus,
.seal-button:hover,
.seal-button:focus,
.preorder-button:hover,
.preorder-button:focus,
.route-button:hover,
.route-button:focus,
.fragment-jump-button:hover,
.fragment-jump-button:focus {
    transform: translateY(-1px);
    border-color: rgba(201, 169, 106, 0.92);
    background:
        linear-gradient(135deg, rgba(201, 169, 106, 0.3), rgba(201, 169, 106, 0.1)),
        rgba(0,0,0,0.56);
}

.access-button:disabled {
    cursor: not-allowed;
    opacity: 0.62;
}

.seal-button {
    width: 100%;
    margin-top: 12px;
    color: rgba(255, 255, 255, 0.68);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.34);
}

.seal-button:hover,
.seal-button:focus {
    color: #fff;
    border-color: rgba(201, 169, 106, 0.7);
    background: rgba(0, 0, 0, 0.56);
}

/* =========================
   ACCESS MESSAGES
========================= */

.access-message {
    min-height: 26px;
    margin: 4px 0 0;
    color: rgba(255,255,255,0.58);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.9rem;
    line-height: 1.5;
}

.access-message.is-error {
    color: #e5a49c;
}

.access-message.is-success {
    color: #d6b56d;
}

/* =========================
   TRANSMISSION PANEL
========================= */

.transmission-panel {
    display: none;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid rgba(201, 169, 106, 0.18);
}

.transmission-panel.is-visible {
    display: block;
    animation: revealTransmission 700ms ease both;
}

.transmission-heading {
    margin: 0 0 14px;
    color: rgba(255,255,255,0.86);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.soundwave-box {
    position: relative;
    margin: 0 0 18px;
    padding: 14px;
    border: 1px solid rgba(201, 169, 106, 0.22);
    background: rgba(0,0,0,0.38);
    overflow: hidden;
}

.soundwave-box::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, transparent, rgba(201,169,106,0.12), transparent),
        linear-gradient(180deg, rgba(255,255,255,0.04), transparent);
    transform: translateX(-100%);
    animation: scanWave 3.8s linear infinite;
    pointer-events: none;
}

.soundwave-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 160px;
    object-fit: contain;
    opacity: 0.86;
    filter: contrast(1.2) sepia(0.25);
    animation: soundwaveFlicker 2.4s infinite steps(2, end);
}

.soundwave-box.is-playing .soundwave-image {
    animation:
        soundwaveFlicker 1.1s infinite steps(2, end),
        soundwavePulse 680ms ease-in-out infinite alternate;
}

.audio-hidden {
    display: none;
}

.transmission-note {
    margin: 14px 0 0;
    color: rgba(255,255,255,0.48);
    font-size: 0.92rem;
    line-height: 1.7;
}

/* =========================
   FRAGMENT PROMPT
========================= */

.fragment-prompt {
    margin-top: 20px;
    padding: 17px 17px 19px;
    border: 1px solid rgba(201, 169, 106, 0.2);
    background:
        linear-gradient(145deg, rgba(201, 169, 106, 0.07), transparent),
        rgba(0,0,0,0.3);
}

.fragment-prompt p {
    margin: 0 0 14px;
    color: rgba(255,255,255,0.62);
    font-size: 0.94rem;
    line-height: 1.6;
}

.fragment-jump-button {
    width: 100%;
    min-height: 50px;
    font-size: 0.7rem;
    letter-spacing: 0.18em;
}

/* =========================
   PREORDER PANEL
========================= */

.preorder-panel {
    margin-top: 24px;
    padding: 18px 18px 20px;
    border: 1px solid rgba(201, 169, 106, 0.22);
    background:
        linear-gradient(145deg, rgba(201, 169, 106, 0.08), transparent),
        rgba(0,0,0,0.34);
}

.preorder-heading {
    margin: 0 0 9px;
    color: var(--gold);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.preorder-copy {
    margin: 0 0 16px;
    color: rgba(255,255,255,0.62);
    font-size: 0.94rem;
    line-height: 1.65;
}

.preorder-button {
    width: 100%;
}

/* =========================
   UNLOCKED PROLOGUE PANEL
========================= */

.prologue-panel {
    grid-area: prologue;
    position: relative;
    width: 100%;
    margin: 0;
    padding: clamp(28px, 4vw, 44px);
    border: 1px solid rgba(201, 169, 106, 0.24);
    background:
        linear-gradient(145deg, rgba(201, 169, 106, 0.08), transparent 42%),
        linear-gradient(180deg, rgba(0,0,0,0.78), rgba(0,0,0,0.58)),
        rgba(0, 0, 0, 0.52);
    box-shadow: 0 30px 100px rgba(0,0,0,0.45);
    overflow: hidden;
}

.prologue-panel[hidden] {
    display: none !important;
}

.prologue-panel.is-visible {
    display: block;
    animation: revealTransmission 700ms ease both;
}

.prologue-panel::before {
    content: "";
    position: absolute;
    inset: 18px;
    border: 1px solid rgba(201, 169, 106, 0.08);
    pointer-events: none;
}

.prologue-kicker {
    position: relative;
    z-index: 2;
    margin: 0 0 10px;
    color: var(--gold);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.68rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.prologue-panel h2,
.prologue-panel h3 {
    position: relative;
    z-index: 2;
    margin: 0 0 10px;
    color: #fff;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 500;
    line-height: 1.16;
}

.prologue-protection-note {
    position: relative;
    z-index: 2;
    margin: 0 0 24px;
    color: rgba(255,255,255,0.38);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    line-height: 1.6;
    text-transform: uppercase;
}

.prologue-text {
    position: relative;
    z-index: 2;
    max-height: 520px;
    overflow-y: auto;
    padding: 4px 18px 4px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(201, 169, 106, 0.46) rgba(255,255,255,0.08);
}

.prologue-text::-webkit-scrollbar {
    width: 8px;
}

.prologue-text::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.08);
}

.prologue-text::-webkit-scrollbar-thumb {
    background: rgba(201, 169, 106, 0.46);
}

.prologue-text p {
    margin: 0 0 20px;
    color: rgba(255,255,255,0.76);
    font-size: 1.02rem;
    line-height: 1.86;
}

.prologue-watermark {
    position: absolute;
    right: -80px;
    bottom: 96px;
    z-index: 1;
    transform: rotate(-18deg);
    color: rgba(201, 169, 106, 0.05);
    font-family: Arial, Helvetica, sans-serif;
    font-size: clamp(2rem, 5vw, 4.2rem);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    white-space: nowrap;
    pointer-events: none;
}

.locked-reading,
.locked-reading * {
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
}

@media print {
    .prologue-panel,
    .locked-reading {
        display: none !important;
    }
}

/* =========================
   ROUTE CARDS
========================= */

.holdfast-routes {
    width: min(100%, 1080px);
    margin: 0 auto;
    padding: 0 22px 76px;
}

.holdfast-route-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.holdfast-route-grid:has(.holdfast-route-card:only-child) {
    grid-template-columns: minmax(0, 620px);
    justify-content: center;
}

.holdfast-route-card {
    position: relative;
    padding: 30px 28px;
    border: 1px solid rgba(201, 169, 106, 0.18);
    background:
        linear-gradient(145deg, rgba(0,0,0,0.72), rgba(14,12,10,0.62)),
        rgba(0,0,0,0.5);
    box-shadow: 0 24px 80px rgba(0,0,0,0.42);
}

.holdfast-route-card::before {
    content: "";
    position: absolute;
    inset: 13px;
    border: 1px solid rgba(201, 169, 106, 0.07);
    pointer-events: none;
}

.route-kicker {
    margin: 0 0 12px;
    color: var(--gold);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.68rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.holdfast-route-card h2 {
    margin: 0 0 14px;
    color: #fff;
    font-size: clamp(1.55rem, 3vw, 2.2rem);
    font-weight: 500;
    line-height: 1.14;
}

.holdfast-route-card p {
    margin: 0 0 18px;
    color: rgba(255,255,255,0.64);
    font-size: 1rem;
    line-height: 1.72;
}

.route-button {
    min-height: 50px;
    margin-top: 4px;
}

/* =========================
   FOOTER NOTE
========================= */

.archive-footer-note {
    width: min(100%, 1080px);
    margin: 0 auto;
    padding: 0 22px 70px;
    color: rgba(255,255,255,0.36);
    text-align: center;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

/* =========================
   ANIMATIONS
========================= */

@keyframes revealTransmission {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes soundwaveFlicker {
    0%, 100% {
        opacity: 0.88;
        filter: contrast(1.18) sepia(0.25) brightness(1);
    }

    8% {
        opacity: 0.54;
        filter: contrast(1.4) sepia(0.3) brightness(1.35);
    }

    12% {
        opacity: 0.96;
    }

    28% {
        opacity: 0.68;
    }

    31% {
        opacity: 0.92;
    }

    61% {
        opacity: 0.5;
        filter: contrast(1.55) sepia(0.38) brightness(1.2);
    }

    64% {
        opacity: 0.9;
    }
}

@keyframes soundwavePulse {
    from {
        transform: scaleY(0.96);
    }

    to {
        transform: scaleY(1.05);
    }
}

@keyframes scanWave {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(100%);
    }
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 980px) {
    .holdfast-stage {
        grid-template-columns: 1fr;
        grid-template-areas:
            "title"
            "access"
            "prologue";
    }

    .holdfast-title-area {
        min-height: 440px;
    }

    .access-panel {
        max-width: 620px;
        margin: 0 auto;
        width: 100%;
    }

    .prologue-panel {
        width: 100%;
        max-width: 620px;
        margin: 0 auto;
    }

    .holdfast-route-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .holdfast-page-wrap {
        padding-top: 74px;
        background-attachment: scroll;
    }

    .holdfast-hero {
        min-height: auto;
        padding: 48px 14px 42px;
    }

    .holdfast-title-area {
        min-height: 360px;
        padding: 30px 22px;
    }

    .holdfast-title-area::before {
        top: 18px;
        left: 18px;
        font-size: 0.66rem;
    }

    .holdfast-title {
        font-size: clamp(2.4rem, 12vw, 3.8rem);
        line-height: 0.98;
    }

    .holdfast-subtitle {
        font-size: 0.98rem;
        line-height: 1.7;
    }

    .access-panel,
    .holdfast-route-card {
        padding: 28px 22px;
    }

    .access-title {
        font-size: 2rem;
    }

    .access-copy {
        font-size: 0.96rem;
    }

    .file-designation {
        font-size: 0.66rem;
        letter-spacing: 0.12em;
    }

    .fragment-jump-button {
        min-height: 48px;
        font-size: 0.66rem;
        letter-spacing: 0.14em;
    }

    .prologue-panel {
        padding: 24px 16px 26px;
    }

    .prologue-panel::before {
        inset: 12px;
    }

    .prologue-text {
        max-height: 440px;
        padding-right: 12px;
    }

    .prologue-text p {
        font-size: 0.96rem;
        line-height: 1.78;
    }

    .prologue-watermark {
        right: -120px;
        bottom: 120px;
        font-size: 1.8rem;
    }
}

/* =========================
   REDUCED MOTION
========================= */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}
