/* ========================================
   Praise Swaps — warm Scandinavian editorial
   ======================================== */

:root {
  /* Paper & ink */
  --cream: #F7F1E8;
  --cream-warm: #F2E9DA;
  --cream-deep: #E8DCC6;
  --ink: #2D2520;
  --ink-soft: #5A4A3F;
  --ink-faded: #8A7868;

  /* Mark, sage / forest */
  --mark-primary: #5C7C5A;
  --mark-deep: #3F5A3D;
  --mark-tint: #E3EBDF;
  --mark-accent: #C8964A;

  /* Evie, warm orange */
  --evie-primary: #D8743C;
  --evie-deep: #A8552B;
  --evie-tint: #FBE4CF;
  --evie-accent: #C8964A;

  /* Active child theme (swapped via JS) */
  --c-primary: var(--mark-primary);
  --c-deep: var(--mark-deep);
  --c-tint: var(--mark-tint);
  --c-accent: var(--mark-accent);

  /* Surfaces */
  --card: #FDFAF3;
  --card-edge: #E5D9C2;
  --shadow-warm: 0 1px 0 rgba(160, 130, 90, 0.08), 0 12px 28px -8px rgba(80, 50, 20, 0.12), 0 2px 6px rgba(80, 50, 20, 0.04);

  /* Type */
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Manrope", -apple-system, system-ui, sans-serif;
  --font-hand: "Caveat", "Bradley Hand", cursive;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-active-child="evie"] {
  --c-primary: var(--evie-primary);
  --c-deep: var(--evie-deep);
  --c-tint: var(--evie-tint);
  --c-accent: var(--evie-accent);
}

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

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

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.5;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* Paper grain texture overlay */
.paper-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.4;
  z-index: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(180, 140, 90, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(150, 120, 80, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(200, 150, 74, 0.04) 0%, transparent 50%);
}

/* ============ HEADER (tabs only) ============ */

.app-header {
  position: relative;
  z-index: 2;
  padding: 14px 16px 0;
  max-width: 720px;
  margin: 0 auto;
}

.tabs {
  display: flex;
  gap: 8px;
}

.tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 12px;
  border: 1.5px solid var(--cream-deep);
  background: transparent;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  color: var(--ink-soft);
  transition: all 0.3s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}

.tab:hover { border-color: var(--ink-faded); }

.tab-monogram {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--cream-warm);
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 15px;
  font-variation-settings: "SOFT" 50;
  line-height: 1;
  flex-shrink: 0;
  transition: all 0.3s var(--ease-out);
}

.tab-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 16px;
  color: var(--ink);
  line-height: 1;
}

.tab.active {
  background: var(--card);
  box-shadow: var(--shadow-warm);
}

.tab--mark.active { border-color: var(--mark-primary); }
.tab--mark.active .tab-monogram { background: var(--mark-tint); color: var(--mark-deep); }

.tab--evie.active { border-color: var(--evie-primary); }
.tab--evie.active .tab-monogram { background: var(--evie-tint); color: var(--evie-deep); }

.tab-shuffle {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: 1.5px solid var(--cream-deep);
  background: transparent;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  transition: all 0.25s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}

.tab-shuffle:hover {
  border-color: var(--c-primary);
  color: var(--c-primary);
}

.tab-shuffle:active { transform: scale(0.94); }

.tab-lang {
  height: 44px;
  padding: 0 12px;
  flex-shrink: 0;
  border: 1.5px solid var(--cream-deep);
  background: transparent;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.06em;
  font-variation-settings: "SOFT" 50;
  transition: all 0.25s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  text-transform: uppercase;
}

.tab-lang:hover {
  border-color: var(--c-primary);
  color: var(--c-primary);
}

.tab-lang:active { transform: scale(0.94); }

.tab-lang .lang-text { line-height: 1; }

/* ============ DECK ============ */

.deck {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 16px auto 0;
  padding: 0 16px 24px;
}

/* counter styles kept harmlessly in case of revert; the element is now removed from HTML */
.counter {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 12px;
  color: var(--ink-faded);
  letter-spacing: 0.02em;
  text-align: center;
  margin-bottom: 10px;
  display: none;
}

.counter-divider { margin: 0 6px; opacity: 0.5; }

/* ============ SLIDE CARD ============ */

.slide-stage {
  position: relative;
  perspective: 1200px;
}

.slide {
  background: var(--card);
  border: 1px solid var(--card-edge);
  border-radius: 18px;
  padding: 22px 22px 24px;
  box-shadow: var(--shadow-warm);
  position: relative;
  overflow: hidden;
  animation: slideIn 0.5s var(--ease-out);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.slide.leaving {
  animation: slideOut 0.25s var(--ease-out) forwards;
}

@keyframes slideOut {
  to {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
}

/* Decorative corner number */
.slide-number {
  position: absolute;
  top: 14px;
  right: 18px;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 52px;
  font-style: italic;
  color: var(--c-tint);
  line-height: 1;
  font-variation-settings: "SOFT" 100;
  user-select: none;
  pointer-events: none;
}

.slide-original {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 26px;
  line-height: 1.2;
  color: var(--ink);
  letter-spacing: -0.015em;
  font-variation-settings: "SOFT" 50, "opsz" 36;
  position: relative;
  z-index: 1;
  padding-right: 60px;
  margin-bottom: 18px;
}

.slide-original .quote-mark {
  font-family: var(--font-display);
  color: var(--c-primary);
  font-weight: 400;
  opacity: 0.7;
}

.slide-section { margin-top: 18px; }
.slide-section:first-of-type { margin-top: 0; }

.slide-section-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-primary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.slide-section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--c-tint), transparent);
}

.slide-why {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.55;
}

.alternatives {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.alternatives li {
  background: var(--c-tint);
  padding: 11px 14px;
  border-radius: 11px;
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--c-deep);
  font-variation-settings: "SOFT" 50;
  line-height: 1.35;
  position: relative;
  padding-left: 32px;
}

.alternatives li::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-primary);
  transform: translateY(-50%);
  opacity: 0.6;
}

.slide-when {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.55;
  font-style: italic;
  padding: 12px 14px;
  background: var(--cream-warm);
  border-radius: 10px;
  border-left: 3px solid var(--c-accent);
}

.slide-when strong {
  font-style: normal;
  font-weight: 600;
  color: var(--ink);
}

/* ============ CONTROLS ============ */

.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
}

.ctrl {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--cream-deep);
  background: var(--card);
  color: var(--ink-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.25s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}

.ctrl:hover {
  border-color: var(--c-primary);
  color: var(--c-primary);
  transform: scale(1.05);
}

.ctrl:active { transform: scale(0.95); }

.ctrl:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.dots {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  flex: 1;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cream-deep);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}

.dot.active {
  background: var(--c-primary);
  width: 22px;
  border-radius: 4px;
}

/* ============ RESPONSIVE ============ */

@media (max-width: 380px) {
  .slide { padding: 18px 18px 20px; }
  .slide-original { font-size: 22px; padding-right: 48px; }
  .slide-number { font-size: 42px; top: 12px; right: 14px; }
  .alternatives li { font-size: 15px; }
  .tab-name { font-size: 15px; }
}

@media (min-width: 640px) {
  .slide { padding: 30px 30px 32px; }
  .slide-original { font-size: 32px; }
  .slide-number { font-size: 66px; }
  .alternatives li { font-size: 17px; }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
