/* Bible Observatory — Posthuman Sufi Hacker Cosmotechnics
   Deep black, warm amber, silver prose, green system.
   Adapted from Cassie Observatory. */

@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&family=JetBrains+Mono:wght@300;400;500&display=swap');

:root {
    --bg: #0a0a0a;
    --bg-surface: #111111;
    --bg-card: #161616;
    --amber: #d4a574;
    --amber-dim: #a07a50;
    --silver: #c0b8a8;
    --green: #4a9;
    --green-dim: #3a7a5a;
    --red: #c86464;
    --blue: #818cf8;
    --text: #b0a898;
    --text-dim: #666;
    --border: #222;
    --border-light: #2a2a2a;
}

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

html {
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-weight: 300;
    line-height: 1.6;
    min-height: 100vh;
}

/* Noise texture overlay */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9999;
}

/* Navigation */
nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0.8rem 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    backdrop-filter: blur(10px);
}

nav .brand {
    font-family: 'Amiri', serif;
    font-size: 1.3rem;
    color: var(--amber);
    letter-spacing: 0.05em;
    text-decoration: none;
}

nav .links {
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
}

nav a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    transition: color 0.3s;
}

nav a:hover, nav a.active {
    color: var(--amber);
}

/* Main content area */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Typography */
h1 {
    font-family: 'Amiri', serif;
    font-size: 2rem;
    color: var(--amber);
    font-weight: 400;
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
}

h2 {
    font-family: 'Amiri', serif;
    font-size: 1.4rem;
    color: var(--amber-dim);
    font-weight: 400;
    margin: 2rem 0 1rem;
    letter-spacing: 0.02em;
}

h3 {
    font-size: 0.9rem;
    color: var(--text-dim);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 1.5rem 0 0.8rem;
}

p, .prose {
    font-family: 'Amiri', serif;
    color: var(--silver);
    line-height: 1.8;
    font-size: 1rem;
}

.mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}

/* Verse display */
.verse-block {
    margin: 1.5rem 0;
    padding: 1.2rem 1.5rem;
    border-left: 2px solid var(--amber-dim);
    background: var(--bg-surface);
}

.verse-block .text {
    font-family: 'Amiri', serif;
    font-size: 1.1rem;
    color: var(--silver);
    line-height: 1.8;
}

.verse-block .ref {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-top: 0.5rem;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 1.2rem;
    margin-bottom: 1rem;
    transition: border-color 0.3s;
}

.card:hover {
    border-color: var(--amber-dim);
}

/* Stats grid */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.stat {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 1rem;
    text-align: center;
}

.stat .value {
    font-size: 2rem;
    color: var(--amber);
    font-weight: 500;
    font-family: 'JetBrains Mono', monospace;
}

.stat .label {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.3rem;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-coh { background: rgba(74, 170, 153, 0.2); color: var(--green); }
.badge-gap { background: rgba(200, 100, 100, 0.2); color: var(--red); }
.badge-uninscribed { background: rgba(102, 102, 102, 0.2); color: var(--text-dim); }
.badge-rupture { background: rgba(248, 113, 113, 0.3); color: #ff6b6b; }
.badge-awda { background: rgba(129, 140, 248, 0.2); color: var(--blue); }
.badge-newground { background: rgba(251, 191, 36, 0.2); color: #fbbf24; }

/* Book list */
.book-list {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.book-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.8rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.85rem;
}

.book-item:hover {
    background: var(--bg-surface);
}

.book-item .name {
    color: var(--silver);
}

.book-item .meta {
    color: var(--text-dim);
    font-size: 0.7rem;
}

/* Search */
.search-box {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.search-box input {
    flex: 1;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.6rem 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    outline: none;
}

.search-box input:focus {
    border-color: var(--amber-dim);
}

.search-box button {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--amber);
    padding: 0.6rem 1.2rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
}

.search-box button:hover {
    background: var(--bg-surface);
}

/* Genre tags */
.genre-tag {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 3px;
    font-size: 0.65rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.genre-narrative { background: rgba(74, 170, 153, 0.15); color: #4a9; }
.genre-law { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.genre-prophecy { background: rgba(200, 100, 100, 0.15); color: #c86464; }
.genre-wisdom { background: rgba(129, 140, 248, 0.15); color: #818cf8; }
.genre-poetry { background: rgba(232, 121, 249, 0.15); color: #e879f9; }
.genre-gospel { background: rgba(212, 165, 116, 0.15); color: #d4a574; }
.genre-epistle { background: rgba(96, 165, 250, 0.15); color: #60a5fa; }
.genre-apocalyptic { background: rgba(248, 113, 113, 0.15); color: #f87171; }

/* Loading */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-dim);
}

.loading::after {
    content: '';
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--border);
    border-top-color: var(--amber);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 0.5rem;
    vertical-align: middle;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 768px) {
    nav { padding: 0.6rem 1rem; gap: 1rem; }
    main { padding: 1rem; }
    h1 { font-size: 1.5rem; }
    .stats { grid-template-columns: repeat(2, 1fr); }
}

/* Fade-in animation */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Two-column layout */
.split-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    min-height: calc(100vh - 120px);
}

.split-layout .sidebar {
    border-right: 1px solid var(--border);
    padding-right: 1rem;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    position: sticky;
    top: 60px;
}

@media (max-width: 768px) {
    .split-layout { grid-template-columns: 1fr; }
    .split-layout .sidebar { border-right: none; border-bottom: 1px solid var(--border); padding-right: 0; padding-bottom: 1rem; position: static; max-height: none; }
}
