: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;
}

body.theme-light {
    --gold: #b58900;
    --gold-dim: rgba(181, 137, 0, 0.12);
    --gold-hover: #9f7900;
    --black: #ffffff;
    --bg: #f6f6f2;
    --surface: #ffffff;
    --surface-hover: #f2f2ed;
    --border: #d9d9d1;
    --text: #1a1a1a;
    --text-muted: rgba(26, 26, 26, 0.62);
    --text-dim: rgba(26, 26, 26, 0.45);
}

* { 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;
    transition: background 0.2s ease, color 0.2s ease;
}

.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: 0.75rem;
    flex-wrap: wrap;
}

/* VERSE RANGE */
.verse-range {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

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

.verse-range input[type="number"] {
    width: 60px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.35rem 0.5rem;
    border-radius: 4px;
    font-family: var(--sans);
    font-size: 0.85rem;
    text-align: center;
    -moz-appearance: textfield;
}

.verse-range input[type="number"]::-webkit-inner-spin-button,
.verse-range input[type="number"]::-webkit-outer-spin-button {
    opacity: 1;
}

.verse-range input[type="number"]:focus {
    outline: 1px solid var(--gold);
}

.range-sep {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.btn-sm {
    padding: 0.3rem 0.75rem;
    font-size: 0.75rem;
}

.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);
}

#theme-toggle {
    min-width: 84px;
    text-align: center;
}

/* 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 {
    position: relative;
    padding-right: 3.25rem;
    margin-bottom: 1rem;
    line-height: 1.8;
    font-size: 1.05rem;
}

.verse-copy {
    position: absolute;
    right: 0;
    top: 0.2rem;
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0.15rem 0.25rem;
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
    line-height: 1;
    font-family: var(--sans);
    pointer-events: none;
}

.verse:hover .verse-copy,
.verse-copy.copied {
    opacity: 1;
    pointer-events: auto;
}

.verse-copy:hover { color: var(--gold); }
.verse-copy.copied { color: #4ade80; }

.verse-bookmark {
    position: absolute;
    right: 1.75rem;
    top: 0.2rem;
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0.15rem 0.25rem;
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
    line-height: 1;
    font-family: var(--sans);
    pointer-events: none;
}

.verse:hover .verse-bookmark {
    opacity: 1;
    pointer-events: auto;
}

.verse-bookmark:hover { color: var(--gold); }

.verse-bookmark.saved {
    color: var(--gold);
    opacity: 1;
    pointer-events: auto;
}

.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: flex-start;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.chapter-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: auto;
}

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

.keyboard-hint {
    font-size: 0.7rem;
    color: var(--text-dim);
    letter-spacing: 0.04em;
}

/* 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 {
    position: relative;
    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;
}

.bookmark-remove {
    position: absolute;
    top: 0.45rem;
    right: 0.5rem;
    border: none;
    background: transparent;
    color: var(--text-dim);
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.2rem;
}

.bookmark-remove:hover { color: var(--gold); }

.bookmarks-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 4rem 0;
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.8rem;
}

.guide-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem 1.1rem;
}

.guide-card h3 {
    font-size: 0.9rem;
    color: var(--gold);
    margin-bottom: 0.4rem;
    letter-spacing: 0.03em;
}

.guide-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.55;
}

.analysis-panel {
    margin-top: 1.5rem;
    padding: 1.25rem 1.5rem;
    background: var(--surface);
    border-left: 2px solid var(--gold);
    border-radius: 0 4px 4px 0;
}

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

.analysis-summary {
    font-family: var(--serif);
    font-size: 1.05rem;
    color: var(--text);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.analysis-context,
.analysis-reflection {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.analysis-themes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.analysis-theme-pill {
    font-size: 0.75rem;
    color: var(--gold);
    border: 1px solid rgba(255, 215, 0, 0.2);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
}

/* 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);
}

/* TODAY'S READINGS */
.today-header,
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.today-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.today-controls select {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    font-family: var(--sans);
    font-size: 0.82rem;
    cursor: pointer;
}

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

.today-display,
.calendar-display,
.deepdive-display {
    min-height: 200px;
}

.today-empty,
.calendar-empty {
    text-align: center;
    padding: 4rem 1rem;
}

.today-prompt {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Season Banner */
.season-banner {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.season-color-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.season-info {
    flex: 1;
}

.season-name {
    font-family: var(--serif);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--gold);
}

.season-date {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.fallback-note {
    background: rgba(255, 215, 0, 0.08);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 4px;
    padding: 0.6rem 1rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    font-style: italic;
}

/* Reading Block */
.reading-block {
    margin-bottom: 2rem;
}

.reading-block-title {
    font-family: var(--serif);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--gold);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

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

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

.reading-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.reading-citation {
    font-family: var(--serif);
    font-size: 1.05rem;
    color: var(--gold);
    margin-bottom: 0.35rem;
}

.reading-verses {
    font-family: var(--serif);
    font-size: 1rem;
    color: var(--text);
    line-height: 1.8;
}

.reading-verses .rv-num {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--gold);
    vertical-align: super;
    margin-right: 0.15rem;
    opacity: 0.6;
}

.reading-no-text {
    font-size: 0.85rem;
    color: var(--text-dim);
    font-style: italic;
}

/* Deep Dive */
.deepdive-card {
    background: var(--surface);
    border-left: 3px solid var(--gold);
    border-radius: 0 6px 6px 0;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.deepdive-theme {
    font-family: var(--serif);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 1.25rem;
    line-height: 1.3;
}

.deepdive-section {
    margin-bottom: 1.25rem;
}

.deepdive-section-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
    display: block;
}

.deepdive-section-text {
    font-family: var(--serif);
    font-size: 1rem;
    color: var(--text);
    line-height: 1.8;
}

.deepdive-section-text.prayer {
    font-style: italic;
    color: var(--text-muted);
}

.deepdive-connections {
    list-style: none;
    padding: 0;
}

.deepdive-connections li {
    font-family: var(--serif);
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.7;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border);
}

.deepdive-connections li:last-child { border-bottom: none; }

.deepdive-btn-wrap {
    text-align: center;
    margin-top: 2rem;
}

/* Calendar Upcoming */
.upcoming-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.upcoming-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.upcoming-card:hover { border-color: var(--gold); }

.upcoming-date {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.upcoming-name {
    font-family: var(--serif);
    font-size: 1rem;
    color: var(--text);
    margin-top: 0.25rem;
}

.upcoming-citations {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 0.3rem;
    line-height: 1.5;
}

/* 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; }
    .keyboard-hint { display: none; }
    .today-header, .calendar-header { flex-direction: column; align-items: flex-start; }
    .today-controls { width: 100%; }
    .today-controls select { flex: 1; }
    .season-banner { flex-direction: column; text-align: center; }
}
