/* ═══════════════════════════════════════════════════════
   MANUSCRIPT DARK — Design System
   Fihris Author Page (Production)
   Aesthetic: Dark Editorial × Literary Ancient
═══════════════════════════════════════════════════════ */

:root {
    --ink:      #0D0B09;
    --parchment: #F5F0E8;
    --gold:     #C9922A;
    --gold-dim: rgba(201,146,42, 0.15);
    --gold-glow: rgba(201,146,42, 0.08);
    --ash:      #8A8070;
    --paper:    rgba(245,240,232,0.04);
    --line:     rgba(201,146,42, 0.12);

    --font-display: 'Aref Ruqaa Ink', serif;
    --font-body:    'Noto Kufi Arabic', sans-serif;
    --font-mono:    'DM Mono', monospace;

    --s1: 0.5rem; --s2: 1rem; --s3: 1.5rem; --s4: 2rem; --s6: 3rem; --s8: 4rem;
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
    --ease-in-out:   cubic-bezier(0.45, 0, 0.55, 1);
}

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

html { scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: var(--gold) var(--ink); }
html::-webkit-scrollbar { width: 4px; }
html::-webkit-scrollbar-track { background: var(--ink); }
html::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 2px; }

body {
    background: var(--ink);
    color: var(--parchment);
    font-family: var(--font-body);
    font-weight: 300;
    line-height: 1.75;
    overflow-x: hidden;
    min-height: 100vh;
}

/* NOISE TEXTURE */
body::before {
    content: '';
    position: fixed; inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    opacity: 0.028; pointer-events: none; z-index: 9999;
}

/* AMBIENT */
.ms-ambient { position: fixed; border-radius: 50%; pointer-events: none; filter: blur(120px); z-index: 0; }
.ms-ambient-1 { width: 60vw; height: 60vw; top: -20vw; right: -20vw; background: radial-gradient(circle, rgba(201,146,42,0.06) 0%, transparent 70%); }
.ms-ambient-2 { width: 50vw; height: 50vw; bottom: 10vh; left: -15vw; background: radial-gradient(circle, rgba(201,146,42,0.04) 0%, transparent 70%); }

/* ═══ LOADING CURTAIN ═══ */
#ms-curtain {
    position: fixed; inset: 0; background: var(--ink); z-index: 10000;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s2);
}
.ms-curtain-logo {
    font-family: var(--font-display); font-size: 4rem; color: var(--gold);
    opacity: 0; transform: translateY(20px);
    animation: msCurtainIn 1s var(--ease-out-expo) 0.3s forwards;
}
.ms-curtain-line {
    width: 0; height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    animation: msCurtainLine 1.2s var(--ease-out-expo) 0.8s forwards;
}
@keyframes msCurtainIn { to { opacity: 1; transform: translateY(0); } }
@keyframes msCurtainLine { to { width: 200px; } }

/* ═══ FLOATING NAV ═══ */
#ms-nav {
    position: fixed; top: var(--s3); left: 50%; transform: translateX(-50%);
    z-index: 500; opacity: 0; transition: opacity 0.5s ease;
}
#ms-nav.visible { opacity: 1; }
.ms-nav-strip {
    display: flex; align-items: center; gap: var(--s1);
    background: rgba(13,11,9,0.85); backdrop-filter: blur(20px);
    border: 1px solid var(--line); border-radius: 100px; padding: 0.4rem 0.6rem;
}
.ms-nav-strip a {
    display: block; padding: 0.4rem 1rem; color: var(--ash); font-size: 0.85rem;
    font-weight: 400; text-decoration: none; border-radius: 100px;
    transition: all 0.3s ease; white-space: nowrap;
}
.ms-nav-strip a:hover, .ms-nav-strip a.active { background: var(--gold-dim); color: var(--gold); }
.ms-nav-progress {
    width: 3px; height: 24px; background: var(--line);
    border-radius: 2px; overflow: hidden; margin: 0 var(--s1);
}
.ms-nav-progress-fill { width: 100%; height: 0%; background: var(--gold); border-radius: 2px; transition: height 0.1s linear; }

/* ═══ HERO ═══ */
#ms-hero {
    position: relative; min-height: 100vh;
    display: grid; grid-template-columns: 1fr 1fr;
    align-items: center; padding: 0 6vw; gap: 4vw; z-index: 1;
}
.ms-hero-content { display: flex; flex-direction: column; gap: var(--s3); padding-top: var(--s8); }
.ms-hero-eyebrow { display: flex; align-items: center; gap: var(--s2); opacity: 0; transform: translateY(30px); }
.ms-hero-eyebrow-line { width: 40px; height: 1px; background: var(--gold); }
.ms-hero-eyebrow-text { font-family: var(--font-body); font-size: 0.78rem; color: var(--gold); letter-spacing: 0.05em; font-weight: 400; }
.ms-hero-name {
    font-family: var(--font-display); font-size: clamp(3.5rem, 8vw, 7rem);
    line-height: 1.05; color: var(--parchment); opacity: 0; transform: translateY(40px);
}
.ms-hero-name span { color: var(--gold); position: relative; }
.ms-hero-name span::after {
    content: ''; position: absolute; bottom: 5px; right: 0; width: 0; height: 2px;
    background: var(--gold); transition: width 1s var(--ease-out-expo) 1.5s;
}
.ms-hero-name.revealed span::after { width: 100%; }
.ms-hero-bio { font-size: 1.05rem; color: var(--ash); line-height: 2; max-width: 480px; opacity: 0; transform: translateY(20px); }

/* Actions */
.ms-hero-actions { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; opacity: 0; transform: translateY(20px); }
.ms-btn-primary {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: var(--gold); color: var(--ink); padding: 0.8rem 2rem; border-radius: 4px;
    font-weight: 600; font-size: 0.9rem; text-decoration: none;
    transition: all 0.3s var(--ease-out-expo); position: relative; overflow: hidden;
    border: none; cursor: pointer; font-family: var(--font-body);
}
.ms-btn-primary::before {
    content: ''; position: absolute; inset: 0;
    background: rgba(255,255,255,0.15); transform: translateX(-110%) skewX(-15deg);
    transition: transform 0.5s var(--ease-out-expo);
}
.ms-btn-primary:hover::before { transform: translateX(110%) skewX(-15deg); }
.ms-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(201,146,42,0.35); }
.ms-btn-ghost {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: transparent; color: var(--parchment); padding: 0.8rem 1.5rem;
    border-radius: 4px; border: 1px solid var(--line); font-size: 0.9rem;
    text-decoration: none; transition: all 0.3s ease; cursor: pointer; font-family: var(--font-body);
}
.ms-btn-ghost:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-glow); }

/* Social */
.ms-social-dock { display: flex; gap: var(--s2); opacity: 0; transform: translateY(20px); }
.ms-social-link {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 4px;
    color: var(--ash); text-decoration: none; transition: all 0.3s ease;
}
.ms-social-link svg { width: 18px; height: 18px; }
.ms-social-link:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-glow); transform: translateY(-3px); }

/* Stats */
.ms-hero-stats { display: flex; gap: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--line); opacity: 0; transform: translateY(20px); }
.ms-stat-item { display: flex; flex-direction: column; gap: 4px; }
.ms-stat-num { font-family: var(--font-display); font-size: 2.2rem; color: var(--gold); line-height: 1; }
.ms-stat-label { font-size: 0.78rem; color: var(--ash); font-family: var(--font-body); font-weight: 400; }

/* ═══ AUTHOR PORTRAIT ═══ */
.ms-hero-portrait {
    display: flex; align-items: center; justify-content: center;
    position: relative; padding-top: var(--s8); opacity: 0;
}
.ms-portrait-stage {
    position: relative;
    width: 340px; height: 420px;
    display: flex; align-items: center; justify-content: center;
}

/* Rotating golden ring */
.ms-portrait-ring {
    position: absolute; inset: -12px;
    border-radius: 20px;
    border: 1px solid transparent;
    background: linear-gradient(var(--ink), var(--ink)) padding-box,
                linear-gradient(135deg, var(--gold), transparent 40%, transparent 60%, var(--gold)) border-box;
    animation: msRingRotate 8s linear infinite;
    opacity: 0.6;
}
@keyframes msRingRotate {
    0% { background: linear-gradient(var(--ink), var(--ink)) padding-box, linear-gradient(0deg, var(--gold), transparent 40%, transparent 60%, var(--gold)) border-box; }
    25% { background: linear-gradient(var(--ink), var(--ink)) padding-box, linear-gradient(90deg, var(--gold), transparent 40%, transparent 60%, var(--gold)) border-box; }
    50% { background: linear-gradient(var(--ink), var(--ink)) padding-box, linear-gradient(180deg, var(--gold), transparent 40%, transparent 60%, var(--gold)) border-box; }
    75% { background: linear-gradient(var(--ink), var(--ink)) padding-box, linear-gradient(270deg, var(--gold), transparent 40%, transparent 60%, var(--gold)) border-box; }
    100% { background: linear-gradient(var(--ink), var(--ink)) padding-box, linear-gradient(360deg, var(--gold), transparent 40%, transparent 60%, var(--gold)) border-box; }
}

/* Ambient glow behind portrait */
.ms-portrait-glow {
    position: absolute;
    width: 280px; height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(201,146,42,0.12) 0%, transparent 70%);
    filter: blur(40px);
    animation: msGlowPulse 4s ease-in-out infinite;
}
@keyframes msGlowPulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

/* The photo frame */
.ms-portrait-frame {
    position: relative;
    width: 280px; height: 380px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(201,146,42,0.15),
        0 25px 60px rgba(0,0,0,0.6),
        0 0 80px rgba(201,146,42,0.08);
    transition: transform 0.6s var(--ease-out-expo), box-shadow 0.6s ease;
    z-index: 2;
}
.ms-portrait-frame:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        0 0 0 1px rgba(201,146,42,0.3),
        0 35px 80px rgba(0,0,0,0.7),
        0 0 120px rgba(201,146,42,0.15);
}

.ms-portrait-frame img {
    width: 100%; height: 100%;
    object-fit: cover;
    filter: grayscale(15%) contrast(1.05);
    transition: filter 0.6s ease, transform 0.6s var(--ease-out-expo);
}
.ms-portrait-frame:hover img {
    filter: grayscale(0%) contrast(1.1);
    transform: scale(1.04);
}

/* Cinematic overlay on photo */
.ms-portrait-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(13,11,9,0.7) 100%);
    pointer-events: none; z-index: 3;
}

/* Gold corner accents */
.ms-portrait-corner {
    position: absolute;
    width: 24px; height: 24px;
    border-color: var(--gold);
    opacity: 0.4;
    z-index: 4;
    transition: opacity 0.3s ease;
}
.ms-portrait-frame:hover .ms-portrait-corner { opacity: 0.8; }
.ms-portrait-corner--tl { top: 12px; right: 12px; border-top: 1px solid; border-right: 1px solid; }
.ms-portrait-corner--tr { top: 12px; left: 12px; border-top: 1px solid; border-left: 1px solid; }
.ms-portrait-corner--bl { bottom: 12px; right: 12px; border-bottom: 1px solid; border-right: 1px solid; }
.ms-portrait-corner--br { bottom: 12px; left: 12px; border-bottom: 1px solid; border-left: 1px solid; }

/* Author initial placeholder (when no avatar) */
.ms-portrait-initial {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(145deg, #1a1208, #0d0b09);
    font-family: var(--font-display);
    font-size: 8rem;
    color: var(--gold);
    opacity: 0.3;
    line-height: 1;
}

/* Floating ornamental particles */
.ms-portrait-particle {
    position: absolute;
    width: 4px; height: 4px;
    background: var(--gold);
    border-radius: 50%;
    opacity: 0;
    z-index: 1;
    animation: msParticleFloat 5s ease-in-out infinite;
}
.ms-portrait-particle:nth-child(1) { top: 8%; right: 5%; animation-delay: 0s; }
.ms-portrait-particle:nth-child(2) { top: 70%; left: 0%; animation-delay: 1.5s; width: 3px; height: 3px; }
.ms-portrait-particle:nth-child(3) { bottom: 15%; right: 10%; animation-delay: 3s; width: 2px; height: 2px; }
.ms-portrait-particle:nth-child(4) { top: 30%; left: 8%; animation-delay: 2s; }
@keyframes msParticleFloat {
    0%, 100% { opacity: 0; transform: translateY(0) scale(0.8); }
    50% { opacity: 0.5; transform: translateY(-20px) scale(1.3); }
}

/* Caption under portrait */
.ms-portrait-caption {
    position: absolute;
    bottom: -40px; left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-body);
    font-size: 0.72rem;
    color: var(--ash);
    letter-spacing: 0.15em;
    opacity: 0.5;
    white-space: nowrap;
    z-index: 2;
}

/* Scroll hint */
.ms-scroll-hint { position: absolute; bottom: var(--s4); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: var(--s1); opacity: 0; animation: msFadeIn 1s ease 3s forwards; }
@keyframes msFadeIn { to { opacity: 1; } }
.ms-scroll-hint span { font-family: var(--font-body); font-size: 0.75rem; color: var(--ash); }
.ms-scroll-line { width: 1px; height: 50px; background: linear-gradient(180deg, var(--gold), transparent); animation: msScrollPulse 2s ease-in-out infinite; }
@keyframes msScrollPulse { 0%, 100% { opacity: 0.3; height: 30px; } 50% { opacity: 1; height: 50px; } }

/* ═══ SECTION DIVIDER ═══ */
.ms-section-divider { display: flex; align-items: center; gap: var(--s3); padding: var(--s6) 6vw var(--s4); position: relative; z-index: 1; }
.ms-divider-ornament { font-family: var(--font-display); font-size: 2rem; color: var(--gold); opacity: 0.5; flex-shrink: 0; }
.ms-divider-rule { flex: 1; height: 1px; background: linear-gradient(90deg, var(--gold), transparent); }
.ms-section-label { font-family: var(--font-body); font-size: 0.8rem; color: var(--ash); font-weight: 400; white-space: nowrap; }

/* ═══ NOVELS ═══ */
#ms-novels { position: relative; z-index: 1; padding: 0 6vw var(--s8); }
.ms-novels-track-wrapper { overflow: hidden; position: relative; }
.ms-novels-track-wrapper::before, .ms-novels-track-wrapper::after { content: ''; position: absolute; top: 0; bottom: 0; width: 100px; z-index: 10; pointer-events: none; }
.ms-novels-track-wrapper::before { right: 0; background: linear-gradient(to left, var(--ink), transparent); }
.ms-novels-track-wrapper::after { left: 0; background: linear-gradient(to right, var(--ink), transparent); }
.ms-novels-track { display: flex; gap: var(--s3); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: var(--s2) 0 var(--s4); cursor: grab; }
.ms-novels-track:active { cursor: grabbing; }
.ms-novels-track::-webkit-scrollbar { display: none; }

/* Novel Card */
.ms-novel-card { flex: 0 0 auto; width: 260px; scroll-snap-align: start; position: relative; cursor: pointer; transition: transform 0.5s var(--ease-out-expo); }
.ms-novel-card:hover { transform: translateY(-8px); }
.ms-novel-cover-wrap {
    position: relative; width: 100%; aspect-ratio: 2/3; border-radius: 6px 16px 16px 6px; overflow: hidden;
    box-shadow: -4px 4px 0 rgba(201,146,42,0.1), 0 20px 40px rgba(0,0,0,0.5);
}
.ms-novel-cover-wrap::before { content: ''; position: absolute; top: 0; right: 0; width: 6px; height: 100%; background: linear-gradient(to left, rgba(0,0,0,0.5), transparent); z-index: 2; }
.ms-novel-cover { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease-out-expo); filter: brightness(0.9); }
.ms-novel-card:hover .ms-novel-cover { transform: scale(1.04); filter: brightness(1); }
.ms-novel-placeholder-cover { width: 100%; height: 100%; background: linear-gradient(145deg, #1a1208, #2a2018); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 3rem; color: var(--gold); opacity: 0.4; }
.ms-novel-rating { position: absolute; top: var(--s2); left: var(--s2); background: rgba(13,11,9,0.85); backdrop-filter: blur(10px); border: 1px solid rgba(201,146,42,0.3); border-radius: 100px; padding: 0.2rem 0.7rem; font-size: 0.75rem; color: var(--gold); display: flex; align-items: center; gap: 4px; z-index: 3; }
.ms-novel-hover-cta { position: absolute; inset: 0; background: rgba(13,11,9,0.7); backdrop-filter: blur(4px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s2); opacity: 0; transition: opacity 0.3s ease; z-index: 4; }
.ms-novel-card:hover .ms-novel-hover-cta { opacity: 1; }
.ms-novel-cta-btn { background: var(--gold); color: var(--ink); border: none; padding: 0.6rem 1.5rem; border-radius: 100px; font-weight: 700; font-size: 0.85rem; cursor: pointer; width: 80%; font-family: var(--font-body); transition: transform 0.2s ease; }
.ms-novel-cta-btn:hover { transform: scale(1.03); }
.ms-novel-cta-btn.ghost { background: transparent; border: 1px solid rgba(255,255,255,0.2); color: var(--parchment); }
.ms-novel-info { padding: var(--s2) var(--s1) 0; }
.ms-novel-title { font-family: var(--font-display); font-size: 1.2rem; color: var(--parchment); line-height: 1.3; margin-bottom: 4px; }
.ms-novel-genre { font-size: 0.78rem; color: var(--ash); font-family: var(--font-body); font-weight: 400; }

/* ═══ NOVEL PANEL ═══ */
#ms-novel-panel { position: fixed; bottom: 0; left: 0; right: 0; z-index: 800; transform: translateY(100%); transition: transform 0.6s var(--ease-out-expo); }
#ms-novel-panel.open { transform: translateY(0); }
.ms-panel-backdrop { position: fixed; inset: 0; z-index: 799; background: rgba(0,0,0,0.5); opacity: 0; pointer-events: none; transition: opacity 0.4s ease; }
.ms-panel-backdrop.show { opacity: 1; pointer-events: all; }
.ms-panel-box { background: #111007; border-top: 1px solid var(--line); border-radius: 24px 24px 0 0; padding: var(--s4) var(--s6) var(--s6); max-height: 85vh; overflow-y: auto; position: relative; }
.ms-panel-drag { width: 40px; height: 4px; background: var(--line); border-radius: 2px; margin: 0 auto var(--s4); }
.ms-panel-close { position: absolute; top: var(--s3); left: var(--s4); background: var(--gold-dim); border: 1px solid var(--line); border-radius: 50%; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--gold); font-size: 1rem; transition: all 0.2s ease; }
.ms-panel-close:hover { background: var(--gold); color: var(--ink); }
.ms-panel-inner { display: grid; grid-template-columns: 200px 1fr; gap: var(--s4); align-items: start; }
.ms-panel-cover { width: 100%; aspect-ratio: 2/3; border-radius: 4px 12px 12px 4px; object-fit: cover; box-shadow: -4px 8px 30px rgba(0,0,0,0.5); }
.ms-panel-cover-ph { width: 100%; aspect-ratio: 2/3; background: linear-gradient(145deg, #1a1208, #2a2018); border-radius: 4px 12px 12px 4px; display: flex; align-items: center; justify-content: center; font-size: 3rem; color: var(--gold); opacity: 0.5; }
.ms-panel-details { display: flex; flex-direction: column; gap: var(--s2); }
.ms-panel-title { font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.8rem); color: var(--parchment); line-height: 1.2; }
.ms-panel-tags { display: flex; flex-wrap: wrap; gap: var(--s1); }
.ms-panel-tag { background: var(--gold-dim); border: 1px solid rgba(201,146,42,0.2); color: var(--gold); font-size: 0.78rem; padding: 0.25rem 0.75rem; border-radius: 100px; }
.ms-panel-desc { color: var(--ash); line-height: 1.9; font-size: 0.95rem; }
.ms-panel-stars { display: flex; align-items: center; gap: var(--s1); }
.ms-star { color: var(--gold); font-size: 1.1rem; }
.ms-star.empty { color: rgba(201,146,42,0.2); }
.ms-panel-rating-text { font-size: 0.85rem; color: var(--ash); }
.ms-panel-actions { display: flex; gap: var(--s2); flex-wrap: wrap; }

/* Reviews */
.ms-reviews-section { margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid var(--line); }
.ms-reviews-title { font-family: var(--font-display); font-size: 1.4rem; color: var(--parchment); margin-bottom: var(--s3); }
.ms-review-item { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: var(--s2) var(--s3); margin-bottom: var(--s2); }
.ms-review-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--s1); }
.ms-review-name { font-weight: 600; color: var(--parchment); font-size: 0.9rem; }
.ms-review-date { font-size: 0.75rem; color: var(--ash); }
.ms-review-text { color: var(--ash); font-size: 0.9rem; line-height: 1.7; }
.ms-review-stars { display: flex; gap: 2px; margin-bottom: 4px; }
.ms-review-star { font-size: 0.8rem; color: var(--gold); }

/* Review form */
.ms-review-form { margin-top: var(--s3); }
.ms-review-form-title { font-size: 0.95rem; color: var(--parchment); margin-bottom: var(--s2); font-weight: 600; }
.ms-review-input { width: 100%; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 0.7rem 1rem; color: var(--parchment); font-family: var(--font-body); font-size: 0.9rem; outline: none; margin-bottom: var(--s1); transition: border-color 0.2s ease; }
.ms-review-input:focus { border-color: var(--gold); }
.ms-review-input::placeholder { color: var(--ash); opacity: 0.5; }
.ms-star-selector { display: flex; gap: 0.3rem; margin-bottom: var(--s2); direction: ltr; }
.ms-star-btn { font-size: 1.5rem; cursor: pointer; color: rgba(201,146,42,0.2); transition: color 0.2s ease, transform 0.2s ease; background: none; border: none; }
.ms-star-btn:hover, .ms-star-btn.active { color: var(--gold); transform: scale(1.2); }

/* ═══ LEAKS OVERLAY ═══ */
#ms-leaks-overlay { position: fixed; inset: 0; z-index: 900; background: rgba(0,0,0,0.7); backdrop-filter: blur(12px); display: none; opacity: 0; transition: opacity 0.5s ease; }
#ms-leaks-overlay.open { display: flex; }
.ms-leaks-panel { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(180deg, #0a0800 0%, #0d0b09 100%); overflow-y: auto; }
.ms-leaks-inner { max-width: 680px; margin: 0 auto; padding: var(--s6) var(--s4); }
.ms-leaks-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: var(--s6); }
.ms-leaks-eyebrow { font-family: var(--font-body); font-size: 0.8rem; color: var(--gold); font-weight: 400; margin-bottom: var(--s1); }
.ms-leaks-title { font-family: var(--font-display); font-size: clamp(2rem, 6vw, 4rem); color: var(--parchment); line-height: 1; }
.ms-leaks-close { background: var(--gold-dim); border: 1px solid var(--line); border-radius: 4px; padding: 0.6rem 1rem; color: var(--gold); cursor: pointer; font-family: var(--font-body); font-size: 0.85rem; transition: all 0.2s ease; }
.ms-leaks-close:hover { background: var(--gold); color: var(--ink); }

/* Leak Article */
.ms-leak-article { position: relative; padding: var(--s4); margin-bottom: var(--s4); border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,0.02); transition: border-color 0.3s ease; }
.ms-leak-article:hover { border-color: rgba(201,146,42,0.25); }
.ms-leak-article::before { content: ''; position: absolute; top: var(--s3); bottom: var(--s3); right: 0; width: 2px; background: linear-gradient(180deg, var(--gold), transparent); border-radius: 1px; }
.ms-leak-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--s2); }
.ms-leak-novel-tag { background: var(--gold-dim); border: 1px solid rgba(201,146,42,0.2); color: var(--gold); font-size: 0.78rem; padding: 0.2rem 0.7rem; border-radius: 100px; font-family: var(--font-body); font-weight: 400; }
.ms-leak-time { font-family: var(--font-body); font-size: 0.78rem; color: var(--ash); }
.ms-leak-content { font-size: 1rem; line-height: 2.1; color: var(--parchment); white-space: pre-wrap; word-break: break-word; }
.ms-leak-reactions { display: flex; gap: var(--s1); margin-top: var(--s3); padding-top: var(--s2); border-top: 1px solid var(--line); }
.ms-reaction-btn { display: flex; align-items: center; gap: 5px; background: var(--paper); border: 1px solid var(--line); border-radius: 100px; padding: 0.3rem 0.8rem; cursor: pointer; font-size: 0.9rem; color: var(--ash); transition: all 0.2s ease; font-family: var(--font-body); }
.ms-reaction-btn:hover { border-color: var(--gold); color: var(--gold); transform: scale(1.05); }
.ms-reaction-count { font-family: var(--font-body); font-size: 0.82rem; font-weight: 400; }

/* Comments */
.ms-leak-comments { margin-top: var(--s3); }
.ms-comment-item { padding: var(--s1) var(--s2); border-radius: 8px; margin-bottom: var(--s1); background: rgba(255,255,255,0.02); }
.ms-comment-name { font-weight: 600; font-size: 0.85rem; color: var(--gold); margin-bottom: 2px; }
.ms-comment-text { font-size: 0.85rem; color: var(--ash); line-height: 1.6; }
.ms-comment-form { display: flex; flex-direction: column; gap: var(--s1); margin-top: var(--s2); }
.ms-comment-form-row { display: flex; gap: var(--s1); }
.ms-comment-input { flex: 1; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 0.5rem 0.8rem; color: var(--parchment); font-family: var(--font-body); font-size: 0.85rem; outline: none; }
.ms-comment-input:focus { border-color: var(--gold); }
.ms-comment-submit { background: var(--gold); color: var(--ink); border: none; border-radius: 8px; padding: 0.5rem 1rem; cursor: pointer; font-weight: 700; font-size: 0.85rem; font-family: var(--font-body); transition: opacity 0.2s ease; }
.ms-comment-submit:hover { opacity: 0.85; }

/* ═══ STORES ═══ */
#ms-stores { position: relative; z-index: 1; padding: 0 6vw var(--s8); }
.ms-stores-grid { display: flex; flex-wrap: wrap; gap: var(--s2); }
.ms-store-pill { display: flex; align-items: center; gap: 0.5rem; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 0.8rem 1.5rem; color: var(--parchment); text-decoration: none; font-size: 0.9rem; transition: all 0.3s ease; position: relative; overflow: hidden; }
.ms-store-pill::before { content: ''; position: absolute; inset: 0; background: var(--gold-glow); opacity: 0; transition: opacity 0.3s ease; }
.ms-store-pill:hover { border-color: var(--gold); color: var(--gold); transform: translateY(-2px); }
.ms-store-pill:hover::before { opacity: 1; }
.ms-store-arrow { transition: transform 0.3s ease; }
.ms-store-pill:hover .ms-store-arrow { transform: translate(3px, -3px); }

/* ═══ FOOTER ═══ */
.ms-footer { position: relative; z-index: 1; border-top: 1px solid var(--line); padding: var(--s6) 6vw; display: flex; justify-content: space-between; align-items: center; }
.ms-footer-brand { font-family: var(--font-display); font-size: 2.5rem; color: var(--gold); opacity: 0.5; }
.ms-footer-meta { font-family: var(--font-body); font-size: 0.78rem; color: var(--ash); font-weight: 300; text-align: left; }
.ms-footer-nav { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.ms-footer-nav a { color: var(--ash); text-decoration: none; font-size: 0.85rem; transition: color 0.3s ease; }
.ms-footer-nav a:hover { color: var(--gold); }

/* ═══ ANIMATIONS ═══ */
.ms-reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo); }
.ms-reveal.visible { opacity: 1; transform: translateY(0); }
.ms-reveal-delay-1 { transition-delay: 0.1s; }
.ms-reveal-delay-2 { transition-delay: 0.2s; }
.ms-reveal-delay-3 { transition-delay: 0.3s; }

/* ═══ RESPONSIVE 900px ═══ */
@media (max-width: 900px) {
    #ms-hero { grid-template-columns: 1fr; padding: 5.5rem var(--s4) var(--s6); gap: var(--s6); }
    .ms-hero-portrait { order: -1; padding-top: var(--s3); }
    .ms-portrait-stage { width: 260px; height: 340px; }
    .ms-portrait-frame { width: 220px; height: 300px; }
    .ms-portrait-initial { font-size: 6rem; }
    .ms-hero-stats { gap: var(--s3); }
    .ms-panel-inner { grid-template-columns: 1fr; }
    .ms-panel-cover, .ms-panel-cover-ph { width: 160px; }
    #ms-nav { width: calc(100% - var(--s4)); top: var(--s2); }
    .ms-nav-strip { overflow-x: auto; border-radius: 16px; scrollbar-width: none; justify-content: space-between; }
    .ms-nav-strip::-webkit-scrollbar { display: none; }
    .ms-nav-progress { display: none; }
    .ms-nav-strip a { padding: 0.4rem 0.6rem; font-size: 0.82rem; }
    .ms-novel-card { width: 180px; }
    .ms-footer { flex-direction: column; gap: var(--s2); text-align: center; }
    .ms-footer-meta { text-align: center; }
    .ms-hero-content { padding-top: 0; }
}

/* ═══ RESPONSIVE 600px ═══ */
@media (max-width: 600px) {
    :root { --s6: 2.5rem; --s8: 3rem; }
    #ms-hero { padding: 5rem var(--s3) var(--s4); gap: var(--s4); }
    .ms-hero-name { font-size: clamp(2.8rem, 14vw, 4rem); }
    .ms-hero-bio { font-size: 0.95rem; }
    .ms-hero-stats { flex-wrap: wrap; gap: var(--s3); }
    .ms-stat-num { font-size: 1.8rem; }
    .ms-portrait-stage { width: 220px; height: 290px; }
    .ms-portrait-frame { width: 190px; height: 260px; }
    .ms-portrait-initial { font-size: 5rem; }
    .ms-portrait-glow { width: 200px; height: 200px; }
    .ms-portrait-caption { font-size: 0.65rem; }
    .ms-section-divider { padding: var(--s3) var(--s3) var(--s2); gap: var(--s2); }
    .ms-divider-ornament { font-size: 1.4rem; }
    .ms-section-label { font-size: 0.78rem; }
    #ms-novels, #ms-stores { padding-left: var(--s3); padding-right: var(--s3); }
    .ms-novel-card { width: 155px; }
    .ms-panel-box { padding: var(--s3) var(--s3) var(--s6); }
    .ms-panel-box .ms-panel-close { left: var(--s3); }
    .ms-panel-title { font-size: 1.8rem; }
    .ms-leaks-inner { padding: 4rem var(--s3) var(--s4); }
    .ms-leaks-header { flex-direction: column; gap: var(--s3); }
    .ms-leaks-close { align-self: flex-start; }
    .ms-leak-article { padding: var(--s3); }
    .ms-leak-reactions { flex-wrap: wrap; }
    .ms-footer { padding: var(--s4) var(--s3); }
    .ms-btn-primary, .ms-btn-ghost { width: 100%; justify-content: center; }
    .ms-hero-actions { flex-direction: column; }
    .ms-social-dock { flex-wrap: wrap; gap: var(--s1); }
    .ms-footer-nav { flex-direction: column; gap: var(--s1); text-align: center; }
}
