:root {
    --gold: #FFD700;
    --gold-dim: rgba(255, 215, 0, 0.15);
    --gold-hover: #FFC107;
    --black: #000000;
    --bg: #0a0a0a;
    --surface: #111111;
    --surface-hover: #1a1a1a;
    --border: #222222;
    --text: #e8e8e8;
    --text-muted: rgba(255, 255, 255, 0.5);
    --text-dim: rgba(255, 255, 255, 0.3);
    --serif: 'Cormorant Garamond', Georgia, serif;
    --sans: 'Inter', -apple-system, system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* HEADER */
header {
    background: var(--black);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-link { display: flex; text-decoration: none; }

.phoenix { display: block; }

.brand-text h1 {
    font-family: var(--serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.tagline {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.tagline a {
    color: var(--gold);
    text-decoration: none;
}

.tagline a:hover { text-decoration: underline; }

.header-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#translation-select {
    background: var(--surface);
    color: var(--gold);
    border: 1px solid var(--border);
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    font-family: var(--sans);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    cursor: pointer;
}

#translation-select:focus { outline: 1px solid var(--gold); }

.api-status {
    display: flex;
    align-items: center;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #555;
    transition: background 0.3s;
}

.status-dot.online { background: #4ade80; }
.status-dot.offline { background: #ef4444; }

/* NAV */
nav {
    background: var(--black);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav .container {
    display: flex;
    gap: 0;
}

.nav-link {
    display: block;
    padding: 0.75rem 1.25rem;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.nav-link:hover { color: var(--text); }

.nav-link.active {
    color: var(--gold);
    border-bottom-color: var(--gold);
}

/* MAIN */
main { flex: 1; padding: 2rem 0; }

.section { display: none; }
.section.active { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* READ CONTROLS */
.read-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.read-controls select {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-family: var(--sans);
    font-size: 0.9rem;
    cursor: pointer;
    flex: 1;
    min-width: 0;
}

#book-select { flex: 3; }
#chapter-select { flex: 1; max-width: 100px; }

.read-controls select:focus { outline: 1px solid var(--gold); }

/* BUTTONS */
.btn {
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 4px;
    font-family: var(--sans);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn.gold {
    background: var(--gold);
    color: var(--black);
}

.btn.gold:hover { background: var(--gold-hover); }

.btn.gold:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-nav {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.4rem 1rem;
    border-radius: 4px;
    font-family: var(--sans);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-nav:hover {
    border-color: var(--gold);
    color: var(--gold);
}

/* WELCOME */
.welcome-message {
    text-align: center;
    padding: 4rem 1rem;
}

.scripture-quote {
    font-family: var(--serif);
    font-size: 1.6rem;
    font-style: italic;
    color: var(--gold);
    line-height: 1.5;
    max-width: 560px;
    margin: 0 auto 0.75rem;
}

.scripture-ref {
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.welcome-sub {
    font-family: var(--serif);
    font-size: 1rem;
    color: var(--text-dim);
    font-style: italic;
    margin-bottom: 2rem;
}

.welcome-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.welcome-actions .btn {
    font-size: 0.8rem;
    padding: 0.4rem 1rem;
}

/* VERSE DISPLAY */
.verse-display {
    min-height: 300px;
}

.chapter-heading {
    font-family: var(--serif);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.verse {
    margin-bottom: 1rem;
    line-height: 1.8;
    font-size: 1.05rem;
}

.verse-num {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gold);
    vertical-align: super;
    margin-right: 0.25rem;
    opacity: 0.7;
}

.verse-text {
    font-family: var(--serif);
    font-size: 1.15rem;
    color: var(--text);
}

.section-heading {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gold);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin: 1.5rem 0 0.5rem;
    opacity: 0.6;
}

/* CHAPTER NAV */
.chapter-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.chapter-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

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

#search-input {
    flex: 1;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.75rem 1rem;
    border-radius: 4px;
    font-family: var(--sans);
    font-size: 1rem;
}

#search-input::placeholder { color: var(--text-dim); }
#search-input:focus { outline: 1px solid var(--gold); }

.results-container {
    min-height: 200px;
}

.result-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.result-item:hover { border-color: var(--gold); }

.result-ref {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gold);
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
}

.result-text {
    font-family: var(--serif);
    font-size: 1.05rem;
    color: var(--text);
    line-height: 1.6;
}

.result-section-tag {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-top: 0.35rem;
}

.search-status {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem 0;
    font-size: 0.9rem;
}

/* BROWSE */
.section-title {
    font-family: var(--serif);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gold);
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.book-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.6rem 0.75rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    text-align: center;
}

.book-card:hover {
    border-color: var(--gold);
    background: var(--surface-hover);
}

.book-card .book-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text);
}

.book-card .book-chapters {
    font-size: 0.65rem;
    color: var(--text-dim);
    margin-top: 0.15rem;
}

/* LOADING */
.loading {
    text-align: center;
    padding: 3rem 0;
    color: var(--text-muted);
}

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

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

.error-message {
    text-align: center;
    color: #ef4444;
    padding: 2rem 0;
    font-size: 0.9rem;
}

/* FOOTER */
footer {
    background: var(--black);
    border-top: 1px solid var(--border);
    padding: 2.5rem 0 2rem;
    margin-top: auto;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.footer-brand {
    text-align: center;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.footer-title {
    font-family: var(--serif);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gold);
    text-decoration: none;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 0.25rem;
}

.footer-title:hover { opacity: 0.8; }

.footer-subtitle {
    font-family: var(--serif);
    font-size: 0.8rem;
    font-style: italic;
    color: var(--text-dim);
}

.footer-grid {
    display: flex;
    justify-content: center;
    gap: 3rem;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.footer-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 0.15rem;
}

.footer-col a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.2s;
}

.footer-col a:hover { color: var(--gold); }

.footer-stat {
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* RESPONSIVE */
@media (max-width: 600px) {
    .brand-text h1 { font-size: 1.2rem; }
    .scripture-quote { font-size: 1.3rem; }
    .read-controls { flex-direction: column; }
    #chapter-select { max-width: none; }
    .books-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
    .nav-link { padding: 0.6rem 0.75rem; font-size: 0.8rem; }
    .welcome-message { padding: 2rem 0.5rem; }
    .footer-grid { flex-direction: column; align-items: center; gap: 1.25rem; }
    .footer-col { align-items: center; }
}
