/* =========================================================
 *  ERBERUS VITALS HUD
 * ========================================================= */
.frn-grit-site .frn-erberus {
    position: relative;
    padding: 80px 5vw;
    background: #0a0a0a;
    border-top: 1px solid rgba(0, 212, 255, 0.08);
    border-bottom: 1px solid rgba(0, 212, 255, 0.08);
    overflow: hidden;
}
.frn-grit-site .frn-erberus__bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(90deg, rgba(0,212,255,.02) 1px, transparent 1px),
        linear-gradient(0deg, rgba(0,212,255,.02) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    opacity: 0.1;
    animation: frnErbBgScan 20s linear infinite;
}
@keyframes frnErbBgScan {
    to { background-position: 40px 40px, 40px 40px; }
}
.frn-grit-site .frn-erberus__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto 30px;
    font-family: 'Special Elite', monospace;
    font-size: 12px;
    letter-spacing: 3px;
    color: #7aa3cc;
    position: relative;
    z-index: 1;
}
.frn-grit-site .frn-erberus__id {
    display: flex;
    align-items: center;
    gap: 10px;
}
.frn-grit-site .frn-erberus__dot {
    width: 10px; height: 10px;
    background: #00d4ff;
    border-radius: 50%;
    box-shadow: 0 0 12px #00d4ff;
    animation: frnErbPulse 1.8s ease-in-out infinite;
}
@keyframes frnErbPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: .4; transform: scale(.8); }
}
.frn-grit-site .frn-erberus__status {
    color: #4edc78;
}
.frn-grit-site .frn-erberus__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}
.frn-grit-site .frn-erberus__stat {
    background: rgba(10, 10, 10, 0.8);
    border: 1px solid rgba(0, 212, 255, 0.1);
    border-left: 3px solid rgba(0, 212, 255, 0.3);
    padding: 24px 26px;
    position: relative;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.frn-grit-site .frn-erberus__stat::before {
    content: '';
    position: absolute;
    top: -1px;
    right: -1px;
    width: 12px;
    height: 12px;
    border-top: 2px solid #00d4ff;
    border-right: 2px solid #00d4ff;
}
.frn-grit-site .frn-erberus__label {
    display: block;
    font-family: 'Special Elite', monospace;
    font-size: 11px;
    letter-spacing: 3px;
    color: #7aa3cc;
    margin-bottom: 8px;
    text-transform: uppercase;
}
.frn-grit-site .frn-erberus__value {
    display: block;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 52px;
    line-height: 1;
    color: #e4f0ff;
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
    margin-bottom: 8px;
}
.frn-grit-site .frn-erberus__sub {
    font-family: 'Special Elite', monospace;
    font-size: 11px;
    color: #4a6680;
    letter-spacing: 1px;
}
.frn-grit-site .frn-erberus__foot {
    max-width: 1100px;
    margin: 30px auto 0;
    font-family: 'Special Elite', monospace;
    font-size: 11px;
    letter-spacing: 2px;
    color: #4a6680;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}
.frn-grit-site .frn-erberus__blink {
    color: #00d4ff;
    animation: frnErbBlink .8s steps(1) infinite;
}
@keyframes frnErbBlink {
    50% { opacity: 0; }
}

/* =========================================================
 *  AUTHOR SECTION
 * ========================================================= */
.frn-grit-site .frn-author {
    position: relative;
    padding: 20px 5vw 120px;
    background: linear-gradient(180deg, #0a0a0a, #141416);
    overflow: hidden;
}
.frn-grit-site .frn-erberus-noise {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.08'/></svg>");
    pointer-events: none;
    opacity: .4;
}
.frn-grit-site .frn-author__card {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 50px;
    align-items: start;
    position: relative;
    z-index: 1;
}
.frn-grit-site .frn-author__portrait {
    position: relative;
    aspect-ratio: 3/4;
}
.frn-grit-site .frn-author__portrait-photo {
    position: absolute;
    inset: 12px;
    background: linear-gradient(135deg, #1a0606, #050505);
    overflow: hidden;
}
.frn-grit-site .frn-author__portrait-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    filter: contrast(1.05) saturate(1.1);
    transition: transform .6s ease;
}
.frn-grit-site .frn-author__portrait:hover .frn-author__portrait-photo img {
    transform: scale(1.04);
}
.frn-grit-site .frn-author__portrait-inner {
    position: absolute;
    inset: 12px;
    background:
        radial-gradient(ellipse at 30% 30%, rgba(217,13,30,.15), transparent 70%),
        linear-gradient(135deg, #1a0606, #0a0a0a);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,.08);
}
.frn-grit-site .frn-author__initials {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 140px;
    color: var(--frn-red);
    text-shadow: 0 0 40px rgba(217,13,30,.5);
    letter-spacing: 4px;
}
.frn-grit-site .frn-author__portrait-frame {
    position: absolute;
    inset: 0;
    border: 2px solid var(--frn-red);
    pointer-events: none;
}
.frn-grit-site .frn-author__portrait-frame::before,
.frn-grit-site .frn-author__portrait-frame::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid var(--frn-red);
}
.frn-grit-site .frn-author__portrait-frame::before {
    top: -6px; left: -6px;
    border-right: none;
    border-bottom: none;
}
.frn-grit-site .frn-author__portrait-frame::after {
    bottom: -6px; right: -6px;
    border-left: none;
    border-top: none;
}
.frn-grit-site .frn-author__credits {
    border-left: 3px solid var(--frn-red);
    padding-left: 24px;
    margin-bottom: 30px;
}
.frn-grit-site .frn-author__credit-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px dashed rgba(255,255,255,.08);
}
.frn-grit-site .frn-author__credit-row:last-child { border-bottom: none; }
.frn-grit-site .frn-author__credit-label {
    font-family: 'Special Elite', monospace;
    font-size: 11px;
    letter-spacing: 3px;
    color: var(--frn-red-lt);
    min-width: 110px;
}
.frn-grit-site .frn-author__credit-value {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 24px;
    letter-spacing: 2px;
    color: var(--frn-bone);
}
.frn-grit-site .frn-author__erberus {
    color: #00d4ff;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.4);
    animation: frnErbFlicker 4s ease-in-out infinite;
}
@keyframes frnErbFlicker {
    0%, 97%, 100% { opacity: 1; }
    98%  { opacity: .3; text-shadow: 0 0 20px rgba(0, 212, 255, 0.8); }
    99%  { opacity: 1; }
}
.frn-grit-site .frn-author__credit-title {
    font-family: 'Special Elite', monospace;
    font-size: 11px;
    color: var(--frn-steel-d);
    font-style: normal;
    letter-spacing: 1px;
}
.frn-grit-site .frn-author__bio {
    font-size: 17px;
    line-height: 1.75;
    color: var(--frn-cream);
}
.frn-grit-site .frn-author__bio p { margin-bottom: 1em; }

@media (max-width: 800px) {
    .frn-grit-site .frn-author__card {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .frn-grit-site .frn-author__portrait {
        max-width: 240px;
        margin: 0 auto;
    }
}

/* =========================================================
 *  ERBERUS RANDOM TRANSMISSIONS (floating notes)
 * ========================================================= */
.frn-erberus-note {
    position: fixed;
    z-index: 9997;
    background: rgba(0, 10, 20, 0.92);
    border: 1px solid #00d4ff;
    border-left: 3px solid #00d4ff;
    padding: 10px 16px;
    font-family: 'Special Elite', 'Courier New', monospace;
    font-size: 12px;
    color: #00d4ff;
    letter-spacing: 1px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 0 25px rgba(0, 212, 255, 0.4);
    max-width: 340px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(10px);
    animation: frnErbNoteIn .3s ease forwards;
}
@keyframes frnErbNoteIn {
    to { opacity: 1; transform: translateY(0); }
}
.frn-erberus-note.is-fading {
    animation: frnErbNoteOut .8s ease forwards;
}
@keyframes frnErbNoteOut {
    to { opacity: 0; transform: translateY(-8px) scale(.96); filter: blur(3px); }
}
.frn-erberus-note__prefix {
    color: #ff3344;
    font-weight: bold;
    margin-right: 6px;
}
.frn-erberus-note__caret {
    display: inline-block;
    margin-left: 2px;
    animation: frnErbBlink .7s steps(1) infinite;
}

/* =========================================================
 *  GLOBAL ERBERUS GLITCH OVERLAY
 * ========================================================= */
.frn-erberus-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9996;
    mix-blend-mode: screen;
    opacity: 0;
    background:
        repeating-linear-gradient(0deg, rgba(0, 212, 255, 0.15) 0 1px, transparent 1px 4px),
        linear-gradient(90deg, rgba(255, 51, 68, 0.2), transparent 40%, rgba(0, 212, 255, 0.2));
    transition: opacity .1s;
}
.frn-erberus-overlay.is-glitching {
    opacity: 1;
    animation: frnErbGlitch .12s steps(4) infinite;
}
@keyframes frnErbGlitch {
    0%   { transform: translate(0, 0); }
    25%  { transform: translate(-4px, 2px); }
    50%  { transform: translate(3px, -2px); }
    75%  { transform: translate(-2px, 4px); }
}
.frn-erberus-burst {
    position: fixed;
    z-index: 9998;
    pointer-events: none;
    font-family: 'Special Elite', monospace;
    font-size: 14px;
    color: #00d4ff;
    text-shadow: 0 0 10px #00d4ff, 2px 0 0 #ff3344, -2px 0 0 #ff3344;
    letter-spacing: 2px;
    animation: frnErbBurst .7s ease forwards;
}
@keyframes frnErbBurst {
    0%   { opacity: 0; transform: translateY(20px); }
    20%  { opacity: 1; transform: translateY(0); }
    80%  { opacity: 1; }
    100% { opacity: 0; transform: translateY(-10px); }
}

/* =========================================================
 *  BOOK — new controls (fullscreen, video mode)
 * ========================================================= */
.frn-book__video-ctrl {
    display: flex;
    gap: 2px;
    padding: 4px;
    background: var(--bk-bg);
    border: 1px solid var(--bk-border);
}
.frn-book__video-ctrl button {
    background: transparent;
    border: none;
    color: var(--bk-text-dim);
    font-size: 16px;
    padding: 4px 10px;
    cursor: pointer;
    transition: all .15s;
}
.frn-book__video-ctrl button:hover { color: var(--bk-text); }
.frn-book__video-ctrl button.is-active {
    color: var(--bk-accent);
    background: var(--bk-bg-2);
}
.frn-book__fs-btn {
    background: transparent;
    border: 1px solid var(--bk-border);
    color: var(--bk-text);
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all .2s;
}
.frn-book__fs-btn:hover {
    background: var(--bk-accent);
    color: var(--bk-bg);
    border-color: var(--bk-accent);
    box-shadow: var(--bk-glow);
}

/* =========================================================
 *  BOOK COVER PAGE
 * ========================================================= */
.frn-book__cover {
    display: none;
    position: relative;
    min-height: 100%;
    overflow: hidden;
    animation: frnCoverIn 1.2s cubic-bezier(.2,.7,.2,1) both;
}
.frn-book__cover.is-active { display: flex; align-items: center; }
@keyframes frnCoverIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.frn-book__cover-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(0, 212, 255, .15), transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(255, 51, 68, .1), transparent 50%),
        repeating-linear-gradient(0deg, rgba(255,255,255,.02) 0 1px, transparent 1px 3px);
    pointer-events: none;
}
.frn-book__cover-content {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
    padding: 80px 60px;
    text-align: center;
    width: 100%;
}
.frn-book__cover-kicker {
    font-family: 'Special Elite', monospace;
    font-size: 12px;
    letter-spacing: 5px;
    color: var(--bk-accent);
    margin-bottom: 30px;
    animation: frnCoverKickerIn .8s ease .2s both;
}
@keyframes frnCoverKickerIn {
    from { opacity: 0; letter-spacing: 20px; }
    to   { opacity: 1; letter-spacing: 5px; }
}
.frn-book__cover-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(80px, 14vw, 180px);
    line-height: .85;
    letter-spacing: 8px;
    color: var(--bk-text);
    margin: 0;
    text-transform: uppercase;
    text-shadow: var(--bk-glow);
    animation: frnCoverTitleIn 1.2s cubic-bezier(.2,.7,.2,1) .4s both;
    position: relative;
}
@keyframes frnCoverTitleIn {
    from { opacity: 0; transform: translateY(40px); letter-spacing: 40px; filter: blur(8px); }
    to   { opacity: 1; transform: translateY(0); letter-spacing: 8px; filter: blur(0); }
}
.frn-book__cover-subtitle {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(20px, 2.5vw, 32px);
    letter-spacing: 6px;
    color: var(--bk-text-dim);
    margin: 10px 0 40px;
    text-transform: uppercase;
    animation: frnFadeIn 1s ease 1s both;
}
@keyframes frnFadeIn { from { opacity: 0; } to { opacity: 1; } }
.frn-book__cover-divider {
    width: 60px;
    height: 2px;
    background: var(--bk-accent);
    margin: 0 auto 40px;
    box-shadow: var(--bk-glow);
    animation: frnCoverDivider 1s ease 1.2s both;
}
@keyframes frnCoverDivider {
    from { width: 0; }
    to   { width: 60px; }
}
.frn-book__cover-credits {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
    margin-bottom: 40px;
    animation: frnFadeIn 1s ease 1.4s both;
}
.frn-book__cover-credit {
    text-align: center;
}
.frn-book__cover-credit span {
    display: block;
    font-family: 'Special Elite', monospace;
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--bk-text-dim);
    margin-bottom: 4px;
}
.frn-book__cover-credit strong {
    display: block;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 20px;
    letter-spacing: 2px;
    color: var(--bk-text);
}
.frn-book__cover-cta {
    margin-bottom: 40px;
    animation: frnFadeIn 1s ease 1.7s both;
}
.frn-book__cover-cta button {
    padding: 16px 40px;
    font-size: 22px;
    background: var(--bk-accent);
    color: var(--bk-bg);
    border: 2px solid var(--bk-accent);
    cursor: pointer;
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 4px;
    box-shadow: var(--bk-glow);
    clip-path: polygon(14px 0, 100% 0, calc(100% - 14px) 100%, 0 100%);
    transition: transform .2s;
}
.frn-book__cover-cta button:hover { transform: translate(-2px,-2px); }
.frn-book__cover-foot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    font-family: 'Special Elite', monospace;
    font-size: 11px;
    letter-spacing: 4px;
    color: var(--bk-text-dim);
    animation: frnFadeIn 1s ease 2s both;
}
.frn-book__cover-seal {
    color: var(--bk-accent);
    font-size: 14px;
}

/* =========================================================
 *  BOOK — bad erberus chapter glitch
 * ========================================================= */
.frn-book__page .frn-book__erb-flag {
    color: #ff3344;
    margin-left: 8px;
    font-size: 10px;
}
.frn-book__chapter-list button.is-bad-erberus .frn-book__chapter-num {
    color: #ff3344;
    animation: frnErbBlink 1.5s steps(1) infinite;
}
/* ERBERUS anomaly: gentle timed flash instead of continuous shake.
   Triggers every ~18s for a fraction of a second - unsettling but readable. */
.frn-book.is-bad-erberus .frn-book__page.is-active {
    position: relative;
}
.frn-book.is-bad-erberus .frn-book__page.is-active::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 99;
    mix-blend-mode: screen;
    background:
        repeating-linear-gradient(0deg, rgba(255, 51, 68, 0.18) 0 1px, transparent 1px 5px),
        repeating-linear-gradient(90deg, rgba(0, 212, 255, 0.10) 0 1px, transparent 1px 3px);
    opacity: 0;
    animation: frnErbFlash 18s ease-in-out infinite;
}
@keyframes frnErbFlash {
    0%, 8%, 100%  { opacity: 0; }
    2%, 3%        { opacity: 0.9; }
    4%, 7%        { opacity: 0.15; }
    5%            { opacity: 0.6; }
}
.frn-book.is-bad-erberus .frn-book__page-title {
    color: #ff3344;
    text-shadow: 1px 0 0 #00d4ff, -1px 0 0 #ff3344;
    animation: frnErbTitleFlash 18s ease-in-out infinite;
}
@keyframes frnErbTitleFlash {
    0%, 8%, 100%  { text-shadow: 1px 0 0 rgba(0,212,255,0.3), -1px 0 0 rgba(255,51,68,0.3); }
    2%, 5%        { text-shadow: 3px 0 0 #00d4ff, -3px 0 0 #ff3344; }
}

/* Page view counter in meta */
.frn-book__page-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}
.frn-book__page-views {
    font-family: 'Special Elite', monospace;
    font-size: 10px;
    letter-spacing: 1px;
    color: var(--bk-text-dim);
    opacity: .7;
}

/* Cover link in sidebar */
.frn-book__cover-link .frn-book__chapter-num {
    color: var(--bk-accent) !important;
}
