/* ==========================================
   Serenity — Mental Wellness Hub
   ========================================== */

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

:root {
  --primary:   #7C6FE0;
  --primary-light: #A99CF5;
  --teal:      #4ECDC4;
  --teal-dark: #38B2AA;
  --coral:     #FF6B6B;
  --yellow:    #FFE66D;
  --bg:        #F3F1FF;
  --card-bg:   rgba(255,255,255,0.72);
  --text:      #2D3561;
  --text-muted:#6B7DB3;
  --border:    rgba(124,111,224,0.18);
  --shadow:    0 8px 32px rgba(124,111,224,0.14);
  --radius:    20px;
  --transition:0.35s cubic-bezier(.4,0,.2,1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #e8e4ff; }
::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 99px; }

/* ---------- Background blobs ---------- */
body::before, body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.28;
  pointer-events: none;
  z-index: 0;
}
body::before {
  width: 600px; height: 600px;
  top: -180px; left: -180px;
  background: radial-gradient(circle, #c4b5fd, #818cf8);
}
body::after {
  width: 500px; height: 500px;
  bottom: -150px; right: -150px;
  background: radial-gradient(circle, #99f6e4, #4ECDC4);
}

/* ---------- Nav ---------- */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: rgba(243,241,255,0.82);
  border-bottom: 1px solid var(--border);
  padding: 0 clamp(1rem,5vw,3rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.3px;
}
.nav-brand .logo { font-size: 1.5rem; }
.nav-links { display: flex; gap: 6px; }
.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  padding: 7px 14px;
  border-radius: 99px;
  font-size: 0.93rem;
  font-weight: 600;
  transition: var(--transition);
}
.nav-links a:hover, .nav-links a.active {
  color: var(--primary);
  background: rgba(124,111,224,0.1);
}
.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 4px; }
.hamburger span {
  display: block; width: 24px; height: 3px;
  background: var(--primary); border-radius: 3px; margin: 5px 0;
  transition: var(--transition);
}

/* ---------- Containers ---------- */
.container {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 5vw, 2.5rem);
}
section {
  padding: clamp(3rem,8vw,6rem) 0;
}

/* ---------- Hero ---------- */
#hero {
  min-height: calc(100vh - 68px);
  display: flex;
  align-items: center;
  padding: 2rem 0 4rem;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem,5vw,4rem);
  align-items: center;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(124,111,224,0.12);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 99px;
  margin-bottom: 1.2rem;
}
.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 900;
  line-height: 1.18;
  letter-spacing: -1px;
  margin-bottom: 1.2rem;
}
.hero-title .gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: 1.08rem;
  color: var(--text-muted);
  max-width: 460px;
  margin-bottom: 2.2rem;
}
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 99px;
  font-size: 0.97rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--teal-dark));
  color: #fff;
  box-shadow: 0 4px 18px rgba(124,111,224,0.38);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(124,111,224,0.45);
}
.btn-ghost {
  background: transparent;
  color: var(--primary);
  border-color: rgba(124,111,224,0.35);
}
.btn-ghost:hover {
  background: rgba(124,111,224,0.09);
  border-color: var(--primary);
  transform: translateY(-2px);
}
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}
.hero-orb {
  width: clamp(260px, 40vw, 380px);
  height: clamp(260px, 40vw, 380px);
  border-radius: 50%;
  background: conic-gradient(from 180deg, #c4b5fd, #818cf8, #4ECDC4, #99f6e4, #c4b5fd);
  animation: orb-spin 14s linear infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 80px rgba(124,111,224,0.3), 0 0 160px rgba(78,205,196,0.2);
  position: relative;
}
.hero-orb::after {
  content: '';
  position: absolute;
  inset: 16px;
  border-radius: 50%;
  background: var(--bg);
}
.hero-orb-inner {
  position: relative;
  z-index: 1;
  font-size: clamp(4rem, 8vw, 6rem);
  animation: orb-pulse 3s ease-in-out infinite;
}
@keyframes orb-spin  { to { transform: rotate(360deg); } }
@keyframes orb-pulse {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.08); }
}

/* ---------- Section Headings ---------- */
.section-header {
  text-align: center;
  margin-bottom: clamp(2rem,5vw,3.5rem);
}
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--teal-dark);
  background: rgba(78,205,196,0.12);
  padding: 5px 13px;
  border-radius: 99px;
  margin-bottom: 1rem;
}
.section-title {
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.25;
  margin-bottom: 0.7rem;
}
.section-sub {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto;
}

/* ---------- Cards ---------- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.5rem,4vw,2.5rem);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: var(--transition);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(124,111,224,0.2);
}

/* ---------- Affirmation ---------- */
#affirmation { background: transparent; }
.affirmation-card {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  background: linear-gradient(135deg, rgba(124,111,224,0.1), rgba(78,205,196,0.1));
  border: 1.5px solid rgba(124,111,224,0.22);
  border-radius: 28px;
  padding: clamp(2rem, 5vw, 4rem);
  box-shadow: var(--shadow);
}
.affirmation-icon { font-size: 3rem; margin-bottom: 1.2rem; }
.affirmation-text {
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
  min-height: 3.5em;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease;
  margin-bottom: 1.8rem;
}
.affirmation-text.fade { opacity: 0; }
.affirmation-controls { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-teal {
  background: linear-gradient(135deg, var(--teal), #38b2aa);
  color: #fff;
  box-shadow: 0 4px 18px rgba(78,205,196,0.4);
}
.btn-teal:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(78,205,196,0.45);
}
.affirmation-counter {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 1rem;
}

/* ---------- Breathing ---------- */
#breathing { background: transparent; }
.breathing-wrapper {
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
}
.breathing-circle-wrap {
  position: relative;
  width: 240px;
  height: 240px;
  margin: 0 auto 2rem;
}
.breathing-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(124,111,224,0.2);
}
.breathing-ring-progress {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--primary);
  border-right-color: var(--primary);
  transition: transform 0.5s linear;
}
.breathing-circle {
  position: absolute;
  inset: 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, rgba(196,181,253,0.7), rgba(124,111,224,0.6));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 40px rgba(124,111,224,0.25);
  transition: transform 0.4s ease;
}
.breathing-circle.expand { animation: breathe-expand 4s ease-in-out forwards; }
.breathing-circle.hold   { animation: breathe-hold 7s ease forwards; }
.breathing-circle.shrink { animation: breathe-shrink 8s ease-in-out forwards; }
@keyframes breathe-expand { 0% { transform: scale(0.8); opacity:0.7; } 100% { transform: scale(1.15); opacity:1; } }
@keyframes breathe-hold   { 0%,100% { transform: scale(1.15); opacity:1; } }
@keyframes breathe-shrink { 0% { transform: scale(1.15); opacity:1; } 100% { transform: scale(0.8); opacity:0.7; } }
.breathing-emoji { font-size: 2.4rem; }
.breathing-phase {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 5px;
}
.breathing-count {
  font-size: 2.4rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}
.breathing-label {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.8);
}
.breathing-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}
.breathing-cycles {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(124,111,224,0.08);
  border-radius: 99px;
  padding: 8px 18px;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 1.2rem;
}
.cycle-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(124,111,224,0.25);
  transition: var(--transition);
}
.cycle-dot.done { background: var(--primary); }
.cycle-dot.active { background: var(--teal); transform: scale(1.35); }

/* ---------- Mood ---------- */
#mood { background: transparent; }
.mood-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.mood-card { text-align: center; cursor: default; }
.mood-picker-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
}
.mood-emojis {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}
.mood-btn {
  background: rgba(124,111,224,0.07);
  border: 2px solid transparent;
  border-radius: 18px;
  padding: 12px;
  font-size: 2rem;
  cursor: pointer;
  transition: var(--transition);
  line-height: 1;
  width: 64px; height: 64px;
  display: flex; align-items: center; justify-content: center;
}
.mood-btn:hover {
  background: rgba(124,111,224,0.15);
  transform: scale(1.15) translateY(-2px);
}
.mood-btn.selected {
  border-color: var(--primary);
  background: rgba(124,111,224,0.18);
  transform: scale(1.2);
  box-shadow: 0 0 0 4px rgba(124,111,224,0.15);
}
.mood-response {
  font-size: 0.95rem;
  color: var(--text-muted);
  min-height: 2.8em;
  font-style: italic;
  transition: opacity 0.3s ease;
}
.mood-history-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.9px;
  margin-bottom: 1rem;
}
.mood-history {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.mood-chip {
  background: rgba(124,111,224,0.09);
  border-radius: 99px;
  padding: 5px 12px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition);
}

/* ---------- Gratitude Journal ---------- */
#journal { background: transparent; }
.journal-inner {
  max-width: 740px;
  margin: 0 auto;
}
.journal-prompts {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}
.prompt-chip {
  background: rgba(78,205,196,0.1);
  border: 1.5px solid rgba(78,205,196,0.25);
  color: var(--teal-dark);
  border-radius: 99px;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.prompt-chip:hover {
  background: rgba(78,205,196,0.2);
  transform: translateY(-1px);
}
.journal-textarea {
  width: 100%;
  min-height: 160px;
  border-radius: 16px;
  border: 2px solid var(--border);
  padding: 1.2rem 1.4rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: rgba(255,255,255,0.7);
  resize: vertical;
  transition: var(--transition);
  outline: none;
  line-height: 1.7;
}
.journal-textarea:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(124,111,224,0.12);
}
.journal-textarea::placeholder { color: var(--text-muted); }
.journal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.word-count { font-size: 0.84rem; color: var(--text-muted); }
.btn-coral {
  background: linear-gradient(135deg, #FF6B6B, #ee5a24);
  color: #fff;
  box-shadow: 0 4px 18px rgba(255,107,107,0.38);
}
.btn-coral:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(255,107,107,0.45);
}
.journal-entries {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.journal-entry {
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.2rem 1.4rem;
  position: relative;
  animation: fade-up 0.4s ease forwards;
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.entry-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.entry-date { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }
.entry-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  opacity: 0.5;
  transition: var(--transition);
  padding: 0 4px;
}
.entry-delete:hover { opacity: 1; color: var(--coral); }
.entry-text { font-size: 0.95rem; color: var(--text); line-height: 1.6; }
.journal-empty {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  padding: 1.5rem;
  font-size: 0.95rem;
}

/* ---------- Tips ---------- */
#tips .tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}
.tip-card {
  text-align: center;
  cursor: default;
}
.tip-icon {
  width: 64px; height: 64px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(124,111,224,0.15), rgba(78,205,196,0.15));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 1.1rem;
}
.tip-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
}
.tip-text { font-size: 0.9rem; color: var(--text-muted); }

/* ---------- Resources ---------- */
#resources { background: transparent; }
.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}
.resource-card {
  display: flex;
  flex-direction: column;
}
.resource-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0.9rem;
}
.resource-icon {
  width: 44px; height: 44px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.resource-icon.purple { background: rgba(124,111,224,0.15); }
.resource-icon.teal   { background: rgba(78,205,196,0.15); }
.resource-icon.coral  { background: rgba(255,107,107,0.15); }
.resource-icon.yellow { background: rgba(255,230,109,0.25); }
.resource-name {
  font-weight: 700;
  font-size: 1rem;
}
.resource-avail {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.resource-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
  flex: 1;
}
.resource-number {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(124,111,224,0.09);
  border-radius: 10px;
  padding: 9px 15px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
  margin-top: auto;
}
.resource-number:hover {
  background: rgba(124,111,224,0.18);
  transform: translateX(2px);
}

/* ---------- Footer ---------- */
footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: clamp(2rem, 4vw, 3.5rem) 0;
  background: rgba(243,241,255,0.6);
  backdrop-filter: blur(12px);
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 5vw, 2.5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
}
.footer-copy {
  font-size: 0.88rem;
  color: var(--text-muted);
}
.footer-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  max-width: 560px;
  background: rgba(255,107,107,0.07);
  border: 1px solid rgba(255,107,107,0.18);
  border-radius: 12px;
  padding: 10px 18px;
}

/* ---------- Toast ---------- */
#toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 999;
  transform: translateY(20px);
  opacity: 0;
  transition: var(--transition);
  pointer-events: none;
}
#toast.show {
  transform: translateY(0);
  opacity: 1;
}
.toast-inner {
  background: linear-gradient(135deg, var(--primary), var(--teal-dark));
  color: #fff;
  border-radius: 14px;
  padding: 12px 22px;
  font-size: 0.92rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 9px;
  box-shadow: 0 8px 32px rgba(124,111,224,0.35);
}

/* ---------- Animations on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-sub, .hero-ctas { margin-inline: auto; }
  .hero-ctas { justify-content: center; }
  .hero-visual { order: -1; }
  .nav-links { display: none; flex-direction: column; position: absolute; top: 68px; left: 0; right: 0; background: rgba(243,241,255,0.97); backdrop-filter:blur(18px); padding: 1rem 2rem; border-bottom: 1px solid var(--border); }
  .nav-links.open { display: flex; }
  .hamburger { display: block; }
}
@media (max-width: 520px) {
  .breathing-circle-wrap { width: 200px; height: 200px; }
  .mood-btn { width: 54px; height: 54px; font-size: 1.6rem; }
}
