/* ============================================================
   ESENSIA · Design System · v2.1.0
   Programa 30 Días · Abraham-Hicks
   Immersive · Animated · Sanctuary

   Not a webpage. A space you enter.
   ============================================================ */

/* ========================
   0. RESET & TOKENS
   ======================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0 }

:root {
  --font-body: Georgia, "Times New Roman", serif;
  --font-ui: system-ui, -apple-system, "Segoe UI", sans-serif;

  --fs-xs:   0.7rem;
  --fs-sm:   0.85rem;
  --fs-base: 1rem;
  --fs-md:   1.15rem;
  --fs-lg:   1.5rem;
  --fs-xl:   2.2rem;
  --fs-hero: 3rem;

  --lh-body:    1.8;
  --lh-reading: 1.9;

  /* Sanctuary palette */
  --c-cream:     #f5f0e6;
  --c-parchment: #ebe5d8;
  --c-warm:      #e0d8c8;
  --c-text:      #2c2218;
  --c-soft:      #5c4f42;
  --c-muted:     #9c8e7e;
  --c-faint:     #f0ebe2;

  /* Theme accents */
  --c-salud:     #4a7c59;
  --c-riqueza:   #b8922d;
  --c-amor:      #a85c6e;

  --c-salud-soft:   rgba(74, 124, 89, 0.08);
  --c-riqueza-soft: rgba(184, 146, 45, 0.08);
  --c-amor-soft:    rgba(168, 92, 110, 0.08);

  /* Night */
  --c-night:       #1a1510;
  --c-night-soft:  #2a2318;
  --c-night-text:  #d4cbb8;
  --c-night-muted: #7a6e5e;

  /* Active theme */
  --c-theme: var(--c-salud);

  /* Particles */
  --particle-color: rgba(184, 146, 45, 0.15);

  /* Spacing */
  --sp-xs: 4px; --sp-sm: 8px; --sp-md: 16px;
  --sp-lg: 24px; --sp-xl: 40px; --sp-2xl: 64px;

  --r-sm: 6px; --r-md: 12px; --r-lg: 20px;
}

[data-theme="salud"]   { --c-theme: var(--c-salud);   --particle-color: rgba(74, 124, 89, 0.12); }
[data-theme="riqueza"] { --c-theme: var(--c-riqueza); --particle-color: rgba(184, 146, 45, 0.15); }
[data-theme="amor"]    { --c-theme: var(--c-amor);    --particle-color: rgba(168, 92, 110, 0.12); }


/* ========================
   1. ATMOSPHERE — The living background
   ======================== */

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  color: var(--c-text);
  background: var(--c-cream);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Floating particles — pure CSS */
.es-atmosphere {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.es-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--particle-color);
  border-radius: 50%;
  animation: es-float linear infinite;
}

.es-particle:nth-child(1)  { left: 8%;  width:5px;  height:5px;  animation-duration:22s; animation-delay:0s; }
.es-particle:nth-child(2)  { left: 18%; width:8px;  height:8px;  animation-duration:28s; animation-delay:-4s; }
.es-particle:nth-child(3)  { left: 30%; width:4px;  height:4px;  animation-duration:20s; animation-delay:-8s; }
.es-particle:nth-child(4)  { left: 42%; width:6px;  height:6px;  animation-duration:25s; animation-delay:-2s; }
.es-particle:nth-child(5)  { left: 55%; width:7px;  height:7px;  animation-duration:30s; animation-delay:-10s; }
.es-particle:nth-child(6)  { left: 65%; width:4px;  height:4px;  animation-duration:18s; animation-delay:-6s; }
.es-particle:nth-child(7)  { left: 75%; width:9px;  height:9px;  animation-duration:26s; animation-delay:-14s; }
.es-particle:nth-child(8)  { left: 85%; width:5px;  height:5px;  animation-duration:23s; animation-delay:-3s; }
.es-particle:nth-child(9)  { left: 12%; width:6px;  height:6px;  animation-duration:27s; animation-delay:-12s; }
.es-particle:nth-child(10) { left: 50%; width:4px;  height:4px;  animation-duration:21s; animation-delay:-7s; }
.es-particle:nth-child(11) { left: 92%; width:7px;  height:7px;  animation-duration:24s; animation-delay:-9s; }
.es-particle:nth-child(12) { left: 35%; width:5px;  height:5px;  animation-duration:29s; animation-delay:-16s; }

@keyframes es-float {
  0%   { transform: translateY(110vh) rotate(0deg);   opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(-10vh) rotate(360deg);  opacity: 0; }
}

/* Subtle gradient overlay at top */
.es-atmosphere::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 200px;
  background: linear-gradient(to bottom, var(--c-cream), transparent);
}


/* ========================
   2. PAGE & CONTENT WRAPPER
   ======================== */

.es-page {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: var(--sp-xl) var(--sp-lg) 100px;
  min-height: 100vh;
}


/* ========================
   3. HEADER — Entering the space
   ======================== */

.es-header {
  padding: var(--sp-2xl) 0;
  text-align: center;
}

.es-header__eyebrow {
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--c-theme);
  margin-bottom: var(--sp-md);
  opacity: 0;
  animation: es-fadeIn 1.2s ease 0.2s forwards;
}

.es-header__title {
  font-size: var(--fs-xl);
  font-weight: 400;
  font-style: italic;
  color: var(--c-text);
  letter-spacing: 0.02em;
  opacity: 0;
  animation: es-fadeIn 1.2s ease 0.5s forwards;
}

.es-header__sub {
  font-size: var(--fs-sm);
  color: var(--c-muted);
  margin-top: var(--sp-md);
  opacity: 0;
  animation: es-fadeIn 1.2s ease 0.8s forwards;
}

/* Index page hero */
.es-header--hero .es-header__title {
  font-size: var(--fs-hero);
}

@keyframes es-fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ========================
   4. SECTIONS — Panels as environments
   ======================== */

.es-section {
  margin-bottom: var(--sp-2xl);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.es-section.es-visible {
  opacity: 1;
  transform: translateY(0);
}

.es-section__title {
  font-size: var(--fs-lg);
  font-weight: 400;
  font-style: italic;
  color: var(--c-text);
  padding-bottom: var(--sp-md);
  border-bottom: 1px solid var(--c-warm);
  margin-bottom: var(--sp-lg);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}

.es-section__title::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-theme);
  opacity: 0.5;
  flex-shrink: 0;
}

.es-section[open] > .es-section__title {
  border-bottom-color: var(--c-theme);
}

.es-section[open] > .es-section__title::before {
  opacity: 1;
}

.es-section__body {
  padding-top: var(--sp-md);
}

/* Night environment */
.es-section--night {
  background: var(--c-night);
  color: var(--c-night-text);
  border-radius: var(--r-lg);
  padding: var(--sp-xl) var(--sp-lg);
  margin-left: calc(-1 * var(--sp-lg));
  margin-right: calc(-1 * var(--sp-lg));
}

.es-section--night .es-section__title {
  color: var(--c-night-text);
  border-bottom-color: rgba(255,255,255,0.1);
}

.es-section--night[open] > .es-section__title {
  border-bottom-color: var(--c-theme);
}


/* ========================
   5. EXERCISE ITEMS
   ======================== */

.es-exercise {
  margin-bottom: var(--sp-xl);
  padding-bottom: var(--sp-xl);
  border-bottom: 1px solid var(--c-warm);
}

.es-exercise:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.es-exercise > summary {
  list-style: none;
  cursor: pointer;
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--c-text);
  padding: var(--sp-sm) 0;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}

.es-exercise > summary::-webkit-details-marker { display: none }

.es-exercise > summary::before {
  content: "›";
  font-size: 1.3em;
  color: var(--c-muted);
  transition: transform 0.2s;
  display: inline-block;
  width: 16px;
  text-align: center;
}

.es-exercise[open] > summary::before {
  transform: rotate(90deg);
  color: var(--c-theme);
}

.es-exercise__body {
  padding: var(--sp-lg) 0 0 var(--sp-lg);
  border-left: 1px solid var(--c-warm);
  margin-left: 7px;
}

/* Night overrides */
.es-section--night .es-exercise {
  border-bottom-color: rgba(255,255,255,0.06);
}

.es-section--night .es-exercise > summary {
  color: var(--c-night-text);
}

.es-section--night .es-exercise > summary::before {
  color: var(--c-night-muted);
}

.es-section--night .es-exercise[open] > summary::before {
  color: var(--c-theme);
}

.es-section--night .es-exercise__body {
  border-left-color: rgba(255,255,255,0.06);
}


/* ========================
   6. CONTENT TYPES
   ======================== */

/* Body text — generous spacing so each idea breathes */
.es-text {
  margin-bottom: var(--sp-md);
  line-height: var(--lh-body);
}
.es-text:last-child { margin-bottom: 0 }

/* Abraham's voice — the reading */
.es-reading {
  font-style: italic;
  color: var(--c-soft);
  line-height: var(--lh-reading);
  padding: var(--sp-lg) 0;
  margin: var(--sp-md) 0;
  border-top: 1px solid var(--c-warm);
  border-bottom: 1px solid var(--c-warm);
}

.es-reading p { margin-bottom: var(--sp-md); }
.es-reading p:last-child { margin-bottom: 0 }

.es-reading__source {
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  font-style: normal;
  color: var(--c-muted);
  margin-top: var(--sp-lg);
}

/* Night reading */
.es-section--night .es-reading {
  color: var(--c-night-muted);
  border-color: rgba(255,255,255,0.06);
}

.es-section--night .es-reading__source {
  color: var(--c-night-muted);
}

/* Why / explanation */
.es-why {
  color: var(--c-soft);
  padding: var(--sp-md) 0;
}

.es-why__label {
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-theme);
  margin-bottom: var(--sp-sm);
  font-style: normal;
}

/* Night why */
.es-section--night .es-why { color: var(--c-night-muted); }
.es-section--night .es-why__label { color: var(--c-theme); }

/* How-to instruction */
.es-how {
  background: var(--c-faint);
  border-radius: var(--r-md);
  padding: var(--sp-lg);
  margin: var(--sp-lg) 0;
  color: var(--c-soft);
}

/* Night how */
.es-section--night .es-how {
  background: var(--c-night-soft);
  color: var(--c-night-text);
}

/* Notebook prompt */
.es-notebook {
  background: var(--c-faint);
  border-left: 2px solid var(--c-muted);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: var(--sp-lg);
  margin: var(--sp-lg) 0;
}

.es-notebook__label {
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-muted);
  margin-bottom: var(--sp-md);
}

.es-notebook ul { padding-left: var(--sp-lg); }
.es-notebook li { margin-bottom: var(--sp-sm); color: var(--c-soft); }

/* Night notebook */
.es-section--night .es-notebook {
  background: var(--c-night-soft);
  border-left-color: var(--c-night-muted);
}
.es-section--night .es-notebook__label { color: var(--c-night-muted); }
.es-section--night .es-notebook li { color: var(--c-night-text); }

/* Completion marker */
.es-done {
  font-family: var(--font-ui);
  font-size: var(--fs-sm);
  color: var(--c-muted);
  margin-top: var(--sp-lg);
  padding-left: var(--sp-lg);
  position: relative;
}

.es-done::before {
  content: "○";
  position: absolute;
  left: 0;
  color: var(--c-theme);
}

/* Night done */
.es-section--night .es-done { color: var(--c-night-muted); }

/* Safety / reassurance */
.es-safe {
  font-style: italic;
  color: var(--c-muted);
  font-size: var(--fs-sm);
  padding: var(--sp-lg) 0;
}

.es-safe .es-text {
  margin-bottom: var(--sp-md);
}

/* Night safe */
.es-section--night .es-safe { color: var(--c-night-muted); }

/* Minimum sufficient */
.es-minimum {
  background: var(--c-salud-soft);
  border-left: 2px solid var(--c-theme);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: var(--sp-lg);
  margin: var(--sp-lg) 0;
  font-size: var(--fs-sm);
  color: var(--c-soft);
}

/* Gentle orientation text */
.es-gentle {
  color: var(--c-soft);
  padding: var(--sp-lg) 0;
}

/* Optional helper dropdown */
.es-helper {
  margin-top: var(--sp-md);
}

.es-helper > summary {
  list-style: none;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: var(--fs-sm);
  color: var(--c-muted);
  font-style: italic;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.es-helper > summary::-webkit-details-marker { display: none }
.es-helper > summary:hover { color: var(--c-soft); }

.es-helper__body {
  padding: var(--sp-md) 0 0 var(--sp-md);
  border-left: 1px solid var(--c-warm);
  margin-top: var(--sp-sm);
  margin-left: var(--sp-sm);
  font-size: var(--fs-sm);
  color: var(--c-soft);
}

/* Night helper */
.es-section--night .es-helper > summary { color: var(--c-night-muted); }
.es-section--night .es-helper__body {
  border-left-color: rgba(255,255,255,0.06);
  color: var(--c-night-muted);
}


/* ========================
   6b. PRACTICE BLOCKS — The core rhythm unit
   Each practice is a self-contained idea with its own
   title and spaced-out text lines. This is the "one idea
   per line" pattern — every line exists deliberately.
   ======================== */

.es-practice {
  margin-top: var(--sp-xl);
  margin-bottom: var(--sp-xl);
  padding-left: var(--sp-lg);
  border-left: 2px solid var(--c-warm);
}

.es-practice__title {
  font-weight: 700;
  font-size: var(--fs-base);
  color: var(--c-text);
  margin-bottom: var(--sp-md);
  line-height: 1.4;
}

.es-practice__text {
  color: var(--c-soft);
  line-height: var(--lh-body);
  margin-bottom: var(--sp-md);
}

.es-practice__text:last-child {
  margin-bottom: 0;
}

/* Night practice blocks */
.es-section--night .es-practice {
  border-left-color: rgba(255,255,255,0.1);
}

.es-section--night .es-practice__title {
  color: var(--c-night-text);
}

.es-section--night .es-practice__text {
  color: var(--c-night-muted);
}

/* Practice inside chapters (intro page) — slightly tighter */
.es-chapter .es-practice {
  margin-top: var(--sp-lg);
  margin-bottom: var(--sp-lg);
}


/* ========================
   7. PILLS
   ======================== */

.es-pill {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 500;
  color: var(--c-muted);
  margin-left: auto;
}


/* ========================
   8. DIVIDER
   ======================== */

.es-divider {
  height: 1px;
  background: var(--c-warm);
  border: none;
  margin: var(--sp-xl) 0;
}

.es-section--night .es-divider {
  background: rgba(255,255,255,0.06);
}


/* ========================
   9. NAVIGATION
   ======================== */

.es-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(245, 240, 230, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--c-warm);
  padding: var(--sp-sm) var(--sp-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
}

.es-nav__link {
  font-family: var(--font-ui);
  text-decoration: none;
  color: var(--c-muted);
  font-size: var(--fs-sm);
  padding: var(--sp-sm) var(--sp-md);
}

.es-nav__link:active { color: var(--c-text); }
.es-nav__link--disabled { opacity: 0.2; pointer-events: none; }

.es-nav__home {
  font-family: var(--font-ui);
  text-decoration: none;
  color: var(--c-theme);
  font-size: var(--fs-sm);
  font-weight: 600;
  padding: var(--sp-sm) var(--sp-md);
}


/* ========================
   10. INDEX — The garden path
   ======================== */

.es-garden {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--sp-md);
  margin: var(--sp-xl) 0;
  padding: var(--sp-lg) 0;
}

.es-stone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--c-parchment);
  transition: background 0.3s, transform 0.3s;
  position: relative;
}

.es-stone:hover, .es-stone:active {
  background: var(--c-faint);
  transform: scale(1.08);
}

.es-stone__num {
  font-family: var(--font-ui);
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--c-text);
  line-height: 1;
}

.es-stone__theme {
  font-family: var(--font-ui);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-muted);
  margin-top: 2px;
}

/* Theme dot on stones */
.es-stone::after {
  content: "";
  position: absolute;
  bottom: 15%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
}

.es-stone[data-theme="salud"]::after   { background: var(--c-salud); }
.es-stone[data-theme="riqueza"]::after { background: var(--c-riqueza); }
.es-stone[data-theme="amor"]::after    { background: var(--c-amor); }

/* Intro link */
.es-intro-link {
  display: block;
  text-decoration: none;
  text-align: center;
  color: var(--c-soft);
  font-size: var(--fs-sm);
  padding: var(--sp-lg);
  border: 1px dashed var(--c-warm);
  border-radius: var(--r-md);
  margin-bottom: var(--sp-xl);
  transition: border-color 0.3s;
}

.es-intro-link:hover { border-color: var(--c-theme); }

.es-intro-link strong {
  display: block;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-style: italic;
  color: var(--c-text);
  margin-bottom: var(--sp-xs);
}


/* ========================
   11. INTRO PAGE SECTIONS
   ======================== */

.es-chapter {
  margin-bottom: var(--sp-2xl);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.es-chapter.es-visible {
  opacity: 1;
  transform: translateY(0);
}

.es-chapter > summary {
  list-style: none;
  cursor: pointer;
  font-size: var(--fs-md);
  font-weight: 400;
  font-style: italic;
  color: var(--c-text);
  padding: var(--sp-md) 0;
  border-bottom: 1px solid var(--c-warm);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.es-chapter > summary::-webkit-details-marker { display: none }

.es-chapter__body {
  padding-top: var(--sp-lg);
}


/* ========================
   12. UTILITIES
   ======================== */

.es-muted  { color: var(--c-muted) }
.es-soft   { color: var(--c-soft) }
.es-center { text-align: center }
.es-mt-sm  { margin-top: var(--sp-sm) }
.es-mt-md  { margin-top: var(--sp-md) }
.es-mt-lg  { margin-top: var(--sp-lg) }
.es-mt-xl  { margin-top: var(--sp-xl) }


/* ========================
   13. RESPONSIVE
   ======================== */

@media (max-width: 480px) {
  :root { --fs-xl: 1.8rem; --fs-hero: 2.4rem; }
  .es-page { padding: var(--sp-lg) var(--sp-md) 100px; }
  .es-garden { grid-template-columns: repeat(5, 1fr); gap: var(--sp-sm); }
  .es-section--night {
    margin-left: calc(-1 * var(--sp-md));
    margin-right: calc(-1 * var(--sp-md));
    padding: var(--sp-lg) var(--sp-md);
  }
  .es-practice {
    padding-left: var(--sp-md);
  }
}

@media (min-width: 561px) {
  .es-page { padding: var(--sp-2xl) var(--sp-xl) 100px; }
}
