@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;600&family=Inter:wght@400;600&family=Noto+Serif+Devanagari:wght@400;600&family=Noto+Sans+Devanagari:wght@400;600&family=Noto+Naskh+Arabic:wght@400;700&family=Noto+Serif+JP:wght@400;600&family=Noto+Serif+SC:wght@400;600&display=swap');

:root {
  color-scheme: light;
  /* Force light mode in all browsers including Edge */
  --bg-paper: #f4ecd6;
  /* parchment base */
  --paper-edge: #efe1c6;
  /* slightly deeper parchment */
  --panel: #fffdf7;
  /* card surface */
  --ink: #122b18;
  /* deep forest ink */
  --muted: #556b57;
  --accent: #1b6b3a;
  /* emerald accent */
  --seal: #87602f;
  /* bronze/wax-ish accent */
  --sage-glow: rgba(63, 164, 106, 0.18);
  --shadow: 0 10px 30px rgba(17, 77, 47, 0.06);
  --radius: 12px;
  --maxw: 1150px;
  --dot-size: 14px;
  --content-gap: 20px;
  --serif: "Cormorant Garamond", "Noto Serif Devanagari", "Noto Naskh Arabic", "Noto Serif JP", "Noto Serif SC", "Noto Serif", Georgia, serif;
  --sans: "Inter", "Noto Sans Devanagari", "Noto Naskh Arabic", "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Base ---------- */
* {
  box-sizing: border-box
}

html,
body {
  height: 100%;
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg-paper), var(--paper-edge));
  -webkit-font-smoothing: antialiased
}

a {
  color: var(--accent);
  text-decoration: none
}

img {
  max-width: 100%;
  display: block
}

/* ---------- Layout container ---------- */
.site-wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px
}

.header-row,
.footer-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px
}

/* ---------- Header (sigil + title) ---------- */
.site-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(247, 238, 217, 0.85));
  border: 1px solid rgba(17, 77, 47, 0.06);
  box-shadow: var(--shadow);
}

.site-header .brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-logo {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(24, 78, 40, 0.08);
  background: linear-gradient(180deg, #fffaf3, #f7eed6);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1
}

.brand-sub {
  font-size: 0.92rem;
  color: var(--muted);
  margin-top: 4px;
  font-family: var(--sans);
  font-weight: 600
}

/* ---------- Navigation (compact) ---------- */
.site-nav {
  display: flex;
  gap: 18px;
  align-items: center
}

.site-nav a {
  font-weight: 700;
  color: var(--ink);
  padding: 8px 10px;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}

.site-nav a:hover {
  background: rgba(27, 107, 58, 0.08);
  color: var(--accent)
}

.site-nav a.active {
  color: var(--accent);
  background: rgba(27, 107, 58, 0.12);
}

.site-nav a.cta {
  background: var(--accent);
  color: #fff;
  padding: 8px 14px;
  box-shadow: 0 6px 14px rgba(27, 107, 58, 0.12)
}

/* ---------- Card / content ---------- */
.card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 18px;
  border: 1px solid rgba(17, 77, 47, 0.06);
  box-shadow: var(--shadow);
}

.container {
  padding: var(--content-gap);
}

/* ---------- Pages Specific: Select Reading ---------- */

.page-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 20px 60px 20px;
  width: 100%;
}

.welcome-title {
  font-family: var(--serif);
  font-size: 2.2rem;
  font-weight: 700;
  text-align: center;
  color: var(--accent);
  line-height: 1.2;
  margin-top: 10px;
}

/* User Status Bar */
.user-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  border: 1px solid rgba(17, 77, 47, 0.1);
  padding: 12px 20px;
  border-radius: 12px;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 10px;
  box-shadow: 0 4px 12px rgba(17, 77, 47, 0.04);
}

/* Advisory Card */
.advisory-card {
  position: relative;
  background: white;
  border: 1px solid rgba(27, 107, 58, 0.15);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 30px;
  box-shadow: 0 8px 20px rgba(27, 107, 58, 0.04);
  overflow: hidden;
}

.advisory-bg-icon {
  position: absolute;
  top: -10px;
  right: -10px;
  font-size: 5rem;
  opacity: 0.05;
  color: var(--accent);
  pointer-events: none;
}

.advisory-content {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.advisory-icon-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(27, 107, 58, 0.08);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.advisory-btn {
  background: white;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  margin-left: auto;
  align-self: center;
  transition: all 0.2s;
  white-space: nowrap;
}

.advisory-btn:hover {
  background: rgba(27, 107, 58, 0.05);
}

/* ---------- Typography ---------- */
h1,
h2,
h3 {
  color: var(--accent);
  font-family: var(--serif);
  margin: 0 0 10px 0
}

p {
  color: var(--ink);
  margin: 0 0 12px 0;
  line-height: 1.6
}

.lead {
  color: var(--muted);
  font-family: var(--sans);
  font-weight: 600
}

/* ---------- Buttons (occult seal-ish) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(27, 107, 58, 0.12)
}

.btn.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(17, 77, 47, 0.08);
  box-shadow: none
}

/* ---------- Glyph / dot system (geomancy specific) ---------- */
.glyph {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: center
}

.line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px
}

.dot {
  width: var(--dot-size);
  height: var(--dot-size);
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.08)
}

/* ---------- Small UI helpers ---------- */
.kv {
  display: flex;
  gap: 10px;
  align-items: center
}

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

/* ---------- Footer ---------- */
.site-footer {
  background: var(--footer-bg, #f4ecd6);
  /* Matching your theme-color */
  padding: 40px 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.footer-grid,
.footer-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  gap: 40px;
}

.footer-col {
  flex: 1;
  min-width: 200px;
  margin-bottom: 20px;
}

.footer-col h4 {
  font-family: var(--heading-font);
  margin-bottom: 15px;
  text-transform: uppercase;
  font-size: 0.95rem;
}

.footer-col a {
  display: block;
  margin-bottom: 8px;
  text-decoration: none;
  color: var(--text-color);
  font-size: 0.9rem;
}

.footer-col p {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--muted);
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(17, 77, 47, 0.8);
  /* Dark Green tint */
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
}

/* Modal Box */
.modal-content {
  background: #fff;
  padding: 30px;
  border-radius: 12px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--accent);
  position: relative;
  animation: floatUp 0.3s ease-out;
}

@keyframes floatUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header h2 {
  color: var(--accent);
  margin-bottom: 10px;
}

.close-modal {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--muted);
}

/* Token Offer Highlight */
.token-offer {
  background: #f4fdf7;
  border: 1px dashed var(--accent);
  padding: 15px;
  border-radius: 8px;
  margin: 20px 0;
  text-align: left;
}

.offer-tag {
  background: var(--accent);
  color: white;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: bold;
}

.offer-details {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  font-size: 0.9rem;
}

.btn-primary.full-width {
  display: block;
  width: 100%;
  background: var(--accent);
  color: white;
  padding: 12px;
  text-decoration: none;
  border-radius: 6px;
  font-weight: bold;
  margin-bottom: 10px;
}

.btn-primary.full-width:hover {
  background: var(--accent-dark);
}

.btn-text {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
}

/* ---------- Responsiveness ---------- */
@media(max-width:880px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start
  }

  .site-nav {
    flex-wrap: wrap
  }
}



/* --- Responsive Enhancements --- */
@media (max-width: 900px) {
  .site-header {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  .site-nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  .brand {
    flex-direction: column;
    align-items: center;
  }

  .brand-logo img {
    width: 80px;
  }
}

@media (max-width: 600px) {
  h1 {
    font-size: 1.7rem;
  }

  h2 {
    font-size: 1.3rem;
  }

  p,
  li {
    font-size: 1rem;
  }

  .card {
    padding: 15px;
    margin: 12px 0;
  }

  /* MOBILE CRITICAL FIX: Reduced padding for small screens */
  .site-wrap {
    padding: 20px 16px;
  }

  /* MOBILE CRITICAL FIX: Better brand title wrapping */
  .brand-title {
    font-size: 1.1rem;
    line-height: 1.3;
  }

  .brand-sub {
    font-size: 0.85rem;
  }
}

/* MOBILE CRITICAL FIX: Enhanced navigation touch targets for mobile */
@media (max-width: 768px) {
  .site-nav a {
    padding: 12px 16px;
    /* Increased from 8px 10px to meet 44px minimum touch target */
    font-size: 0.95rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .site-nav a.cta {
    padding: 12px 18px;
  }
}

/* MOBILE CRITICAL FIX: Extra small devices */
@media (max-width: 375px) {
  .brand-title {
    font-size: 1rem;
  }

  .brand-sub {
    font-size: 0.85rem;
  }

  /* Ensure buttons don't wrap awkwardly */
  .btn {
    font-size: 0.9rem;
    padding: 10px 12px;
  }
}

/* MOBILE CRITICAL FIX: Responsive padding at multiple breakpoints */
@media (max-width: 480px) {
  .site-wrap {
    padding: 18px 14px;
  }

  .card {
    padding: 18px;
  }
}

/* MOBILE CRITICAL: Enforce minimum readable font sizes on all devices */
@media (max-width: 768px) {

  body,
  p,
  li,
  .card,
  .lead {
    font-size: 1rem !important;
    /* Enforce 16px minimum on mobile for readability */
  }

  .small-muted,
  .footer-col a,
  .footer-col p {
    font-size: 0.9rem !important;
    /* Boost small text to 14.4px minimum */
  }
}

/* Note: This theme enforces a consistent light mode design.
   Dark mode is not supported to maintain the parchment aesthetic. */

.tradition-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 40px;
}

.tradition-toggle-group {
  display: flex;
  background: rgba(17, 77, 47, 0.06);
  padding: 4px;
  border-radius: 14px;
  gap: 4px;
}

.tradition-btn {
  padding: 10px 24px;
  border-radius: 10px;
  border: none;
  font-weight: 700;
  font-family: var(--sans);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  background: transparent;
  color: var(--muted);
}

.tradition-btn.active-western {
  background: white;
  color: var(--accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.tradition-btn.active-ramal {
  background: #fff7ed;
  color: #d97706;
  /* Orange-600 */
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.15);
}

.tradition-btn.inactive {
  opacity: 0.85;
}

.tradition-btn:hover:not(.active-western):not(.active-ramal) {
  opacity: 1;
  background: rgba(255, 255, 255, 0.5);
}

/* Reading Grid */
.reading-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  width: 100%;
}

.reading-card {
  background: var(--panel);
  border: 1px solid rgba(17, 77, 47, 0.12);
  /* Slightly darker border */
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(17, 77, 47, 0.04);
  /* Subtle shadow for depth */
}

.reading-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(17, 77, 47, 0.08);
}

.reading-title {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.reading-desc {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 20px;
  flex: 1;
}

.reading-cost {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  background: rgba(17, 77, 47, 0.06);
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 16px;
}

/* MOBILE CRITICAL FIXES */
@media (max-width: 600px) {
  .site-header {
    flex-direction: column;
    text-align: center;
    padding: 15px;
    gap: 12px;
  }

  .site-header .brand {
    flex-direction: column;
    gap: 8px;
  }

  .site-nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  .site-nav a {
    font-size: 0.85rem;
    padding: 6px 8px;
  }

  .welcome-title {
    font-size: 1.5rem;
    padding: 0 10px;
  }

  .advisory-card {
    padding: 15px;
  }

  .advisory-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }

  .advisory-btn {
    margin: 10px 0 0 0;
    width: 100%;
    text-align: center;
  }

  .tradition-btn {
    padding: 10px 12px;
    font-size: 0.82rem;
    flex: 1;
    white-space: nowrap;
  }

  .reading-grid {
    grid-template-columns: 1fr;
    /* Stack cards on very small screens */
  }

  .user-status-bar {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
  }
}

.reading-action-btn {
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  border: none;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  opacity: 1;
}

.reading-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(100%);
}

/* tradition-btn states */
.tradition-btn {
  border: 1px solid rgba(17, 77, 47, 0.1);
  background: white;
  color: var(--muted);
  font-family: var(--sans);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.tradition-btn.active-western {
  background: #dcfce7;
  /* Green-100 */
  color: #166534;
  /* Green-800 */
  border-color: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.tradition-btn.active-ramal {
  background: #ffedd5;
  /* Orange-100 */
  color: #9a3412;
  /* Orange-800 */
  border-color: #f97316;
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}

.tradition-btn.inactive {
  opacity: 0.85;
  border-color: rgba(17, 77, 47, 0.1);
  background: rgba(255, 255, 255, 0.5);
}

/* --- RAMAL THEME VARIATIONS --- */
.reading-card.ramal-theme {
  border-color: rgba(234, 88, 12, 0.15);
  /* Orange-600 */
}

.reading-card.ramal-theme:hover {
  box-shadow: 0 12px 24px rgba(234, 88, 12, 0.12);
}

.reading-card.ramal-theme .reading-title {
  color: #9a3412;
  /* Orange-800 */
}

.reading-card.ramal-theme .reading-cost {
  background: #fff7ed;
  /* Orange-50 */
  color: #9a3412;
}

/* --- WESTERN THEME VARIATIONS --- */
.btn-daily-western {
  background: #bbf7d0;
  /* Green-200 */
  color: #14532d;
  /* Green-900 */
  border: 1px solid #22c55e;
}

.btn-daily-western:hover:not(:disabled) {
  background: #86efac;
  /* Green-300 */
}

.btn-premium-western {
  background: var(--accent);
  color: white;
}

.btn-premium-western:hover:not(:disabled) {
  opacity: 0.9;
}

.btn-daily-ramal {
  background: #fed7aa;
  /* Orange-200 */
  color: #7c2d12;
  /* Orange-900 */
  border: 1px solid #f97316;
}

.btn-daily-ramal:hover:not(:disabled) {
  background: #fdba74;
  /* Orange-300 */
}

.btn-premium-ramal {
  background: #ea580c;
  /* Orange-600 */
  color: white;
}

.btn-premium-ramal:hover:not(:disabled) {
  background: #c2410c;
  /* Orange-700 */
}

/* Consolidated into main mobile query above */

/* --- Authentic Ramal Symbol Rendering (Bindu + Rekhā) --- */
.ramal-bindu {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: middle;
}

.ramal-rekha {
  display: inline-block;
  width: 20px;
  height: 4px;
  border-radius: 2px;
  background: currentColor;
  vertical-align: middle;
}