/* Landing Page Custom Styles */

/* ==========================================================================
   Warm literary gradient text (retired: ROYGBV rainbow).
   Class names retained for template backwards-compatibility during rebrand.
   All variants use the warm palette: russet / terracotta / peach / teal accent.
   WCAG AA: each stop >=4.5:1 on white at large text sizes.
   ========================================================================== */

.landing-gradient-rainbow {
  /* Warm literary: russet → terracotta → peach */
  background: linear-gradient(135deg, #8F5A44 0%, #A85E33 50%, #E8A578 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: #8F5A44;
  -webkit-text-fill-color: transparent;
}

.landing-gradient-rainbow-bright {
  /* Warm with single teal punctuation for emphasis */
  background: linear-gradient(135deg, #8F5A44 0%, #A85E33 40%, #E8A578 80%, #3C6E71 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: #8F5A44;
  -webkit-text-fill-color: transparent;
}

.landing-gradient-rainbow-pastel {
  /* Softer warm tints, for less-dominant headlines */
  background: linear-gradient(135deg, #A85E33 0%, #C27749 50%, #E8A578 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: #A85E33;
  -webkit-text-fill-color: transparent;
}

.landing-gradient-rainbow-animated {
  background: linear-gradient(135deg, #8F5A44 0%, #A85E33 50%, #E8A578 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: #8F5A44;
  -webkit-text-fill-color: transparent;
  animation: landing-rainbow-shift 3s ease-in-out infinite;
}

@keyframes landing-rainbow-shift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* Other landing gradients - re-tinted to the warm literary palette */
.landing-gradient-sunny {
  /* Warm sunset: peach → terracotta */
  background: linear-gradient(135deg, #E8A578 0%, #A85E33 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: #A85E33;
  -webkit-text-fill-color: transparent;
}

.landing-gradient-ocean {
  /* Teal only - the single cool accent */
  background: linear-gradient(135deg, #3C6E71 0%, #1F4446 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: #3C6E71;
  -webkit-text-fill-color: transparent;
}

.landing-gradient-purple {
  /* Retired purple variant; now warm russet → terracotta for any lingering consumers. */
  background: linear-gradient(135deg, #8F5A44 0%, #A85E33 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: #8F5A44;
  -webkit-text-fill-color: transparent;
}

.landing-gradient-green {
  /* Warm bookish: success semantics retained but tinted toward the palette */
  background: linear-gradient(135deg, #3C6E71 0%, #8F5A44 100%);
}

/* Landing Page Animations */
@keyframes landing-bounce-slow {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-15px) rotate(5deg);
  }
}

@keyframes landing-wiggle {
  0%, 100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(3deg);
  }
  75% {
    transform: rotate(-3deg);
  }
}

.landing-animate-bounce-slow {
  animation: landing-bounce-slow 4s ease-in-out infinite;
}

.landing-animate-wiggle {
  animation: landing-wiggle 2s ease-in-out infinite;
}

/* Landing Page Shadows */
.landing-shadow-playful {
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.landing-shadow-fun {
  box-shadow: 0 20px 40px -10px rgba(255, 107, 107, 0.3);
}

/* Landing Page Layout */
.landing-section {
  padding: 3rem 0;
}

@media (min-width: 1024px) {
  .landing-section {
    padding: 5rem 0;
  }
}

.landing-section-large {
  padding: 4rem 0;
}

@media (min-width: 1024px) {
  .landing-section-large {
    padding: 6rem 0;
  }
}

.landing-section-hero {
  padding: 3rem 0;
}

@media (min-width: 1024px) {
  .landing-section-hero {
    padding: 5rem 0;
  }
}

@media (min-width: 1280px) {
  .landing-section-hero {
    padding: 8rem 0;
  }
}

.landing-heading {
  margin-bottom: 2rem;
}

@media (min-width: 1024px) {
  .landing-heading {
    margin-bottom: 3rem;
  }
}

.landing-heading p {
  margin-top: 1.25rem;
}

.landing-background-decor {
  pointer-events: none;
}

.landing-background-decor > * {
  pointer-events: none;
}

.landing-card-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 1024px) {
  .landing-card-grid {
    gap: 2.5rem;
  }
}

.landing-card-grid.stretch > * {
  height: 100%;
}

.landing-feature-card {
  border: 2px solid;
  border-radius: 1.5rem;
}

.landing-cta-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.2s;
}

.landing-cta-button:hover {
  transform: translateY(-2px);
}

.landing-section-divider {
  height: 1px;
  max-width: 64rem;
  margin: 3rem auto;
  background: linear-gradient(90deg, rgba(157, 96, 255, 0.05) 0%, rgba(157, 96, 255, 0.4) 50%, rgba(72, 134, 255, 0.05) 100%);
}

@media (min-width: 1024px) {
  .landing-section-divider {
    margin: 4rem auto;
  }
}

.landing-text-gradient {
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  filter: drop-shadow(0 2px 4px rgba(15, 23, 42, 0.15));
}

/* Playful Shapes */
.landing-blob-1 {
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
}

.landing-blob-2 {
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
}

.landing-blob-3 {
  border-radius: 40% 60% 60% 40% / 60% 40% 40% 60%;
}

/* Flexible Bubble Styles */
.landing-bubble-flexible {
  border-radius: 1.5rem;
  padding: 0.5rem 1rem;
  min-width: fit-content;
  max-width: 100%;
  word-wrap: break-word;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.landing-bubble-flexible-multiline {
  border-radius: 1.5rem;
  padding: 0.5rem 1rem;
  min-width: fit-content;
  max-width: 100%;
  word-wrap: break-word;
  white-space: normal;
  line-height: 1.375;
}

/* Background Patterns */
.landing-pattern-dots {
  background-image: radial-gradient(circle, #ffd93d 1px, transparent 1px);
  background-size: 20px 20px;
  opacity: 0.1;
}

.landing-pattern-stars {
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffd93d' fill-opacity='0.1'%3E%3Cpath d='m36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.05;
}

/* Font Families */
.landing-font-fredoka {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600; /* Softer than 700+ */
  letter-spacing: -0.02em; /* Slightly tighter for better readability */
}

.landing-font-nunito {
  font-family: 'Nunito Sans', sans-serif;
  font-weight: 400;
  line-height: 1.6;
}

/* Typography Hierarchy */
.landing-h1 {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

@media (min-width: 640px) {
  .landing-h1 {
    font-size: 3rem;
  }
}

@media (min-width: 1024px) {
  .landing-h1 {
    font-size: 3.5rem;
  }
}

@media (min-width: 1280px) {
  .landing-h1 {
    font-size: 4rem;
  }
}

.landing-h2 {
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

@media (min-width: 640px) {
  .landing-h2 {
    font-size: 2rem;
  }
}

@media (min-width: 1024px) {
  .landing-h2 {
    font-size: 2.25rem;
  }
}

.landing-h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
}

@media (min-width: 640px) {
  .landing-h3 {
    font-size: 1.5rem;
  }
}

.landing-body {
  font-size: 1.125rem; /* 18px minimum on mobile for accessibility */
  font-weight: 400;
  line-height: 1.6;
}

@media (min-width: 640px) {
  .landing-body {
    font-size: 1.25rem; /* 20px on larger screens */
  }
}

.landing-body-large {
  font-size: 1.25rem; /* 20px minimum on mobile */
  font-weight: 400;
  line-height: 1.6;
}

@media (min-width: 640px) {
  .landing-body-large {
    font-size: 1.375rem; /* 22px on larger screens */
  }
}

/* Hero Carousel Styles */
.hero-carousel-container {
  position: relative;
  overflow: hidden;
}

.hero-carousel-slide {
  display: none;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

.hero-carousel-slide.active {
  display: block;
  opacity: 1;
}

.hero-carousel-dot {
  cursor: pointer;
  transition: all 0.3s ease;
}

.hero-carousel-dot.active {
  background-color: #33552B !important;
  transform: scale(1.2);
}

.hero-carousel-dot:hover {
  transform: scale(1.1);
}

/* Carousel fade transition */
.hero-carousel-slide {
  animation: carousel-fade-in 0.5s ease-in-out;
}

@keyframes carousel-fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Button Formatting Fixes */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 0.75rem;
  transition: all 0.2s ease-in-out;
  white-space: nowrap;
  min-width: fit-content;
}

.btn-primary:hover {
  transform: translateY(-2px);
  text-decoration: none;
}

.btn-primary:focus {
  outline: 2px solid rgba(143, 90, 68, 0.5);
  outline-offset: 2px;
}

/* Ensure button text doesn't wrap awkwardly */
.btn-primary span {
  white-space: nowrap;
}

/* ==========================================================================
   Story preview (book-style rules in Landing book-style preview below)
   ========================================================================== */

/* ==========================================================================
   Sticky mobile CTA (visible after scroll)
   ========================================================================== */
.sticky-mobile-cta {
  transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}
.sticky-mobile-cta.hidden {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}
.sticky-cta-button {
  text-decoration: none;
}
.sticky-cta-button:focus-visible {
  outline: 2px solid white;
  outline-offset: 2px;
}
@media (min-width: 768px) {
  .sticky-mobile-cta {
    display: none !important;
  }
}

/* ==========================================================================
   Landing book-style preview (open book: spine + page, page-turn feel)
   ========================================================================== */
.landing-book-preview {
  position: relative;
}

/* Outer wrapper: open book with rounded left (spine side) */
.landing-book {
  display: flex;
  min-height: 320px;
  border-radius: 0 1rem 1rem 0;
}

.landing-book-outer-shadow {
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.07),
    0 10px 20px -5px rgba(0, 0, 0, 0.1),
    0 25px 50px -12px rgba(0, 0, 0, 0.15),
    4px 0 20px -4px rgba(0, 0, 0, 0.08);
}

/* Spine (binding): narrow strip on the left — forest ink (DS v2), not purple */
.landing-book-spine {
  width: 16px;
  min-width: 16px;
  background: linear-gradient(
    180deg,
    #3d6433 0%,
    #33552b 50%,
    #2a4624 100%
  );
  box-shadow: inset 2px 0 8px rgba(38, 48, 31, 0.25);
}

@media (min-width: 640px) {
  .landing-book-spine {
    width: 24px;
    min-width: 24px;
  }
}

/* Page area: white content with inner shadow (gutter) on the left */
.landing-book-page-area {
  position: relative;
  border-radius: 0 1rem 1rem 0;
  box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.06);
}

.landing-book-gutter {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  pointer-events: none;
  background: linear-gradient(
    to right,
    rgba(0, 0, 0, 0.04) 0%,
    transparent 100%
  );
  border-radius: 0 2px 2px 0;
}

/* One page visible at a time; soft transition */
.story-preview-slide {
  display: none;
  position: absolute;
  inset: 0;
  overflow-y: auto;
}

.story-preview-slide.active {
  display: block;
  position: relative;
  animation: landing-page-appear 0.35s ease-out;
}

@keyframes landing-page-appear {
  from {
    opacity: 0;
    transform: translateX(8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.landing-book-page-inner {
  min-height: 280px;
}

.landing-book-illustration {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Page turn controls: text-style, not pill buttons */
.landing-book-controls {
  max-width: 100%;
}

.landing-book-turn:focus-visible,
.story-preview-prev:focus-visible,
.story-preview-next:focus-visible {
  outline: 2px solid var(--storybook-primary, #33552B);
  outline-offset: 2px;
}

/* Dots: minimal visual, expanded hit area for WCAG 2.5.8 */
.story-preview-dot {
  position: relative;
  min-width: 8px;
  min-height: 8px;
  cursor: pointer;
}

.story-preview-dot::after {
  content: "";
  position: absolute;
  inset: -12px;
}

.story-preview-dot:focus-visible {
  outline: 2px solid var(--storybook-primary, #33552B);
  outline-offset: 2px;
}

/* Branch slides (after choice): hidden until user picks skybridge or canyon */
.landing-branch-slide.landing-branch-hidden {
  display: none !important;
}

/* ==========================================================================
   PAPER & INK HERO — Design System v2
   Forest primary, persimmon hero CTA, paper wash. No russet/teal literary drift.
   ========================================================================== */

.landing-hero-paper {
  background-color: #f8f4ea;
  background-image:
    radial-gradient(120% 90% at 92% -8%, rgba(226, 87, 43, 0.08) 0%, rgba(226, 87, 43, 0) 52%),
    radial-gradient(100% 80% at -4% 108%, rgba(51, 85, 43, 0.09) 0%, rgba(51, 85, 43, 0) 50%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}

.landing-brand-mark {
  font-family: 'Bitter', Georgia, serif;
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.25rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: #26301f;
}

.landing-eyebrow-script {
  font-family: 'Bitter', Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: 1.125rem;
  letter-spacing: 0.01em;
  color: #33552b;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.landing-eyebrow-script::before,
.landing-eyebrow-script::after {
  content: "";
  height: 1px;
  width: 1.75rem;
  background: linear-gradient(90deg, transparent, rgba(51, 85, 43, 0.45));
}
.landing-eyebrow-script::after {
  background: linear-gradient(90deg, rgba(51, 85, 43, 0.45), transparent);
}

.landing-display {
  font-family: 'Bitter', Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: #26301f;
}
.landing-display em {
  font-style: italic;
  font-weight: 600;
  color: #33552b;
}

/* Single persimmon hard-shadow CTA (btn-hero language) */
.landing-cta-ink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 52px;
  padding: 0.9rem 1.75rem;
  border-radius: 12px;
  border: 2px solid #26301f;
  background: #e2572b;
  color: #fffaf5;
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: 0.005em;
  box-shadow: 4px 4px 0 #26301f;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.landing-cta-ink:hover {
  background: #c94a24;
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 #26301f;
}
.landing-cta-ink:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 #26301f;
}

.landing-textlink {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Nunito Sans', system-ui, sans-serif;
  font-size: 1.0625rem;
  font-weight: 600;
  color: #33552b;
  text-underline-offset: 4px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(51, 85, 43, 0.35);
  transition: text-decoration-color 0.15s ease, color 0.15s ease;
}
.landing-textlink:hover {
  color: #26301f;
  text-decoration-color: #33552b;
}

.landing-meta-line {
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #5c6654;
}
.landing-meta-line .sep {
  color: #e2572b;
  margin: 0 0.5rem;
}

.landing-star {
  position: absolute;
  color: #e2572b;
  opacity: 0.45;
  pointer-events: none;
}
.landing-star--teal { color: #33552b; opacity: 0.4; }
.landing-star--ink { color: #26301f; opacity: 0.28; }

.landing-rule-book {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: #33552b;
  margin: 0 auto;
  max-width: 26rem;
}
.landing-rule-book::before,
.landing-rule-book::after {
  content: "";
  flex: 1;
  height: 0;
  border-top: 1px solid rgba(51, 85, 43, 0.28);
  box-shadow: 0 3px 0 -2px rgba(51, 85, 43, 0.18);
}

/* Full-bleed-leaning hero media: soft radius, no inset plate card */
.landing-hero-visual-bleed {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid #26301f;
  box-shadow: 6px 6px 0 #26301f;
}
.landing-hero-visual-bleed img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.landing-trust-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 640px) {
  .landing-trust-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
  }
}
.landing-trust-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
}
.landing-trust-item .material-symbols-outlined {
  color: #33552b;
  font-size: 1.5rem;
  line-height: 1;
  margin-top: 0.15rem;
}

.landing-why-bento {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 768px) {
  .landing-why-bento {
    grid-template-columns: 1.2fr 1fr;
    grid-template-rows: auto auto;
    gap: 1.25rem;
  }
  .landing-why-bento__visual {
    grid-row: 1 / span 2;
  }
}
.landing-why-bento__visual {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(38, 48, 31, 0.12);
  min-height: 220px;
}
.landing-why-bento__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.landing-why-bento__cell {
  padding: 1.25rem 1.5rem;
  border-radius: 16px;
  border: 1px solid rgba(38, 48, 31, 0.12);
  background: #fffaf5;
}
.landing-why-bento__cell--tint {
  background: #eef3ea;
  border-color: rgba(51, 85, 43, 0.18);
}

.landing-final-cta {
  border: 2px solid #26301f;
  border-radius: 16px;
  background: #f8f4ea;
  box-shadow: 6px 6px 0 #26301f;
}

.landing-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1), transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}
.landing-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .landing-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* Legacy plate class retained for any residual markup */
.landing-hero-plate {
  position: relative;
  background: #fffaf5;
  padding: 0;
  border-radius: 16px;
  border: 2px solid #26301f;
  box-shadow: 6px 6px 0 #26301f;
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .landing-cta-ink,
  .landing-hero-plate,
  .landing-hero-visual-bleed {
    transition: none;
  }
}
