@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Source+Sans+3:wght@400;500;600;700&display=swap');

:root {
  --rw-paper: #f7f0df;
  --rw-paper-deep: #eee2c7;
  --rw-ink: #171611;
  --rw-muted: #5e5749;
  --rw-gold: #b88a22;
  --rw-gold-soft: #ead69a;
  --rw-yellow: #f2c84b;
  --rw-blue: #4e7696;
  --rw-green: #687a43;
  --rw-red: #a44736;
  --rw-line: #29271f;
  --rw-card: rgba(255, 252, 243, .82);
  --rw-shadow: 0 12px 30px rgba(55, 45, 24, .10);
  --rw-radius: 16px;
  --rw-serif: 'Libre Baskerville', Georgia, serif;
  --rw-sans: 'Source Sans 3', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--rw-paper); }
body {
  margin: 0;
  color: var(--rw-ink);
  background:
    radial-gradient(circle at 10% 5%, rgba(242,200,75,.11), transparent 28rem),
    radial-gradient(circle at 90% 12%, rgba(78,118,150,.08), transparent 26rem),
    linear-gradient(180deg, #fbf7ed 0%, var(--rw-paper) 100%);
  font-family: var(--rw-sans);
  font-size: 17px;
  line-height: 1.58;
  min-height: 100vh;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
}
img { max-width: 100%; height: auto; }
a { color: var(--rw-ink); text-underline-offset: 3px; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }

h1, h2, h3, h4, h5, h6, .title, .site-nav-brand, .card-label, .stat-value {
  font-family: var(--rw-serif);
  color: var(--rw-ink);
  letter-spacing: -.025em;
}
h1 { font-size: clamp(2.15rem, 5vw, 4.6rem); line-height: 1.05; }
h2 { font-size: clamp(1.75rem, 3.5vw, 3rem); line-height: 1.15; }
h3 { font-size: clamp(1.25rem, 2vw, 1.7rem); }
p { margin-top: 0; }

.container { width: 100%; max-width: none; margin: 0; padding: 0; }
.site-nav, .header, .main-content, main, footer { position: relative; z-index: 1; }

.site-nav,
body > header,
.header:not(.home-hero-shell) {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 14px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid rgba(41,39,31,.45);
  background: rgba(251,247,237,.92);
  backdrop-filter: blur(10px);
}
.site-nav::before,
body > header::before {
  content: '☀';
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--rw-line);
  border-radius: 50%;
  background: var(--rw-yellow);
  font-size: 25px;
}
.site-nav-brand {
  margin-right: auto;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .055em;
}
.site-nav-brand::after {
  content: 'Virtual Tarot Reader';
  display: block;
  margin-top: 1px;
  font: 600 .68rem/1 var(--rw-sans);
  letter-spacing: .22em;
  color: #765b1e;
}
.site-nav-links { display: flex; align-items: center; gap: clamp(18px, 3vw, 38px); }
.site-nav-links a { font-family: var(--rw-serif); text-decoration: none; text-transform: uppercase; font-size: .9rem; }
.site-nav-links a:hover { color: var(--rw-gold); }

.home-hero-shell {
  padding: clamp(50px, 8vw, 110px) clamp(20px, 6vw, 90px) clamp(30px, 5vw, 68px);
  border: 0;
  background: transparent;
}
.home-hero-grid { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: 1.12fr .88fr; gap: clamp(34px, 7vw, 90px); align-items: center; }
.hero-eyebrow, .form-kicker, .reading-context-kicker, .home-hero-insight-kicker {
  color: #7a5d19;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.hero-title { max-width: 900px; margin: 0 0 22px; }
.hero-subtitle { max-width: 720px; color: var(--rw-muted); font-size: clamp(1.05rem, 1.5vw, 1.25rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0; }
.hero-cta, .hero-secondary, .magical-cta-btn, .draw-btn, button[type='submit'], .btn-primary {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 24px;
  border: 1px solid var(--rw-line);
  border-radius: 8px;
  background: var(--rw-ink);
  color: #fffaf0;
  font-family: var(--rw-serif);
  font-weight: 700;
  text-decoration: none;
  box-shadow: 3px 3px 0 var(--rw-gold);
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease;
}
.hero-secondary, .btn-secondary { background: transparent; color: var(--rw-ink); box-shadow: none; }
.hero-cta:hover, .hero-secondary:hover, .magical-cta-btn:hover, .draw-btn:hover { transform: translate(-1px,-1px); box-shadow: 5px 5px 0 var(--rw-gold); }
.hero-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-top: 28px; }
.stat-card { padding: 14px 0; border-top: 1px solid var(--rw-line); }
.stat-value { display: block; font-size: 1rem; }
.stat-label { display: block; color: var(--rw-muted); font-size: .86rem; line-height: 1.4; }
.home-hero-art { min-height: 440px; position: relative; }
.home-hero-image-card { position: absolute; width: 42%; filter: drop-shadow(0 16px 22px rgba(38,31,16,.18)); }
.home-hero-image-card img { display: block; border: 1px solid var(--rw-line); }
.home-hero-image-card-main { width: 48%; left: 26%; top: 3%; z-index: 3; }
.home-hero-image-card-left { left: 2%; top: 18%; transform: rotate(-8deg); z-index: 1; }
.home-hero-image-card-right { right: 1%; top: 18%; transform: rotate(8deg); z-index: 1; }
.home-hero-insight-card { position: absolute; z-index: 4; left: 8%; right: 8%; bottom: 0; padding: 18px 20px; border: 1px solid var(--rw-line); background: rgba(251,247,237,.94); box-shadow: var(--rw-shadow); }
.home-hero-insight-card p { margin: 5px 0 0; color: var(--rw-muted); font-size: .9rem; }

.main-content { padding: 0 clamp(16px, 5vw, 72px) 80px; }
.question-led-form, .input-section {
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(30px, 5vw, 60px);
  border: 1px solid var(--rw-line);
  background: rgba(251,247,237,.78);
  box-shadow: var(--rw-shadow);
}
.form-intro { text-align: center; max-width: 760px; margin: 0 auto 28px; }
.form-intro h2 { margin: 8px 0 14px; }
.form-intro > p:last-child { color: var(--rw-muted); max-width: 650px; margin-inline: auto; }
.question-input-group-primary { display: grid; grid-template-columns: 44px 1fr; gap: 12px; padding: 18px; border: 1px solid var(--rw-line); border-radius: 14px; background: rgba(255,253,247,.85); }
.input-icon { color: var(--rw-gold); font-size: 1.55rem; }
.question-input-main { position: relative; }
textarea, input, select {
  width: 100%;
  border: 1px solid rgba(41,39,31,.55);
  border-radius: 8px;
  background: rgba(255,253,247,.82);
  color: var(--rw-ink);
  padding: 14px 15px;
  outline: none;
}
textarea:focus, input:focus, select:focus { border-color: var(--rw-gold); box-shadow: 0 0 0 3px rgba(184,138,34,.16); }
.question-input-main textarea { min-height: 112px; resize: vertical; border: 0; border-bottom: 1px solid var(--rw-line); border-radius: 0; padding: 28px 4px 12px; background: transparent; box-shadow: none; }
.floating-label { position: absolute; left: 4px; top: 2px; color: var(--rw-muted); font-size: .9rem; font-weight: 600; pointer-events: none; }
.question-helper-text { margin: 10px 70px 0 0; color: var(--rw-muted); font-size: .86rem; font-style: italic; }
.char-counter { position: absolute; right: 0; bottom: 0; color: var(--rw-muted); font-size: .78rem; }

.reading-mode-selection { margin: 28px 0 34px; }
.reading-mode-selection::before { content: 'How would you like your reading?'; display: block; margin-bottom: 12px; text-align: center; font-family: var(--rw-serif); font-size: .9rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.pill-toggle-container { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.pill-toggle-option { cursor: pointer; }
.pill-toggle-option input { position: absolute; opacity: 0; pointer-events: none; }
.pill-content { min-height: 70px; width: 100%; justify-content: flex-start; border: 1px solid rgba(41,39,31,.55); border-radius: 12px; background: rgba(255,253,247,.72); color: var(--rw-ink); box-shadow: none; font-family: var(--rw-serif); }
.pill-toggle-option.active .pill-content { background: #f7e8ba; border-color: #8a6617; box-shadow: inset 0 0 0 1px #8a6617; }
.pill-icon { color: var(--rw-gold); }

.spread-selection { margin-top: 8px; }
.spread-selection h3 { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 0 0 18px; text-align: center; font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; }
.spread-selection h3::before, .spread-selection h3::after { content: ''; width: 70px; height: 1px; background: var(--rw-gold); }
.spread-options { display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; }
.spread-card { min-height: 170px; padding: 20px; border: 1px solid rgba(41,39,31,.55); border-radius: 12px; background: rgba(255,253,247,.72); cursor: pointer; }
.spread-card.active { background: #f7e8ba; border-color: #8a6617; box-shadow: inset 0 0 0 1px #8a6617; }
.spread-card .card-icon { color: var(--rw-gold); font-size: 3rem; }
.spread-card .card-label { margin-top: 12px; font-size: 1.2rem; text-transform: uppercase; }
.optional-details { margin-top: 24px; border-top: 1px solid rgba(41,39,31,.3); padding-top: 18px; }
.optional-details summary { cursor: pointer; font-weight: 700; }
.personal-info-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.input-group { position: relative; }
.input-group .input-icon { position: absolute; left: 12px; top: 14px; z-index: 2; }
.input-group input { padding-left: 44px; }
.input-group .floating-label { left: 44px; top: -10px; padding: 0 4px; background: var(--rw-paper); }
.action-section { margin-top: 28px; text-align: center; }
.magical-cta-btn { width: min(100%, 460px); border-radius: 8px; }
.btn-glow { display: none; }
.btn-content { display: inline-flex; align-items: center; gap: 8px; }

.cards-section, .interpretation-section, .contextual-reading-panel, .structured-reading, .reading-section,
.content-section, .guide-section, .error-page, .contact-form, article, .card-page-content {
  max-width: 980px;
  margin: 28px auto;
  padding: clamp(22px, 4vw, 44px);
  border: 1px solid rgba(41,39,31,.55);
  background: var(--rw-card);
  box-shadow: var(--rw-shadow);
}
.cards-container, .cards-grid, .card-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(190px,1fr)); gap: 22px; }
.tarot-card, .card-item, .card-meaning-card { border: 1px solid var(--rw-line); background: #fffaf0; padding: 14px; }
.tarot-card img, .card-item img, .card-meaning-card img { display: block; width: 100%; border: 1px solid var(--rw-line); }
.reading-section h4, .interpretation-section h3 { border-bottom: 1px solid var(--rw-gold); padding-bottom: 10px; }
blockquote { margin: 18px 0; padding: 14px 18px; border-left: 4px solid var(--rw-gold); background: rgba(242,200,75,.10); font-family: var(--rw-serif); font-style: italic; }

main:not(.main-content) { max-width: 1120px; margin: 0 auto; padding: clamp(28px, 6vw, 72px) clamp(18px, 5vw, 64px); }
main:not(.main-content) > h1, main:not(.main-content) > h2, .page-title { text-align: center; }
nav:not(.site-nav) { font-family: var(--rw-serif); }
footer { padding: 30px 20px; border-top: 1px solid rgba(41,39,31,.45); text-align: center; color: var(--rw-muted); }

table { width: 100%; border-collapse: collapse; background: rgba(255,253,247,.6); }
th, td { padding: 12px; border: 1px solid rgba(41,39,31,.35); text-align: left; }
th { font-family: var(--rw-serif); background: #f4e7bd; }

@media (max-width: 900px) {
  body { font-size: 16px; }
  .site-nav { min-height: 68px; padding: 10px 18px; gap: 12px; }
  .site-nav::before { width: 38px; height: 38px; flex-basis: 38px; font-size: 20px; }
  .site-nav-brand { font-size: 1.3rem; }
  .site-nav-brand::after { font-size: .52rem; }
  .site-nav-links { gap: 12px; overflow-x: auto; white-space: nowrap; padding-bottom: 4px; }
  .site-nav-links a { font-size: .72rem; }
  .home-hero-grid { grid-template-columns: 1fr; }
  .home-hero-shell { padding-top: 42px; text-align: center; }
  .hero-subtitle { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .home-hero-art { min-height: 360px; max-width: 520px; width: 100%; margin: 0 auto; }
}

@media (max-width: 640px) {
  body { background: #f8f1df; }
  .site-nav-links { display: none; }
  .site-nav::after { content: '☰'; font-size: 1.65rem; }
  .home-hero-shell { padding: 32px 18px 24px; }
  .hero-eyebrow { font-size: .65rem; }
  .hero-title { font-size: 2.25rem; }
  .hero-subtitle { font-size: 1rem; }
  .hero-actions { display: grid; grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: 1fr; text-align: left; }
  .home-hero-art { min-height: 300px; }
  .home-hero-insight-card { left: 0; right: 0; padding: 14px; text-align: left; }
  .main-content { padding: 0 12px 46px; }
  .question-led-form, .input-section { padding: 24px 16px; border-left: 0; border-right: 0; box-shadow: none; }
  .form-intro h2 { font-size: 1.85rem; }
  .question-input-group-primary { grid-template-columns: 28px 1fr; padding: 13px; }
  .question-input-main textarea { min-height: 104px; }
  .question-helper-text { margin-right: 0; padding-bottom: 24px; }
  .pill-toggle-container, .spread-options, .personal-info-inputs { grid-template-columns: 1fr; }
  .pill-content { min-height: 60px; }
  .spread-card { min-height: 120px; display: grid; grid-template-columns: 60px 1fr; align-items: center; text-align: left; }
  .spread-card .card-label { margin-top: 0; }
  .cards-section, .interpretation-section, .contextual-reading-panel, .structured-reading, .reading-section, .content-section, .guide-section, .error-page, .contact-form, article, .card-page-content { margin: 16px 10px; padding: 20px 16px; box-shadow: none; }
  .cards-container, .cards-grid, .card-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
