:root {
    --bg: #ffffff;
    --bg-panel: #ffffff;
    --accent: #000000;
    --accent-soft: #444444;
    --text: #000000;
    --text-dim: #555555;
    --danger: #000000;
    --border: rgba(0, 0, 0, 0.25);
    --radius: 10px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Georgia", "Iowan Old Style", serif;
    min-height: 100vh;
}

.page {
    max-width: 640px;
    margin: 0 auto;
    padding: 48px 20px 80px;
}

.hero {
    text-align: center;
    margin-bottom: 36px;
}

.site-logo {
    display: inline-block;
    margin: 0 0 8px;
}

.site-logo img {
    display: block;
    width: 220px;
    max-width: 100%;
    height: auto;
}

.site-logo:hover {
    opacity: 0.8;
}

.tagline {
    color: var(--text-dim);
    margin: 0;
}

.reading-form {
    background: var(--bg-panel);
    border-radius: var(--radius);
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    border: 1px solid var(--border);
}

.field label,
.field legend {
    display: block;
    font-weight: bold;
    margin-bottom: 6px;
    color: var(--accent);
}

.field input[type="text"],
.field input[type="email"],
.field textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
}

.hint {
    font-size: 0.82rem;
    color: var(--text-dim);
    margin: 6px 0 0;
}

.reading-type {
    border: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.reading-type-option {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 10px;
    align-items: baseline;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    cursor: pointer;
    font-weight: normal;
}

.reading-type-option:has(input:checked) {
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.05);
}

.option-title {
    font-weight: bold;
    grid-column: 2;
}

.option-desc {
    grid-column: 2;
    color: var(--text-dim);
    font-size: 0.88rem;
}

.pay-button {
    background: var(--accent);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 14px 20px;
    font-size: 1.05rem;
    font-weight: bold;
    cursor: pointer;
    font-family: inherit;
}

.pay-button:hover {
    filter: brightness(1.3);
}

.privacy-note {
    font-size: 0.78rem;
    color: var(--text-dim);
    line-height: 1.5;
    margin: 0;
}

/* About / FAQ (homepage) */

.about-section,
.faq-section {
    margin-top: 48px;
}

.about-section h2,
.faq-section h2 {
    font-size: 1.3rem;
    color: var(--accent);
    margin: 0 0 12px;
}

.about-section p {
    line-height: 1.6;
    color: var(--text);
    margin: 0;
}

.faq-item {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 10px;
}

.faq-item + .faq-item {
    margin-top: 10px;
}

.faq-item summary {
    font-weight: bold;
    cursor: pointer;
    list-style: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::before {
    content: "+ ";
    color: var(--accent);
    font-weight: bold;
}

.faq-item[open] summary::before {
    content: "\2212 "; /* minus sign */
}

.faq-item p {
    margin: 10px 0 0;
    line-height: 1.6;
    color: var(--text-dim);
}

/* Result page */

.result-page {
    text-align: center;
}

.result-footer {
    margin-top: 40px;
}

.result-footer a {
    color: var(--accent);
    text-decoration: underline;
}

.waiting {
    padding: 60px 0;
}

.spinner {
    width: 42px;
    height: 42px;
    margin: 0 auto 20px;
    border-radius: 50%;
    border: 3px solid rgba(0, 0, 0, 0.15);
    border-top-color: var(--accent);
    animation: spin 1s linear infinite;
}

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

.cards-row {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin: 20px 0 32px;
}

.card {
    width: 140px;
}

.card img {
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    cursor: zoom-in;
}

.lightbox[hidden] {
    display: none;
}

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    z-index: 1000;
    cursor: zoom-out;
}

.lightbox img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    cursor: default;
}

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 24px;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 2.4rem;
    line-height: 1;
    cursor: pointer;
    font-family: inherit;
}

.card-label {
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--text-dim);
}

.card-name {
    font-weight: bold;
    color: var(--accent);
}

.interpretation {
    text-align: left;
    background: var(--bg-panel);
    border-radius: var(--radius);
    padding: 28px;
    border: 1px solid var(--border);
    line-height: 1.6;
}

.interpretation h2 {
    color: var(--accent);
    font-size: 1.1rem;
    margin: 20px 0 8px;
}

.interpretation h2:first-child {
    margin-top: 0;
}

.error-state p {
    color: var(--danger);
    font-weight: bold;
}

.error-state a {
    color: var(--accent);
    text-decoration: underline;
}

.site-footer {
    text-align: center;
    padding: 24px 20px 40px;
    margin-top: -40px;
}

.site-footer p {
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-dim);
}

.site-footer p + p {
    margin-top: 4px;
}

.site-footer a,
.privacy-note a {
    color: var(--text-dim);
    text-decoration: underline;
}

/* Terms / refunds / privacy page */

.terms-page h1 {
    font-size: 1.6rem;
    margin: 0 0 4px;
    text-align: center;
}

.terms-updated {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.82rem;
    margin: 0 0 32px;
}

.terms-page section {
    margin-bottom: 28px;
}

.terms-page h2 {
    font-size: 1.15rem;
    margin: 0 0 8px;
}

.terms-page p,
.terms-page li {
    line-height: 1.65;
}

.terms-page ul {
    padding-left: 20px;
}

.terms-page a {
    color: var(--accent);
    text-decoration: underline;
}

/* Card meaning pages (cards.php, card.php) */

.cards-index h1,
.card-page h1 {
    font-size: 1.7rem;
    text-align: center;
    margin: 0 0 8px;
}

.cards-intro,
.card-summary {
    text-align: center;
    color: var(--text-dim);
    line-height: 1.6;
    margin: 0 0 28px;
}

.card-grid {
    list-style: none;
    margin: 0 0 40px;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 20px 14px;
}

.card-tile {
    display: block;
    text-align: center;
    text-decoration: none;
    color: var(--text);
}

.card-tile img {
    width: 100%;
    height: auto;
    aspect-ratio: 120 / 210;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.card-tile-name {
    display: block;
    margin-top: 8px;
    font-size: 0.88rem;
    font-weight: bold;
}

.card-tile:hover .card-tile-name {
    text-decoration: underline;
}

.card-crumb {
    margin: 0 0 12px;
    font-size: 0.88rem;
}

.card-crumb a,
.card-nav a {
    color: var(--text-dim);
}

.card-art {
    display: block;
    margin: 0 auto 24px;
    width: 280px;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--border);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.card-keywords {
    text-align: center;
    font-size: 0.92rem;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.card-keywords p {
    margin: 4px 0;
}

.card-text h2 {
    font-size: 1.15rem;
    margin: 28px 0 8px;
}

.card-text p {
    line-height: 1.7;
    margin: 0 0 8px;
}

.card-text .card-note {
    margin-top: 28px;
    font-size: 0.78rem;
    color: var(--text-dim);
}

.card-cta {
    text-align: center;
    margin: 36px 0 28px;
    padding: 24px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.card-cta p {
    margin: 0 0 14px;
}

.card-cta-button {
    display: inline-block;
    text-decoration: none;
}

.card-nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-size: 0.9rem;
}

/* Breadcrumb with card picker */

.breadcrumb {
    margin: 0 0 24px;
    font-size: 0.88rem;
}

.breadcrumb ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    color: var(--text-dim);
}

.breadcrumb li + li::before {
    content: "\203A";
    margin-right: 6px;
    color: var(--text-dim);
}

.breadcrumb a {
    color: var(--text-dim);
}

.card-picker-form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.card-picker-form select {
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: bold;
    color: var(--text);
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 8px;
    max-width: 100%;
}

.card-picker-form button {
    font-family: inherit;
    font-size: 0.85rem;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #ffffff;
    cursor: pointer;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.card-glance {
    margin-top: 36px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

/* Main navigation (under the logo) */

.site-nav {
    max-width: 560px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 28px;
    margin: 6px auto 18px;
}

.site-nav a {
    font-size: 1.05rem;
    font-weight: bold;
    color: var(--text);
    text-decoration: none;
    padding: 6px 2px;
    border-bottom: 2px solid transparent;
}

.site-nav a:hover {
    border-bottom-color: var(--text-dim);
}

.site-nav a[aria-current="page"] {
    border-bottom-color: var(--text);
}

/* Today's FREE Reading (daily.php) */

.daily-page h1 {
    font-size: 1.7rem;
    text-align: center;
    margin: 0 0 4px;
}

.daily-date {
    text-align: center;
    color: var(--text-dim);
    margin: 0 0 24px;
}

.daily-card-name {
    text-align: center;
    font-size: 1.15rem;
    font-weight: bold;
    margin: 0 0 24px;
}

.daily-reading h2:first-child {
    margin-top: 0;
}

.daily-reset {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-dim);
    margin: 20px 0 8px;
}

.daily-more {
    text-align: center;
    margin: 0 0 8px;
}

.daily-more a {
    color: var(--accent);
}
