/* ============================================================
   SUTRA Theme System — horoscopes.su
   CSS Variable Contract + Layout + Components
   Two themes: dark (default) / light (almanac)
   ============================================================ */

/* ─── CSS Variable Contract ─────────────────────────────── */
:root {
  --text:      #F0E8D8;
  --text-d:    #A09888;
  --text-m:    #C0B8A8;
  --border:    rgba(106,158,145,.14);
  --border-s:  rgba(106,158,145,.08);
  --surface:   #12101a;
  --surface-2: #1a1722;
  --void:      #08060A;
  --brass:     #C9A96E;
  --ink:       #08060A;
  --accent:    #6A9E91;
  --accent-b:  #8DBCB0;
  --accent-glow: rgba(106,158,145,.25);
  --danger:    #C97070;
  --warn:      #C9A96E;
  --good:      #6A9E91;
  --card-radius: 2px;
  --transition: .25s ease;
}

html.light {
  --text:      #2C2820;
  --text-d:    #6E6458;
  --text-m:    #8A7E72;
  --border:    rgba(74,133,117,.18);
  --border-s:  rgba(74,133,117,.08);
  --surface:   #F5EFE3;
  --surface-2: #EDE7DB;
  --void:      #FBF8F1;
  --brass:     #B8935A;
  --ink:       #FBF8F1;
  --accent:    #4A8571;
  --accent-b:  #6A9E91;
  --accent-glow: rgba(74,133,117,.15);
}

/* ─── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--void);
  color: var(--text);
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  line-height: 1.65;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ─── Typography ────────────────────────────────────────── */
h1, h2, h3 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  line-height: 1.2;
}
html.light h1, html.light h2, html.light h3 { font-weight: 400; }

h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }

.font-label {
  font-family: 'Cinzel', serif;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.font-mono {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

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

/* ─── Layout ────────────────────────────────────────────── */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

section {
  padding: 80px 0;
  scroll-margin-top: 60px;
}

/* ─── Header ────────────────────────────────────────────── */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(8,6,10,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
html.light .header {
  background: rgba(251,248,241,.9);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

.header-logo {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.header-nav a {
  font-size: 13px;
  color: var(--text-d);
  transition: color var(--transition);
}
.header-nav a:hover { color: var(--text); }

.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle, .lang-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-d);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all var(--transition);
}
.theme-toggle:hover, .lang-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ─── Hero ──────────────────────────────────────────────── */
.hero {
  padding-top: 120px;
  padding-bottom: 60px;
  text-align: center;
  position: relative;
}

.hero h1 {
  margin-bottom: 16px;
}
.hero h1 .accent { color: var(--accent); }

.hero-subtitle {
  max-width: 640px;
  margin: 0 auto 32px;
  color: var(--text-d);
  font-size: 16px;
  line-height: 1.7;
}

.hero-label {
  display: inline-block;
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--border);
  padding: 4px 16px;
  border-radius: 2px;
  margin-bottom: 24px;
}

.proof-row {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.proof-item {
  text-align: center;
}
.proof-num {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  color: var(--accent);
  letter-spacing: 0.05em;
}
.proof-label {
  font-size: 11px;
  color: var(--text-d);
  margin-top: 2px;
}

/* ─── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border: none;
  border-radius: 2px;
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-b));
  color: #08060A;
}
.btn-accent:hover {
  box-shadow: 0 0 20px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-gold {
  background: linear-gradient(135deg, #C9A96E, #E8C98A);
  color: #08060A;
}
.btn-gold:hover {
  box-shadow: 0 0 20px rgba(201,169,110,.3);
}

/* ─── Cards ─────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition);
}
.card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  width: 0; height: 2px;
  background: var(--accent);
  transition: all .3s ease;
  transform: translateX(-50%);
}
.card:hover::after { width: 100%; }
.card:hover { border-color: var(--accent); }

.card-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  margin-bottom: 8px;
}

/* ─── Section Headers ───────────────────────────────────── */
.section-label {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.section-title {
  margin-bottom: 12px;
}

.section-desc {
  color: var(--text-d);
  max-width: 600px;
  font-size: 15px;
  line-height: 1.7;
}

/* ─── Widget Containers ─────────────────────────────────── */
.widget-container {
  margin-bottom: 16px;
}

/* ─── Content sections: semi-transparent bg for readability over starfield ── */
#horoscope, #cosmic, #natal, #western-transits, #western-solar,
#western-lunar, #western-progressions, #forecast, #purchase, #faq {
  background: rgba(8,6,10,.85);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
html.light #horoscope, html.light #cosmic, html.light #natal,
html.light #western-transits, html.light #western-solar,
html.light #western-lunar, html.light #western-progressions,
html.light #forecast, html.light #purchase, html.light #faq {
  background: rgba(251,248,241,.95);
}

/* ─── Horoscope Section ─────────────────────────────────── */
#horoscope { padding-top: 20px; padding-bottom: 40px; }

/* ─── Cosmic Dashboard ──────────────────────────────────── */
.cosmic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

/* ─── Natal Section ─────────────────────────────────────── */
.natal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 768px) {
  .natal-grid { grid-template-columns: 1fr; }
}

/* ─── Paywall Blur ──────────────────────────────────────── */
.paywall-blur {
  position: relative;
}
.paywall-blur .blurred {
  filter: blur(6px);
  pointer-events: none;
  user-select: none;
}
.paywall-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(transparent, var(--void) 70%);
  z-index: 5;
  text-align: center;
  padding: 40px;
}
.paywall-overlay h3 {
  margin-bottom: 12px;
}
.paywall-overlay p {
  color: var(--text-d);
  margin-bottom: 20px;
  max-width: 400px;
  font-size: 14px;
}

/* ─── FAQ ───────────────────────────────────────────────── */
.faq-list {
  max-width: 720px;
  margin: 32px auto 0;
}

.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}

.faq-q {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.faq-q::after {
  content: '+';
  font-size: 20px;
  color: var(--accent);
  flex-shrink: 0;
  transition: transform var(--transition);
}
.faq-item.open .faq-q::after {
  transform: rotate(45deg);
}

.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease;
  color: var(--text-d);
  font-size: 14px;
  line-height: 1.7;
}
.faq-item.open .faq-a {
  max-height: 300px;
  padding-top: 12px;
}

/* ─── Footer ────────────────────────────────────────────── */
#footer-container {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-d);
}

/* ─── Form Overrides ────────────────────────────────────── */
.sc-form input, .sc-form select {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  border-radius: 2px !important;
  padding: 10px 14px !important;
  font-family: 'Jost', sans-serif !important;
  font-size: 14px !important;
}
.sc-form input:focus, .sc-form select:focus {
  border-color: var(--accent) !important;
  outline: none !important;
}
.sc-form label {
  color: var(--text-d) !important;
  font-size: 12px !important;
  font-family: 'Cinzel', serif !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
}
.sc-form button[type="submit"] {
  background: linear-gradient(135deg, var(--accent), var(--accent-b)) !important;
  color: #08060A !important;
  font-family: 'Cinzel', serif !important;
  font-size: 12px !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  border: none !important;
  border-radius: 2px !important;
  padding: 12px 28px !important;
  cursor: pointer !important;
}

/* ─── Purchase Form ─────────────────────────────────────── */
.purchase-form {
  max-width: 480px;
  margin: 0 auto;
}

.purchase-form input[type="email"],
.purchase-form input[type="text"] {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 2px;
  font-family: 'Jost', sans-serif;
  font-size: 14px;
  margin-bottom: 12px;
}
.purchase-form input:focus {
  border-color: var(--accent);
  outline: none;
}

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--text-d);
}
.consent-row input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--accent);
}
.consent-row a {
  color: var(--accent);
  text-decoration: underline;
}

/* ─── Grain Overlay ─────────────────────────────────────── */
.grain-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px;
}
html.light .grain-overlay { opacity: 0.02; }

/* ─── Canvas Sky ────────────────────────────────────────── */
#sutra-sky {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  will-change: transform;
}
html.light #sutra-sky { opacity: 0; }
@media (max-width: 768px) {
  #sutra-sky { opacity: 0.6; } /* lighter on mobile for performance */
}
@media (prefers-reduced-motion: reduce) {
  #sutra-sky { display: none; }
  .grain-overlay { display: none; }
}

/* ─── Hero Animations (2-3 sec hook) ───────────────────── */
@keyframes hero-fade-up {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes hero-glow-pulse {
  0%, 100% { box-shadow: 0 0 20px var(--accent-glow), 0 0 60px rgba(106,158,145,.1); }
  50%      { box-shadow: 0 0 30px var(--accent-glow), 0 0 80px rgba(106,158,145,.2); }
}
@keyframes hero-label-shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}
@keyframes float-slow {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

.hero-label {
  animation: hero-fade-up .8s ease both;
  background: linear-gradient(90deg, var(--accent), var(--brass), var(--accent));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: hero-label-shimmer 3s linear infinite, hero-fade-up .8s ease both;
  border-color: var(--accent);
}

.hero h1 {
  animation: hero-fade-up .8s ease .15s both;
}

.hero-subtitle {
  animation: hero-fade-up .8s ease .3s both;
}

.hero .btn-accent {
  animation: hero-fade-up .8s ease .45s both, hero-glow-pulse 3s ease-in-out 1.5s infinite;
  position: relative;
}
.hero .btn-accent::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 2px;
  background: linear-gradient(135deg, var(--accent), var(--accent-b), var(--brass));
  z-index: -1;
  opacity: 0;
  transition: opacity .3s;
}
.hero .btn-accent:hover::before { opacity: 1; }

.hero .proof-row {
  animation: hero-fade-up .8s ease .6s both;
}

/* ─── Hero: Clickable zodiac signs ─────────────────────── */
.hero-signs {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 28px;
  flex-wrap: wrap;
  animation: hero-fade-up .8s ease .5s both;
}

.hero-sign-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 8px 8px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 2px;
  cursor: pointer;
  transition: all .25s ease;
  min-width: 64px;
  color: var(--text-d);
}
.hero-sign-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
  transform: translateY(-2px);
}
.hero-sign-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
  box-shadow: 0 0 16px var(--accent-glow);
}

.hero-sign-glyph {
  font-size: 22px;
  line-height: 1;
}

.hero-sign-name {
  font-family: 'Cinzel', serif;
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 768px) {
  .hero-signs { gap: 4px; }
  .hero-sign-btn { min-width: 44px; min-height: 44px; padding: 6px 4px 4px; }
  .hero-sign-name { font-size: 7px; }
  .hero-sign-glyph { font-size: 16px; }
  .header-nav { display: none; } /* hide nav on mobile, signs are the nav */
  .btn { padding: 14px 24px; font-size: 13px; } /* bigger touch target */
  .faq-q { min-height: 44px; }
  .theme-toggle, .lang-toggle { width: 44px; height: 44px; }
}

/* All content above sky */
.header, main, footer { position: relative; z-index: 1; }

/* ─── Scroll Reveal ─────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
  section { padding: 48px 0; }
  .hero { padding-top: 90px; }
  .header-nav { display: none; }
  .proof-row { gap: 20px; }
  .cosmic-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  h1 { font-size: 1.8rem; }
  .container { padding: 0 14px; }
}

/* ─── Print ─────────────────────────────────────────────── */
@media print {
  .header, .grain-overlay, #sky-canvas, .theme-toggle, .lang-toggle { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ─── Voice Snippet (GS 2.1) ───────────────────────────── */
.voice-snippet {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ─── Utility ───────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.text-accent { color: var(--accent); }
.text-muted { color: var(--text-d); }
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mt-32 { margin-top: 32px; }
.mb-16 { margin-bottom: 16px; }
.mb-32 { margin-bottom: 32px; }
