/* ============================================
   trails.css — Le Cowboy Demo
   Non-critical enhancements loaded async.
   Complements the inlined critical CSS.
   ============================================ */

/* -------------------------------------------
   1. VIEWPORT ENTRY ANIMATIONS
   ------------------------------------------- */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Elements start hidden, animate when .in-view is toggled via JS / IO */
/* .canyon-section {
  transform: translateY(28px);
} */

.canyon-section.in-view {
  animation: fadeInUp 0.6s ease-out forwards;
}

/* Stagger tiles within a visible section */
.in-view .info-tile,
.in-view .payout-tile {
  opacity: 0;
  animation: fadeInUp 0.45s ease-out forwards;
}

.in-view .info-tile:nth-child(1) { animation-delay: 0.05s; }
.in-view .info-tile:nth-child(2) { animation-delay: 0.12s; }
.in-view .info-tile:nth-child(3) { animation-delay: 0.19s; }
.in-view .info-tile:nth-child(4) { animation-delay: 0.26s; }
.in-view .info-tile:nth-child(5) { animation-delay: 0.33s; }
.in-view .info-tile:nth-child(6) { animation-delay: 0.40s; }

.in-view .payout-tile:nth-child(1)  { animation-delay: 0.04s; }
.in-view .payout-tile:nth-child(2)  { animation-delay: 0.08s; }
.in-view .payout-tile:nth-child(3)  { animation-delay: 0.12s; }
.in-view .payout-tile:nth-child(4)  { animation-delay: 0.16s; }
.in-view .payout-tile:nth-child(5)  { animation-delay: 0.20s; }
.in-view .payout-tile:nth-child(6)  { animation-delay: 0.24s; }
.in-view .payout-tile:nth-child(7)  { animation-delay: 0.28s; }
.in-view .payout-tile:nth-child(8)  { animation-delay: 0.32s; }
.in-view .payout-tile:nth-child(9)  { animation-delay: 0.36s; }
.in-view .payout-tile:nth-child(10) { animation-delay: 0.40s; }

/* FAQ items slide in from left */
.in-view .faq-item {
  opacity: 0;
  animation: slideInLeft 0.45s ease-out forwards;
}

.in-view .faq-item:nth-child(1) { animation-delay: 0.06s; }
.in-view .faq-item:nth-child(2) { animation-delay: 0.12s; }
.in-view .faq-item:nth-child(3) { animation-delay: 0.18s; }
.in-view .faq-item:nth-child(4) { animation-delay: 0.24s; }
.in-view .faq-item:nth-child(5) { animation-delay: 0.30s; }

/* RTP bars animate width when section is visible */
.in-view .rtp-bar-fill {
  animation: barGrow 1.2s ease-out forwards;
}

@keyframes barGrow {
  from { width: 0; }
}

/* Data tables fade in */
.in-view .data-table {
  opacity: 0;
  animation: fadeIn 0.5s ease-out 0.15s forwards;
}

/* Author block */
.in-view .author-block {
  opacity: 0;
  animation: fadeInUp 0.5s ease-out 0.1s forwards;
}

/* -------------------------------------------
   2. HOVER ENHANCEMENTS
   ------------------------------------------- */

/* Info tiles — lift + glow */
.info-tile {
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.info-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(184, 115, 51, 0.15);
  border-color: var(--copper);
}

/* Payout tiles — copper accent border on hover */
.payout-tile {
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.payout-tile:hover {
  border-color: var(--copper);
}

.payout-tile:hover .sym-name {
  color: var(--copper);
  transition: color 0.2s ease;
}

/* Table rows — highlight stripe */
.data-table tbody tr {
  transition: background-color 0.2s ease;
}

.data-table tbody tr:hover td {
  background: rgba(184, 115, 51, 0.1);
}

/* FAQ question hover */
.faq-q {
  transition: background-color 0.2s ease, color 0.2s ease;
}

.faq-q:hover {
  background: var(--dust);
  color: var(--copper);
}

/* Buttons — glow effect */
.btn-copper:hover {
  box-shadow: 0 6px 22px rgba(184, 115, 51, 0.55);
}

.btn-mesa:hover {
  box-shadow: 0 4px 16px rgba(160, 82, 45, 0.2);
}

/* Saddle card lift */
.saddle-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.saddle-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

/* Footer links — underline slide */
.footer-col a {
  position: relative;
}

.footer-col a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--copper);
  transition: width 0.3s ease;
}

.footer-col a:hover::after {
  width: 100%;
}

/* Screenshot images — subtle zoom */
.screenshot-wrap img {
  transition: transform 0.35s ease, box-shadow 0.3s ease;
  max-width: 100%;
}

.screenshot-wrap img:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
}

/* Disclosure block hover */
.disclosure {
  transition: border-left-color 0.2s ease, background-color 0.2s ease;
}

.disclosure:hover {
  border-left-color: var(--canyon);
  background: rgba(184, 115, 51, 0.12);
}

/* RTP compare card hover */
.rtp-compare {
  transition: box-shadow 0.25s ease;
}

.rtp-compare:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* Author image hover */
.author-block img {
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.author-block img:hover {
  transform: scale(1.06);
  border-color: var(--canyon);
}

/* -------------------------------------------
   3. STAT COUNTER ANIMATION
   ------------------------------------------- */

/* Pulse highlight when counter finishes counting */
@keyframes counterPop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.stat-counter.counted .value {
  animation: counterPop 0.4s ease-out;
}

/* Glow underline that appears after count completes */
.stat-counter.counted::after {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, var(--copper), var(--canyon));
  border-radius: 2px;
  margin: 8px auto 0;
  animation: fadeIn 0.5s ease-out forwards;
}

/* Tabular nums for clean counter rendering */
.stat-counter .value {
  font-variant-numeric: tabular-nums;
  -webkit-font-feature-settings: "tnum";
          font-feature-settings: "tnum";
}

/* -------------------------------------------
   4. NAVIGATION SCROLL-SHRINK TRANSITIONS
   ------------------------------------------- */

/* The critical CSS sets transition:padding 0.3s on .outpost-nav.
   Here we refine the shrink state toggled by JS. */

.outpost-nav.scrolled {
  padding: 8px 0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.outpost-nav.scrolled .brand-stamp {
  font-size: 1.15rem;
}

.brand-stamp {
  transition: font-size 0.3s ease;
}

/* Trail menu items tighten on scroll */
.outpost-nav.scrolled .trail-menu {
  gap: 18px;
}

.trail-menu {
  transition: gap 0.3s ease;
}

/* Active nav link indicator */
.trail-menu a.active {
  color: var(--copper);
  position: relative;
}

.trail-menu a.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--copper);
  border-radius: 1px;
}

/* -------------------------------------------
   5. IMAGE LOADING SKELETONS
   ------------------------------------------- */

@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

/* Applied to img wrappers before image loads */
.img-skeleton,
.screenshot-wrap picture {
  position: relative;
  overflow: hidden;
  background: var(--dust);
  border-radius: 8px;
}

.img-skeleton::before,
.screenshot-wrap picture::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    #f5e6d33d 0%,
    rgba(210, 180, 140, 0.35) 80%,
    var(--dust) 100%
  );
  background-size: 400px 100%;
  animation: shimmer 3s ease-in-out infinite;
  z-index: 1;
}

/* Hide skeleton once image loads */
.screenshot-wrap picture.loaded::before,
.img-skeleton.loaded::before {
  display: none;
}

/* Author photo skeleton */
.author-block .img-skeleton {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* -------------------------------------------
   6. DECORATIVE / ACCENT STYLES
   ------------------------------------------- */

/* Section heading icon bullets (decorative "star" before h2) */
.canyon-section h2::before {
  content: '\2726';
  margin-right: 10px;
  color: var(--copper);
  font-size: 0.75em;
  vertical-align: middle;
}

/* Gradient divider between major sections */
.canyon-section + .alt-canyon::before,
.alt-canyon + .canyon-section::before {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--copper), transparent);
  margin: 0 auto;
  max-width: 200px;
  position: relative;
  top: -1.75rem;
}

/* Copper quote styling for blockquotes if used */
blockquote {
  border-left: 4px solid var(--copper);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  background: rgba(184, 115, 51, 0.06);
  border-radius: 0 6px 6px 0;
  font-style: italic;
  color: var(--iron);
}

/* Selection color */
::selection {
  background: rgba(184, 115, 51, 0.25);
  color: var(--coal);
}

::-moz-selection {
  background: rgba(184, 115, 51, 0.25);
  color: var(--coal);
}

/* Smooth underline for in-text links within content */
.canyon-section p a,
.canyon-section li a {
  text-decoration: underline;
  text-decoration-color: rgba(184, 115, 51, 0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s ease, color 0.2s ease;
}

.canyon-section p a:hover,
.canyon-section li a:hover {
  text-decoration-color: var(--copper);
}

/* Hero button pulse on load */
@keyframes heroPulse {
  0%, 100% { box-shadow: 0 4px 15px rgba(184, 115, 51, 0.4); }
  50%      { box-shadow: 0 4px 28px rgba(184, 115, 51, 0.65); }
}

.canyon-hero .btn-copper {
  animation: heroPulse 2.5s ease-in-out 1s 3;
}

/* RG strip subtle top border accent */
.rg-strip::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--copper), var(--canyon), var(--copper));
}

/* Scroll-top button rotation on hover */
.scroll-top-btn:hover {
  transform: translateY(-3px) rotate(-8deg);
}

/* -------------------------------------------
   7. DEMO OVERLAY TRANSITIONS
   ------------------------------------------- */

.demo-overlay {
  transition: opacity 0.35s ease;
}

.demo-overlay.open {
  display: flex !important;
  opacity: 1;
}

.demo-overlay > div {
  transform: scale(0.92);
  transition: transform 0.35s ease;
}

.demo-overlay.open > div {
  transform: scale(1);
}

/* Close button hover */
.demo-overlay button[id="close-demo"]:hover {
  background: rgba(204, 85, 0, 0.85);
  transform: rotate(90deg);
  transition: background 0.2s ease, transform 0.25s ease;
}

/* -------------------------------------------
   8. PRINT STYLE ENHANCEMENTS
   ------------------------------------------- */

@media print {
  /* Hide non-essential interactive elements */
  .hero-actions,
  .demo-overlay,
  .scroll-top-btn,
  .outpost-nav,
  .rg-strip,
  .faq-q::after,
  .rg-links {
    display: none !important;
  }

  /* Force all FAQ answers open for print */
  .faq-a {
    display: block !important;
  }

  /* Remove animations and transforms */
  .canyon-section {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }

  /* Ensure readable backgrounds */
  body {
    background: #fff !important;
    color: #000 !important;
    padding-top: 0 !important;
  }

  .canyon-hero {
    background: #fff !important;
    color: #000 !important;
    padding: 2rem 0;
    border-bottom: 2px solid #333;
  }

  .canyon-hero h1,
  .canyon-hero h1 span,
  .canyon-hero .tagline {
    color: #000 !important;
  }

  .alt-canyon {
    background: #f5f5f5 !important;
  }

  .canyon-section h2 {
    color: #000 !important;
    border-bottom-color: #333 !important;
  }

  .canyon-section h2::before {
    display: none;
  }

  /* Print-friendly tables */
  .data-table th {
    background: #333 !important;
    color: #fff !important;
  }

  .data-table td {
    border-bottom-color: #ccc !important;
  }

  .data-table tr:hover td {
    background: none !important;
  }

  /* Info tiles — border only */
  .info-tile,
  .payout-tile,
  .saddle-card,
  .rtp-compare {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }

  /* Show link URLs after anchor text */
  .canyon-section p a::after,
  .canyon-section li a::after {
    content: ' (' attr(href) ')';
    font-size: 0.8em;
    color: #666;
    word-break: break-all;
  }

  /* Footer simplified */
  .corral-footer {
    background: #fff !important;
    color: #000 !important;
    border-top: 2px solid #333 !important;
    padding: 1.5rem 0 !important;
  }

  .footer-col h4 {
    color: #000 !important;
  }

  .footer-col a {
    color: #333 !important;
  }

  .footer-col a::after {
    display: none !important;
  }

  /* Page break control */
  .canyon-section {
    page-break-inside: avoid;
  }

  .data-table {
    page-break-inside: avoid;
  }

  .author-block {
    page-break-inside: avoid;
  }
}

/* -------------------------------------------
   9. ADDITIONAL RESPONSIVE TWEAKS
   ------------------------------------------- */

/* Small tablets */
@media (max-width: 900px) {
  .rtp-compare {
    padding: 1rem;
  }

  .rtp-bar-row {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .rtp-bar-label {
    min-width: unset;
    font-size: 0.85rem;
    font-weight: 600;
  }
}

/* Mobile */
@media (max-width: 768px) {
  /* Disable viewport animations on mobile for perf */
  .rg-strip{
    padding: 10px 0;
    line-height: 17px;
  }
  .canyon-section,
  .in-view .info-tile,
  .in-view .payout-tile,
  .in-view .faq-item,
  .in-view .data-table,
  .in-view .author-block {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }

  /* Section heading icon hidden on mobile */
  .canyon-section h2::before {
    display: none;
  }

  /* Gradient dividers hidden on mobile */
  .canyon-section + .alt-canyon::before,
  .alt-canyon + .canyon-section::before {
    display: none;
  }

  /* Mobile nav menu transition */
  .trail-menu {
    transition: opacity 0.25s ease, transform 0.25s ease;
    opacity: 0;
    transform: translateY(-8px);
  }

  .trail-menu.active {
    opacity: 1;
    transform: translateY(0);
  }

  /* FAQ wider tap target */
  .faq-q {
    padding: 14px 16px;
    min-height: 48px;
  }

  /* Wider table scroll hint */
  .data-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Scroll shadow hint for tables */
  .section-wrap {
    position: relative;
  }

  /* Demo overlay full-bleed on mobile */
  .demo-overlay > div {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 0 !important;
    border: none !important;
  }

  /* Stat counter smaller on mobile */
  .stat-counter .value {
    font-size: 1.6rem;
  }

  .stat-counter.counted::after {
    width: 28px;
    height: 2px;
    margin-top: 6px;
  }

  /* Hero pulse disabled on mobile */
  .canyon-hero .btn-copper {
    animation: none;
  }
}

/* Small phones */
@media (max-width: 400px) {
  .info-grid {
    grid-template-columns: 1fr;
  }

  .payout-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    flex-direction: column;
    gap: 12px;
  }

  .hero-actions .lasso-btn {
    width: 100%;
    justify-content: center;
  }

  .canyon-section {
    padding: 2.5rem 1rem;
  }
}

/* Tall / landscape phones */
@media (max-width: 768px) and (orientation: landscape) {
  .canyon-hero {
    padding: 2.5rem 1.5rem 2rem;
  }

  .demo-overlay > div {
    aspect-ratio: unset !important;
    height: 92vh;
  }
}

/* Large screens */
@media (min-width: 1400px) {
  .section-wrap {
    max-width: 1000px;
  }

  .canyon-hero h1 {
    font-size: 3.4rem;
  }
}

/* -------------------------------------------
   10. REDUCED MOTION
   ------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .canyon-section,
  .in-view .info-tile,
  .in-view .payout-tile,
  .in-view .faq-item,
  .in-view .data-table,
  .in-view .author-block,
  .stat-counter.counted .value,
  .canyon-hero .btn-copper,
  .demo-overlay,
  .demo-overlay > div {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .img-skeleton::before,
  .screenshot-wrap picture::before {
    animation: none !important;
  }

  .scroll-top-btn:hover {
    transform: none;
  }
}

/* -------------------------------------------
   11. HIGH CONTRAST MODE
   ------------------------------------------- */

@media (forced-colors: active) {
  .info-tile,
  .payout-tile,
  .saddle-card,
  .faq-item,
  .rtp-compare,
  .author-block {
    border: 2px solid CanvasText;
  }

  .rtp-bar-fill {
    forced-color-adjust: none;
  }

  .canyon-section h2::before {
    display: none;
  }

  .stat-counter.counted::after {
    background: CanvasText;
  }
}
