/* home.css — hero, splash screen, rituals list */

/* ─── MOTIVATIONAL SPLASH ─── */
#motiveSplash {
  position: fixed; inset: 0; z-index: 99999;
  background: var(--bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 48px 32px;
  text-align: center;
  cursor: pointer;
  transition: opacity 0.7s ease;
}
#motiveSplash.fade-out { opacity: 0; pointer-events: none; }
#motiveSplash::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 60%, rgba(217,119,87,0.07) 0%, transparent 65%);
  pointer-events: none;
}
.motive-eyebrow {
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 40px;
  opacity: 0.7;
}
.motive-divider { width: 40px; height: 1px; background: var(--gold); opacity: 0.4; margin: 0 auto 40px; }
.motive-quote {
  font-family: var(--font-display);
  font-size: clamp(26px, 5vw, 46px);
  font-weight: 300;
  font-style: italic;
  line-height: 1.45;
  color: var(--text);
  max-width: 760px;
  margin-bottom: 36px;
  letter-spacing: 0.01em;
}
.motive-author {
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 60px;
}
.motive-tap {
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  text-transform: uppercase;
  opacity: 0.5;
  animation: motive-pulse 2.5s ease-in-out infinite;
}
@keyframes motive-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.65; }
}
#motiveSplash .motive-ornament {
  font-size: 22px;
  color: var(--gold);
  opacity: 0.5;
  margin-bottom: 36px;
  letter-spacing: 0.3em;
}

/* ─── HOME VIEW ─── */
#view-home { padding: 0; gap: 0; }

.section-title {
  font-size: 11px;
  font-family: var(--font-ui);
  letter-spacing: 0.2em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* SVG arc elements */
.arc-path { fill: none; stroke: rgba(217,119,87,0.12); stroke-width: 3; }
.arc-progress {
  fill: none;
  stroke: var(--gold);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 0 10px rgba(217,119,87,0.7));
}
.arc-pct { font-size: 34px; font-weight: 300; color: var(--gold2); line-height: 1; }

/* Home inner layout */
#view-home { overflow: hidden; }
.home-inner { display: flex; flex-direction: column; height: 100%; }

/* Hero */
.home-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 36px 32px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  position: relative;
  overflow: hidden;
  text-align: center;
}

.home-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--gold) 30%, var(--gold2) 50%, var(--gold) 70%, transparent 100%);
  opacity: 0.6;
}

.home-hero::after {
  content: '';
  position: absolute;
  left: 50%; bottom: -40px;
  transform: translateX(-50%);
  width: 400px; height: 200px;
  background: radial-gradient(ellipse, rgba(217,119,87,0.07) 0%, transparent 70%);
  pointer-events: none;
}

.home-hero { transition: background 4s ease; }
.home-hero.sky-dawn    { background: linear-gradient(175deg, #1c0a28 0%, #262624 60%); }
.home-hero.sky-morning { background: linear-gradient(175deg, #1e1008 0%, #262624 60%); }
.home-hero.sky-day     { background: linear-gradient(175deg, #071422 0%, #262624 60%); }
.home-hero.sky-dusk    { background: linear-gradient(175deg, #1e0818 0%, #262624 60%); }
.home-hero.sky-night   { background: var(--bg2); }

.hero-sky-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }

/* Legibility scrim: sits above the sky animations, below the text, so hero copy
   stays readable over clouds / sun / rain regardless of what's playing behind it. */
.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse 86% 82% at 50% 46%,
    rgba(var(--hero-scrim-rgb), 0.74) 0%,
    rgba(var(--hero-scrim-rgb), 0.5) 45%,
    rgba(var(--hero-scrim-rgb), 0) 80%);
}

.home-hero > *:not(.hero-sky-layer):not(.hero-scrim) { position: relative; z-index: 2; }

/* Hero copy is pure white on the dark scrim so it stays legible over any animation */
.home-hero { text-shadow: var(--hero-text-shadow); }
.home-hero .home-date-eyebrow,
.home-hero .home-date-main,
.home-hero .moon-phase-badge,
.home-hero #moonPhaseLabel,
.home-hero .weather-badge,
.home-hero .weather-temp,
.home-hero .weather-desc,
.home-hero .home-progress-msg,
.home-hero .home-progress-sub,
.home-hero .home-ring-label { color: #ffffff; }

.hero-star {
  position: absolute; border-radius: 50%; background: #fff; opacity: 0;
  animation: heroStarTwinkle var(--dur,3s) ease-in-out infinite var(--delay,0s);
}
@keyframes heroStarTwinkle {
  0%, 100% { opacity: 0.05; transform: scale(1); }
  50% { opacity: var(--peak,0.8); transform: scale(1.5); }
}
.hero-celestial { position: absolute; border-radius: 50%; transition: opacity 4s ease, box-shadow 4s ease, background 4s ease, width 4s ease, height 4s ease; }
.hero-celestial.sun {
  width: 72px; height: 72px;
  background: radial-gradient(circle, rgba(255,235,100,0.98) 0%, rgba(255,200,50,0.85) 30%, rgba(255,165,20,0.45) 55%, transparent 75%);
  box-shadow: 0 0 0 4px rgba(255,220,60,0.12), 0 0 18px rgba(255,210,50,0.6), 0 0 40px rgba(255,180,30,0.35), 0 0 80px rgba(255,150,15,0.18), 0 0 130px rgba(255,130,10,0.08);
  animation: heroCelestialPulse 5s ease-in-out infinite;
}
.hero-celestial.moon {
  width: 46px; height: 46px;
  background: rgba(218, 232, 252, 0.92);
  box-shadow: inset -12px 3px 0 0 #0c0f1e, 0 0 18px rgba(190,210,245,0.35), 0 0 45px rgba(170,195,240,0.15);
  animation: heroCelestialPulse 7s ease-in-out infinite;
}
@keyframes heroCelestialPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.82; transform: scale(1.05); }
}
.hero-horizon { position: absolute; bottom: 0; left: 0; right: 0; height: 55%; transition: background 4s ease; pointer-events: none; }
.hero-mote { position: absolute; border-radius: 50%; opacity: 0; animation: heroMoteFloat var(--dur,7s) ease-in-out infinite var(--delay,0s); }
@keyframes heroMoteFloat {
  0%  { transform: translateY(0) translateX(0); opacity: 0; }
  15% { opacity: var(--peak,0.4); }
  85% { opacity: var(--peak,0.4); }
  100%{ transform: translateY(-70px) translateX(var(--drift,0px)); opacity: 0; }
}
.hero-shoot { position: absolute; height: 1px; background: linear-gradient(90deg, transparent, rgba(220,210,180,0.7), transparent); border-radius: 1px; opacity: 0; animation: heroShoot var(--dur,18s) linear infinite var(--delay,0s); }
@keyframes heroShoot {
  0%   { opacity: 0; transform: rotate(-22deg) translateX(-20px); }
  1%   { opacity: 0.6; }
  6%   { opacity: 0; transform: rotate(-22deg) translateX(130px); }
  100% { opacity: 0; }
}

.home-date-eyebrow {
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.home-date-main {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 300;
  font-style: italic;
  color: var(--gold2);
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.moon-phase-badge {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  opacity: 0.75;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.moon-phase-icon { width: 14px; height: 14px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.mp-new  { background: #141620; box-shadow: 0 0 0 1.5px rgba(180,195,230,0.25); }
.mp-waxc { background: rgba(212,228,252,0.92); box-shadow: inset -9px 1px 0 -1px #0c0f1e, 0 0 5px rgba(190,210,250,0.2); }
.mp-fq   { background: linear-gradient(90deg, #0c0f1e 50%, rgba(212,228,252,0.92) 50%); box-shadow: 0 0 5px rgba(190,210,250,0.2); }
.mp-waxg { background: rgba(212,228,252,0.92); box-shadow: inset -4px 1px 0 -2px #0c0f1e, 0 0 5px rgba(190,210,250,0.2); }
.mp-full { background: rgba(222,234,255,0.96); box-shadow: 0 0 8px rgba(195,215,255,0.45); }
.mp-wang { background: rgba(212,228,252,0.92); box-shadow: inset 4px 1px 0 -2px #0c0f1e, 0 0 5px rgba(190,210,250,0.2); }
.mp-lq   { background: linear-gradient(90deg, rgba(212,228,252,0.92) 50%, #0c0f1e 50%); box-shadow: 0 0 5px rgba(190,210,250,0.2); }
.mp-wanc { background: rgba(212,228,252,0.92); box-shadow: inset 9px 1px 0 -1px #0c0f1e, 0 0 5px rgba(190,210,250,0.2); }

.home-ring-wrap {
  position: relative;
  width: 160px; height: 160px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 22px;
}

.home-ring-svg { position: absolute; inset: 0; width: 100%; height: 100%; }

.home-ring-center {
  position: absolute;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.home-ring-label {
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.home-progress-msg { font-family: var(--font-display); font-size: 26px; font-weight: 300; font-style: italic; color: var(--text); margin-bottom: 8px; position: relative; z-index: 1; }
.home-progress-sub { font-family: var(--font-ui); font-size: 11px; letter-spacing: 0.12em; color: var(--text-muted); position: relative; z-index: 1; }

/* Rituals section */
.home-rituals-section { padding: 28px 32px; flex: 1; overflow-y: auto; }
.today-rituals { display: flex; flex-direction: column; gap: 8px; }

.ritual-card.next-up {
  border-color: rgba(203,77,46,0.45);
  background: rgba(203,77,46,0.04);
  box-shadow: 0 0 0 1px rgba(203,77,46,0.1);
}
.ritual-card.next-up::before { background: var(--amber); opacity: 1; }
.ritual-card.next-up .rc-name::after {
  content: ' — up next';
  font-size: 11px;
  font-style: italic;
  color: var(--amber);
  opacity: 0.7;
}

.ritual-card {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  background: var(--bg2);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.ritual-card::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--amber);
  opacity: 0;
  transition: opacity 0.2s;
}

.ritual-card:hover { border-color: var(--border-bright); }
.ritual-card:hover::before { opacity: 0.6; }
.ritual-card.done { opacity: 0.55; }
.ritual-card.done::before { background: var(--gold); opacity: 1; }

/* Ritual card with a custom background image */
.ritual-card.has-bg-image {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-color: var(--border-bright);
}
.ritual-card.has-bg-image::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.55) 55%, rgba(0,0,0,0.35) 100%);
  z-index: 0;
  pointer-events: none;
}
.ritual-card.has-bg-image > * { position: relative; z-index: 1; }
.ritual-card.has-bg-image .rc-name { color: #fff; }
.ritual-card.has-bg-image .rc-meta { color: rgba(255,255,255,0.75); }

.rc-icon { font-size: 22px; }
.rc-info { flex: 1; }
.rc-name { font-size: 16px; font-weight: 400; margin-bottom: 2px; }
.rc-meta { font-size: 11px; font-family: var(--font-ui); color: var(--text-dim); }
.rc-check {
  width: 28px; height: 28px;
  border: 1px solid var(--border-bright);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--gold);
  transition: all 0.15s;
}
.ritual-card.done .rc-check { background: var(--gold); color: var(--bg); border-color: var(--gold); }

.rc-menu-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 18px;
  transition: all 0.2s;
  flex-shrink: 0;
  position: relative;
}
.rc-menu-btn:hover { color: var(--gold); }

/* ─── HERO BADGES ROW (moon + weather) ─── */
.home-hero-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}
.home-hero-badges .moon-phase-badge { margin-bottom: 0; }

.weather-badge {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.weather-icon { font-size: 15px; line-height: 1; }
.weather-temp { color: var(--text); font-weight: 600; }
.weather-desc { color: var(--text-muted); }

/* ─── HERO BOTTOM PROGRESS BAR ─── */
.home-hero-progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 6px;
  background: rgba(255,255,255,0.06);
  z-index: 3;
  overflow: hidden;
}
.home-hero-progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--gold), var(--gold2));
  box-shadow: 0 0 12px var(--glow);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── HERO WEATHER SKY (clouds + rain + snow) ─── */
.hero-cloud {
  position: absolute;
  color: #e9edf4;
  filter: blur(1px) drop-shadow(0 2px 3px rgba(15,20,40,0.12));
  opacity: 0;
  pointer-events: none;
  animation: heroCloudDrift var(--dur, 64s) linear infinite var(--delay, 0s);
}
.hero-cloud-svg { display: block; width: 100%; height: 100%; }
/* opaque union of puffs (no overlap banding); whole-cloud opacity via --peak */
.hero-cloud-svg .cloud-body { fill: currentColor; }
.hero-cloud-svg .cloud-shade { fill: #ffffff; opacity: 0.5; }
[data-theme="light"] .hero-cloud { color: #b7c2d1; }
[data-theme="light"] .hero-cloud-svg .cloud-shade { fill: #ffffff; opacity: 0.35; }
@keyframes heroCloudDrift {
  0%   { transform: translateX(-180px); opacity: 0; }
  12%  { opacity: var(--peak, 0.7); }
  88%  { opacity: var(--peak, 0.7); }
  100% { transform: translateX(calc(100vw + 180px)); opacity: 0; }
}

.hero-rain { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.hero-raindrop {
  position: absolute;
  top: -14%;
  width: 1.5px; height: 16px;
  background: linear-gradient(transparent, rgba(174,196,224,0.6));
  border-radius: 1px;
  animation: heroRainFall var(--dur, 0.9s) linear infinite var(--delay, 0s);
}
@keyframes heroRainFall {
  0%   { transform: translateY(-30px); opacity: 0; }
  10%  { opacity: 0.85; }
  100% { transform: translateY(340px); opacity: 0; }
}
.hero-snowflake {
  position: absolute;
  top: -14%;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: rgba(240,244,252,0.85);
  animation: heroSnowFall var(--dur, 4.5s) linear infinite var(--delay, 0s);
}
@keyframes heroSnowFall {
  0%   { transform: translate(0, -20px); opacity: 0; }
  10%  { opacity: 0.9; }
  100% { transform: translate(var(--drift, 12px), 340px); opacity: 0; }
}
