/* ============================================
   martiallaw.wiki — Blobitecture Monument
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Quicksand', sans-serif;
    font-weight: 400;
    color: #3a4a5c;
    background:
        radial-gradient(ellipse at 23% 67%, rgba(138, 155, 181, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 78% 34%, rgba(220, 228, 238, 0.12) 0%, transparent 40%),
        radial-gradient(ellipse at 45% 89%, rgba(138, 155, 181, 0.06) 0%, transparent 60%),
        linear-gradient(137deg, rgba(220, 228, 238, 0.04) 0%, transparent 30%, rgba(138, 155, 181, 0.05) 70%, transparent 100%),
        #f0f3f8;
    background-attachment: fixed;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.72;
    overflow-x: hidden;
    animation: marbleDrift 30s ease-in-out infinite alternate;
}

@keyframes marbleDrift {
    0% { background-position: 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%; }
    100% { background-position: 3% 2%, -2% 3%, 1% -2%, -1% 2%, 0% 0%; }
}

/* --- Typography --- */
h1, h2 {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    color: #2c3e6b;
    letter-spacing: 0.03em;
}

h2 {
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1rem;
}

em {
    font-style: italic;
    color: #2c3e6b;
}

/* --- Floating Navigation Pill --- */
#nav-pill {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    height: 48px;
    border-radius: 24px;
    background: rgba(220, 228, 238, 0.35);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
}

#nav-pill a {
    font-family: 'Quicksand', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    color: #3a4a5c;
    text-decoration: none;
    padding: 0 14px;
    transition: color 0.3s ease;
}

#nav-pill a:hover {
    color: #2c3e6b;
}

.nav-divider {
    width: 1px;
    height: 18px;
    background: rgba(138, 155, 181, 0.3);
}

/* --- Proclamation Wall --- */
#proclamation {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

.proclamation-blob {
    width: 92%;
    height: 88%;
    max-width: 1400px;
    border-radius: 60px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(24px) saturate(1.2);
    -webkit-backdrop-filter: blur(24px) saturate(1.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: blobBreathe 6s ease-in-out infinite;
    box-shadow: 0 12px 60px rgba(0, 0, 0, 0.04);
    opacity: 0;
    transform: scale(0.92);
}

.proclamation-blob.animate-in {
    animation: blobEnter 1000ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards, blobBreathe 6s ease-in-out 1s infinite;
}

@keyframes blobEnter {
    0% { opacity: 0; transform: scale(0.92); }
    100% { opacity: 1; transform: scale(1.0); }
}

@keyframes blobBreathe {
    0%, 100% { transform: scale(1.0); }
    50% { transform: scale(1.015); }
}

.domain-title {
    font-size: clamp(2.8rem, 7vw, 6rem);
    color: #2c3e6b;
    letter-spacing: 0.03em;
    text-align: center;
}

.domain-title .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(8px);
}

.domain-title .char.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.proclamation-subtitle {
    font-family: 'Quicksand', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.5vw, 1.2rem);
    color: #6b7d94;
    text-align: center;
    margin-top: 16px;
    max-width: 600px;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.proclamation-subtitle.visible {
    opacity: 1;
}

/* --- Seal --- */
.seal {
    margin-bottom: 32px;
    opacity: 0;
    transition: opacity 1s ease;
    animation: sealRotate 90s linear infinite;
}

.seal.visible {
    opacity: 1;
}

@keyframes sealRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* --- Index Grid --- */
#index-grid {
    padding: 80px 20px 60px;
    max-width: 1200px;
    margin: 0 auto;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto;
    gap: 8px;
}

.blob-cell {
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    padding: 36px 32px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.04);
    opacity: 0;
    transform: scale(0.7);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease;
    cursor: default;
}

.blob-cell.inflated {
    opacity: 1;
    transform: scale(1.0);
}

.blob-cell:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 40px rgba(168, 192, 224, 0.25);
}

.cell-1 { border-radius: 60px 30px 50px 40px; grid-row: span 1; }
.cell-2 { border-radius: 30px 60px 40px 50px; grid-row: span 1; }
.cell-3 { border-radius: 50px 40px 60px 30px; grid-row: span 1; }
.cell-4 { border-radius: 40px 50px 30px 60px; grid-row: span 1; }
.cell-5 { border-radius: 55px 35px 45px 65px; grid-row: span 1; }
.cell-6 { border-radius: 35px 65px 55px 45px; grid-row: span 1; }

/* Unique marble veins per cell */
.cell-1 { background: radial-gradient(ellipse at 20% 30%, rgba(220, 228, 238, 0.15) 0%, transparent 60%), rgba(255, 255, 255, 0.18); }
.cell-2 { background: radial-gradient(ellipse at 80% 70%, rgba(138, 155, 181, 0.1) 0%, transparent 50%), rgba(255, 255, 255, 0.18); }
.cell-3 { background: radial-gradient(ellipse at 50% 20%, rgba(220, 228, 238, 0.12) 0%, transparent 55%), rgba(255, 255, 255, 0.18); }
.cell-4 { background: radial-gradient(ellipse at 30% 80%, rgba(138, 155, 181, 0.08) 0%, transparent 50%), rgba(255, 255, 255, 0.18); }
.cell-5 { background: radial-gradient(ellipse at 70% 40%, rgba(220, 228, 238, 0.14) 0%, transparent 45%), rgba(255, 255, 255, 0.18); }
.cell-6 { background: radial-gradient(ellipse at 40% 60%, rgba(138, 155, 181, 0.12) 0%, transparent 55%), rgba(255, 255, 255, 0.18); }

.blob-cell h2 {
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    margin-bottom: 12px;
}

.blob-cell p {
    font-size: 0.92rem;
    line-height: 1.65;
    color: #3a4a5c;
}

.cell-citation {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    color: #6b7d94;
    background: rgba(220, 228, 238, 0.25);
    border-radius: 6px;
    padding: 2px 8px;
    display: inline-block;
    margin-top: 8px;
}

/* --- Redaction Bars --- */
.redacted {
    display: inline-block;
    background: #1a1e2b;
    color: transparent;
    border-radius: 3px;
    padding: 0 6px;
    cursor: pointer;
    position: relative;
    transition: background 0.15s ease;
    user-select: none;
    line-height: 1.1em;
}

.redacted:hover {
    animation: shake 200ms ease 2;
}

.redacted.flash {
    background: #c43a4b;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

/* Redaction Tooltip */
.redact-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    background: rgba(220, 228, 238, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 6px 16px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: #2c3e6b;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 100;
}

.redact-tooltip.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* --- Retro Pattern Bands --- */
.retro-band {
    height: 2px;
    margin: 60px auto;
    max-width: 800px;
    background: repeating-linear-gradient(
        90deg,
        #dce4ee 0px,
        #dce4ee 12px,
        transparent 12px,
        transparent 18px,
        #dce4ee 18px,
        #dce4ee 22px,
        transparent 22px,
        transparent 30px
    );
    opacity: 0.3;
    background-size: 0% 2px;
    background-repeat: no-repeat;
    transition: background-size 1.2s ease;
}

.retro-band.drawn {
    background-size: 100% 2px;
}

/* --- Dossier Panels --- */
#dossiers {
    padding: 60px 20px 80px;
    max-width: 1100px;
    margin: 0 auto;
}

.dossier-panel {
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    padding: 60px 40px;
    margin-bottom: 0;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.04);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.dossier-panel.visible {
    opacity: 1;
    transform: translateY(0);
}

.panel-1 { border-radius: 80px 20px 60px 40px; animation: cornerBreathe1 15s ease-in-out infinite; }
.panel-2 { border-radius: 30px 70px 40px 60px; animation: cornerBreathe2 15s ease-in-out infinite; }
.panel-3 { border-radius: 60px 40px 80px 20px; animation: cornerBreathe3 15s ease-in-out infinite; }

@keyframes cornerBreathe1 {
    0%, 100% { border-radius: 80px 20px 60px 40px; }
    50% { border-radius: 70px 30px 70px 30px; }
}
@keyframes cornerBreathe2 {
    0%, 100% { border-radius: 30px 70px 40px 60px; }
    50% { border-radius: 40px 60px 50px 50px; }
}
@keyframes cornerBreathe3 {
    0%, 100% { border-radius: 60px 40px 80px 20px; }
    50% { border-radius: 50px 50px 70px 30px; }
}

.dossier-content {
    max-width: 680px;
    margin: 0 auto;
}

.dossier-content h2 {
    margin-bottom: 24px;
}

/* --- Footer --- */
#footer {
    padding: 0 20px 0;
    margin-top: 80px;
}

.footer-blob {
    width: 100%;
    border-radius: 80px 80px 0 0;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    padding: 60px 40px 40px;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.03);
}

.footer-content {
    max-width: 680px;
    margin: 0 auto;
    text-align: center;
}

.footer-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 1.4rem;
    color: #2c3e6b;
    letter-spacing: 0.03em;
    margin-bottom: 16px;
}

.footer-disclaimer {
    font-size: 0.85rem;
    color: #6b7d94;
    line-height: 1.65;
    margin-bottom: 20px;
}

.footer-citations {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 24px;
}

.footer-copy {
    font-size: 0.8rem;
    color: #8a9bb5;
}

/* --- Background Blobs --- */
.bg-blob {
    position: fixed;
    border-radius: 50%;
    background: #a8c0e0;
    opacity: 0.08;
    pointer-events: none;
    z-index: -1;
}

.bg-blob-1 {
    width: 500px;
    height: 500px;
    top: 10%;
    left: -10%;
    animation: blobFloat1 20s ease-in-out infinite alternate;
}

.bg-blob-2 {
    width: 400px;
    height: 400px;
    top: 50%;
    right: -8%;
    animation: blobFloat2 22s ease-in-out infinite alternate;
}

.bg-blob-3 {
    width: 350px;
    height: 350px;
    bottom: 5%;
    left: 30%;
    animation: blobFloat3 18s ease-in-out infinite alternate;
}

@keyframes blobFloat1 {
    0% { transform: translate(0, 0); }
    100% { transform: translate(15px, -10px); }
}

@keyframes blobFloat2 {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-15px, 10px); }
}

@keyframes blobFloat3 {
    0% { transform: translate(0, 0); }
    100% { transform: translate(10px, -15px); }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .grid-container {
        grid-template-columns: 1fr;
    }

    .proclamation-blob {
        width: 96%;
        height: 85%;
        border-radius: 40px;
    }

    #nav-pill {
        padding: 0 12px;
    }

    #nav-pill a {
        font-size: 0.75rem;
        padding: 0 8px;
    }

    .dossier-panel {
        padding: 36px 24px;
    }

    .footer-blob {
        border-radius: 40px 40px 0 0;
    }
}
