:root {
    --bg: #f4ecdf;
    --ink: #26211a;
    --muted: #665948;
    --line: rgba(94, 72, 42, 0.16);
    --accent: #866438;
    --accent-deep: #5f4729;
    --accent-soft: rgba(134, 100, 56, 0.14);
    --violet: #6d4a80;
    --violet-deep: #50335f;
    --violet-soft: rgba(109, 74, 128, 0.14);
    --olive: #546147;
    --ok: #1d6f52;
    --warn: #996d11;
    --danger: #9f2f27;
    --shadow: 0 20px 55px rgba(67, 50, 24, 0.12);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --body-font: "Aptos", "Trebuchet MS", Verdana, sans-serif;
    --display-font: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, serif;
}

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

html {
    color-scheme: light;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--body-font);
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(109, 74, 128, 0.14), transparent 28%),
        radial-gradient(circle at top right, rgba(84, 97, 71, 0.14), transparent 24%),
        linear-gradient(180deg, #f8f1e6 0%, #f2eadc 48%, #efe3d0 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.28;
    background-image:
        linear-gradient(rgba(109, 74, 128, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(134, 100, 56, 0.05) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 88%);
}

.app-preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at top left, rgba(109, 74, 128, 0.18), transparent 30%),
        linear-gradient(180deg, rgba(248, 241, 230, 0.98), rgba(241, 232, 217, 0.98));
    transition: opacity 260ms ease, visibility 260ms ease;
}

.app-preloader.is-hidden {
    opacity: 0;
    visibility: hidden;
}

.app-preloader-card {
    display: grid;
    justify-items: center;
    gap: 18px;
    width: min(100%, 380px);
    padding: 28px 26px;
    border: 1px solid rgba(109, 74, 128, 0.16);
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(255, 252, 248, 0.96), rgba(247, 240, 230, 0.94));
    box-shadow: 0 18px 40px rgba(80, 51, 95, 0.1);
}

.app-preloader-logo {
    width: min(220px, 68vw);
    height: auto;
    display: block;
    animation: preloadFloat 1.8s ease-in-out infinite;
}

.app-preloader-text {
    margin: 0;
    text-align: center;
    color: var(--violet-deep);
    font-weight: 700;
    letter-spacing: 0.03em;
}

.page-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 44px;
}

.brand-bar {
    margin-bottom: 20px;
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: inherit;
    padding: 12px 16px;
    border: 1px solid rgba(109, 74, 128, 0.14);
    border-radius: 22px;
    background: rgba(255, 251, 246, 0.7);
    box-shadow: 0 12px 26px rgba(80, 51, 95, 0.06);
}

.brand-logo {
    width: 176px;
    height: auto;
    display: block;
    filter: drop-shadow(0 6px 12px rgba(80, 51, 95, 0.08));
}

.hero {
    display: grid;
    grid-template-columns: 1.15fr 0.95fr;
    gap: 24px;
    align-items: stretch;
    margin-bottom: 24px;
}

.hero-copy,
.hero-card,
.panel {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: linear-gradient(180deg, rgba(255, 251, 245, 0.88), rgba(248, 241, 231, 0.92));
    box-shadow: var(--shadow);
    animation: fadeUp 420ms ease both;
}

.hero-copy {
    padding: 42px 38px;
}

.hero-card {
    padding: 28px;
    background:
        linear-gradient(180deg, rgba(255, 248, 240, 0.9), rgba(248, 239, 225, 0.96)),
        radial-gradient(circle at top right, rgba(109, 74, 128, 0.12), transparent 36%);
}

.hero-copy::after,
.hero-card::after,
.panel::after {
    content: "";
    position: absolute;
    inset: auto -30px -32px auto;
    width: 120px;
    height: 120px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(109, 74, 128, 0.16), transparent 70%);
}

.kicker,
.eyebrow {
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--violet);
}

.hero h1,
.panel h2 {
    margin: 0;
    font-family: var(--display-font);
    line-height: 1.03;
    letter-spacing: -0.03em;
}

.hero h1 {
    max-width: 15ch;
    font-size: clamp(2.4rem, 3vw, 4.25rem);
}

.hero-text,
.helper-text,
.notes-list,
.reading-card p,
.status-banner,
.date-line,
.summary-card,
.source-credit {
    line-height: 1.65;
}

.hero-text {
    margin: 18px 0 0;
    max-width: 58ch;
    font-size: 1.05rem;
    color: var(--muted);
}

.hero-ornament {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 18px;
    align-items: center;
    margin-top: 28px;
    padding: 18px 18px 16px;
    border: 1px solid rgba(109, 74, 128, 0.16);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(180deg, rgba(255, 250, 244, 0.9), rgba(250, 242, 231, 0.95)),
        radial-gradient(circle at top right, rgba(109, 74, 128, 0.16), transparent 42%);
}

.hero-ornament-copy {
    display: grid;
    gap: 8px;
}

.hero-ornament-copy p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.hero-ornament-label {
    display: inline-flex;
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--violet-soft);
    color: var(--violet-deep);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-illustration {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 180px;
    padding: 8px;
    border-radius: 18px;
    background: radial-gradient(circle, rgba(255, 251, 246, 0.95), rgba(240, 230, 244, 0.72));
    transition: transform 220ms ease, box-shadow 220ms ease, background 220ms ease;
}

.hero-illustration svg {
    width: 100%;
    max-width: 200px;
    height: auto;
    display: block;
}

.hero-illustration svg path {
    transition: stroke-dasharray 220ms ease, stroke-dashoffset 220ms ease, opacity 220ms ease;
}

.hero-ornament:hover .hero-illustration {
    transform: translateY(-2px);
    box-shadow: inset 0 0 0 1px rgba(109, 74, 128, 0.12), 0 14px 26px rgba(80, 51, 95, 0.08);
    background: radial-gradient(circle, rgba(255, 252, 248, 0.98), rgba(236, 225, 243, 0.82));
}

.hero-ornament:hover .hero-illustration svg path {
    stroke-dasharray: 12 8;
    animation: heroDash 4.8s linear infinite;
}

.controls {
    display: grid;
    gap: 16px;
}

.field {
    display: grid;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--violet-deep);
}

.field input,
.field select {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid rgba(95, 71, 41, 0.18);
    border-radius: var(--radius-sm);
    background: rgba(255, 252, 247, 0.9);
    color: var(--ink);
    font: inherit;
}

.field input:focus,
.field select:focus {
    outline: 2px solid rgba(109, 74, 128, 0.24);
    outline-offset: 2px;
}

.field-toggle {
    grid-template-columns: 1fr auto;
    align-items: center;
}

.field-toggle input {
    width: 24px;
    height: 24px;
    margin: 0;
    accent-color: var(--accent);
}

.actions-row,
.panel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.btn,
.link-button {
    appearance: none;
    border: none;
    border-radius: 999px;
    padding: 12px 18px;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.btn:hover,
.link-button:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--violet) 0%, var(--accent) 100%);
    color: #fffaf3;
    box-shadow: 0 10px 22px rgba(109, 74, 128, 0.2);
}

.btn-secondary {
    background: rgba(109, 74, 128, 0.12);
    color: var(--violet-deep);
}

.btn-ghost,
.link-button {
    background: transparent;
    color: var(--violet-deep);
    border: 1px solid rgba(109, 74, 128, 0.2);
}

.helper-text {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.hero-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.metric {
    padding: 14px;
    border-radius: var(--radius-md);
    background: rgba(255, 250, 242, 0.88);
    border: 1px solid var(--line);
}

.metric span {
    display: block;
    margin-bottom: 6px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.metric strong {
    font-family: var(--display-font);
    font-size: 1.18rem;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 24px;
}

.panel-featured,
.panel-readings,
.panel-notes {
    grid-column: 1 / -1;
}

.panel {
    padding: 28px;
}

.panel-featured {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 24px;
    align-items: start;
    background:
        linear-gradient(180deg, rgba(255, 248, 237, 0.94), rgba(249, 241, 231, 0.98)),
        radial-gradient(circle at bottom left, rgba(109, 74, 128, 0.12), transparent 40%);
}

.featured-main {
    min-width: 0;
}

.featured-side {
    display: grid;
    gap: 16px;
    align-content: start;
}

.panel-featured .panel-heading {
    margin-bottom: 0;
}

.panel-featured h2 {
    max-width: 14ch;
}

.panel-readings {
    background:
        linear-gradient(180deg, rgba(255, 251, 245, 0.9), rgba(248, 241, 231, 0.94)),
        radial-gradient(circle at top right, rgba(109, 74, 128, 0.09), transparent 34%);
}

.panel-notes {
    background:
        linear-gradient(180deg, rgba(253, 247, 239, 0.94), rgba(248, 239, 229, 0.98)),
        radial-gradient(circle at top left, rgba(84, 97, 71, 0.12), transparent 34%);
}

.panel-heading {
    margin-bottom: 18px;
}

.panel-heading.compact {
    margin-bottom: 16px;
}

.panel h2 {
    font-size: clamp(1.9rem, 2vw, 2.6rem);
}

.date-line {
    margin: 12px 0 0;
    color: var(--muted);
}

.summary-card {
    padding: 18px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: rgba(255, 251, 246, 0.82);
}

.summary-empty {
    margin: 0;
    color: var(--muted);
}

.summary-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.summary-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px dashed rgba(95, 71, 41, 0.16);
}

.summary-list li:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.summary-list span {
    font-weight: 700;
    color: var(--violet-deep);
}

.summary-list strong {
    color: var(--muted);
    text-align: right;
}

.source-credit {
    margin-top: 18px;
    font-size: 0.9rem;
    color: var(--muted);
}

.source-credit p {
    margin: 0;
}

.credit-intro {
    color: var(--muted);
}

.credit-details {
    margin-top: 12px;
    border-top: 1px dashed rgba(95, 71, 41, 0.18);
    padding-top: 12px;
}

.credit-details summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--violet-deep);
}

.credit-details p + p {
    margin-top: 10px;
}

.readings-list {
    display: grid;
    gap: 14px;
}

.reading-card {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 252, 248, 0.9);
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.reading-card:hover {
    transform: translateY(-2px);
    border-color: rgba(109, 74, 128, 0.28);
    box-shadow: 0 12px 28px rgba(80, 51, 95, 0.1);
}

.reading-card h3 {
    margin: 0;
    font-family: var(--display-font);
    font-size: 1.5rem;
}

.reading-card > * + * {
    margin-top: 14px;
}

.reading-card-toggle {
    display: none;
}

.reading-card-body {
    display: grid;
    gap: 14px;
}

.reading-card-body > * {
    margin-top: 0;
}

.reading-meta {
    display: inline-flex;
    margin: 0;
    padding: 6px 11px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--violet-soft), var(--accent-soft));
    color: var(--violet-deep);
    font-size: 0.88rem;
    font-weight: 700;
}

.reading-body {
    color: var(--ink);
}

.reading-body > :first-child {
    margin-top: 0;
}

.reading-body > :last-child {
    margin-bottom: 0;
}

.reading-body p,
.reading-body blockquote,
.reading-body ul,
.reading-body ol {
    margin: 0 0 0.95rem;
}

.reading-body h4,
.reading-body h5,
.reading-body h6 {
    margin: 0 0 0.7rem;
    font-size: 1rem;
    color: var(--violet-deep);
}

.source-copy {
    border: 1px dashed rgba(95, 71, 41, 0.18);
    border-radius: var(--radius-md);
    background: rgba(255, 250, 244, 0.82);
}

.source-copy summary {
    padding: 12px 14px;
    cursor: pointer;
    font-weight: 700;
    color: var(--violet-deep);
}

.source-copy .reading-body {
    padding: 0 14px 14px;
    color: var(--muted);
}

.scripture-shell {
    display: grid;
    gap: 10px;
}

.scripture-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.scripture-toolbar strong {
    color: var(--violet-deep);
}

.scripture-panel {
    border-radius: var(--radius-md);
    border: 1px solid rgba(95, 71, 41, 0.16);
    background: rgba(255, 251, 247, 0.92);
    padding: 16px;
}

.scripture-panel.is-loading {
    color: var(--muted);
    background: rgba(255, 248, 240, 0.88);
}

.scripture-panel.is-success {
    background: rgba(255, 252, 248, 0.96);
}

.scripture-panel.is-warning {
    color: var(--warn);
    background: rgba(153, 109, 17, 0.07);
    border-color: rgba(153, 109, 17, 0.22);
}

.scripture-label,
.scripture-meta,
.scripture-note,
.scripture-chapter {
    margin: 0;
}

.scripture-header {
    display: grid;
    gap: 4px;
    margin-bottom: 14px;
}

.scripture-label {
    font-weight: 700;
    color: var(--violet-deep);
}

.scripture-meta {
    color: var(--muted);
    font-size: 0.92rem;
}

.scripture-content {
    display: grid;
    gap: 10px;
}

.scripture-verse {
    margin: 0;
    line-height: 1.8;
}

.scripture-number {
    display: inline-block;
    min-width: 1.8em;
    margin-right: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--violet);
}

.scripture-chapter {
    margin-top: 4px;
    font-size: 0.92rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--olive);
}

.scripture-note {
    color: inherit;
}

.placeholder-card {
    opacity: 0.8;
}

.notes-list {
    margin: 0 0 18px;
    padding-left: 18px;
    color: var(--muted);
}

.status-banner {
    padding: 15px 16px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    background: rgba(134, 100, 56, 0.1);
}

.status-banner.is-info {
    color: var(--accent-deep);
    border-color: rgba(134, 100, 56, 0.16);
}

.status-banner.is-success {
    color: var(--ok);
    border-color: rgba(29, 111, 82, 0.2);
    background: rgba(29, 111, 82, 0.08);
}

.status-banner.is-warning {
    color: var(--warn);
    border-color: rgba(153, 109, 17, 0.22);
    background: rgba(153, 109, 17, 0.08);
}

.status-banner.is-error {
    color: var(--danger);
    border-color: rgba(159, 47, 39, 0.2);
    background: rgba(159, 47, 39, 0.08);
}

.site-footer {
    margin-top: 22px;
    padding: 18px 22px 6px;
    text-align: center;
    color: var(--muted);
    font-size: 0.95rem;
}

.site-footer p {
    margin: 0;
}

.site-footer a {
    color: var(--violet-deep);
    font-weight: 700;
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

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

@keyframes preloadFloat {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

@keyframes heroDash {
    to {
        stroke-dashoffset: -120;
    }
}

@media (max-width: 980px) {
    .hero,
    .content-grid {
        grid-template-columns: 1fr;
    }

    .panel-featured {
        grid-template-columns: 1fr;
    }

    .panel-featured h2 {
        max-width: none;
    }

    .hero h1 {
        max-width: none;
    }

    .hero-ornament {
        grid-template-columns: 1fr;
    }

    .hero-illustration {
        min-height: auto;
    }
}

@media (max-width: 720px) {
    .page-shell {
        width: min(100% - 20px, 1180px);
        padding-top: 18px;
    }

    .brand-lockup {
        width: 100%;
        justify-content: center;
        text-align: center;
        padding-right: 10px;
    }

    .brand-copy {
        justify-items: center;
    }

    .hero-copy,
    .hero-card,
    .panel {
        padding: 20px;
        border-radius: 22px;
    }

    .hero-metrics {
        grid-template-columns: 1fr;
    }

    .actions-row,
    .panel-actions,
    .scripture-toolbar {
        flex-direction: column;
    }

    .btn,
    .link-button {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .summary-list li {
        flex-direction: column;
        align-items: flex-start;
    }

    .summary-list strong {
        text-align: left;
    }

    .hero-ornament {
        padding: 16px;
    }

    .hero-illustration {
        padding: 4px;
    }

    .reading-card {
        padding: 0;
        overflow: hidden;
    }

    .reading-card-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        width: 100%;
        padding: 18px 18px 16px;
        border: none;
        background: transparent;
        color: inherit;
        text-align: left;
        cursor: pointer;
    }

    .reading-card-toggle-title {
        font-family: var(--display-font);
        font-size: 1.55rem;
        line-height: 1.05;
        color: var(--ink);
    }

    .reading-card-toggle-state {
        flex-shrink: 0;
        font-size: 0.85rem;
        font-weight: 700;
        color: var(--accent-deep);
    }

    .reading-card-toggle::after {
        content: "+";
        flex-shrink: 0;
        font-size: 1.2rem;
        font-weight: 700;
        color: var(--accent);
    }

    .reading-card-body {
        padding: 0 18px 18px;
    }

    .reading-card.is-collapsed .reading-card-body {
        display: none;
    }

    .reading-card:not(.is-collapsed) .reading-card-toggle::after {
        content: "-";
    }
}
