/* ===== Remnant Finder Website — Custom Styles ===== */
/* Supplements Tailwind CSS CDN */

/* --- Scroll behavior --- */
html {
  scroll-behavior: smooth;
}

/* --- Inter font fine-tuning --- */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* --- Nav: transparent to solid on scroll --- */
.nav-scrolled {
  background-color: rgba(255, 255, 255, 0.97) !important;
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.nav-scrolled .nav-link {
  color: #0f172a !important;
}
.nav-scrolled .nav-logo-light {
  display: none !important;
}
.nav-scrolled .nav-logo-dark {
  display: block !important;
}
/* Hamburger icon must be visible against white nav after scroll */
.nav-scrolled #menu-btn {
  color: #0f172a !important;
}
/* Language switcher: make inactive links visible against white nav */
.nav-scrolled [aria-label="Language switcher"] a {
  color: #64748b !important;
}
.nav-scrolled [aria-label="Language switcher"] a:hover {
  color: #0f172a !important;
}
/* Active language link (has font-bold) stays prominent */
.nav-scrolled [aria-label="Language switcher"] a.font-bold {
  color: #d97706 !important;
}
/* Border also needs to darken on scroll */
.nav-scrolled [aria-label="Language switcher"] {
  border-color: #cbd5e1 !important;
}

/* --- Animations --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

.animate-on-scroll {
  opacity: 0;
}

.animate-on-scroll.is-visible {
  animation: fadeInUp 0.7s ease-out forwards;
}

.animate-on-scroll.slide-left.is-visible {
  animation: slideInLeft 0.7s ease-out forwards;
}

.animate-on-scroll.slide-right.is-visible {
  animation: slideInRight 0.7s ease-out forwards;
}

/* Staggered children */
.stagger-children.is-visible > *:nth-child(1) {
  animation-delay: 0ms;
}
.stagger-children.is-visible > *:nth-child(2) {
  animation-delay: 120ms;
}
.stagger-children.is-visible > *:nth-child(3) {
  animation-delay: 240ms;
}
.stagger-children.is-visible > *:nth-child(4) {
  animation-delay: 360ms;
}
.stagger-children.is-visible > *:nth-child(5) {
  animation-delay: 480ms;
}

/* --- Hero stone texture overlay --- */
/* Includes the primary→primary-dark base gradient as the bottom layer: this rule
   and Tailwind's .bg-gradient-to-br both set background-image, and whichever
   loads last wins the cascade. With the base layer here, the hero keeps its dark
   background either way (built tailwind.css <link> or legacy CDN injection). */
.hero-texture {
  background-image:
    radial-gradient(
      ellipse at 20% 50%,
      rgba(88, 111, 125, 0.15) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at 80% 20%,
      rgba(245, 158, 11, 0.06) 0%,
      transparent 40%
    ),
    linear-gradient(to bottom right, #586f7d, #3d4f59);
}

/* --- Testimonial carousel --- */
.testimonial-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.testimonial-dot {
  transition: all 0.3s ease;
}
.testimonial-dot.active {
  background-color: #f59e0b;
  transform: scale(1.3);
}

/* --- CTA Button pulse --- */
.btn-cta {
  position: relative;
  overflow: hidden;
}
.btn-cta::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.15),
    transparent
  );
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}
.btn-cta:hover::after {
  transform: translateX(100%);
}

/* --- Feature card hover --- */
.feature-card {
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

/* --- Mobile menu: side drawer (slides in from the right) --- */
/* Override the Tailwind `inset-0 ... flex items-center justify-center` so the
   element behaves as a side drawer instead of a fullscreen overlay.            */
.mobile-menu {
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: auto !important;
  width: min(86vw, 340px) !important;
  height: 100% !important;
  max-height: 100vh;
  max-height: 100dvh;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  gap: 0.25rem !important;
  padding: 5rem 1.5rem 1.5rem !important;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* Slide-in transform; hidden state below uses translateX(100%)              */
  transform: translateX(100%);
  transition:
    transform 0.3s cubic-bezier(0.32, 0.72, 0, 1),
    opacity 0.25s ease,
    visibility 0.25s ease;
  z-index: 70 !important;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.25);
}
.mobile-menu.open {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateX(0) !important;
}
/* Make the in-menu links left-aligned and full-width inside the drawer.       */
.mobile-menu > a {
  width: 100%;
  text-align: left;
  font-size: 1.125rem !important;
  padding: 0.65rem 0.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.mobile-menu > a.btn-cta {
  width: 100%;
  justify-content: center;
  text-align: center;
  border-bottom: 0;
  margin-top: 0.5rem;
}
/* Backdrop injected by JS */
#mobile-menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease;
  z-index: 65;
}
#mobile-menu-backdrop.open {
  opacity: 1;
  visibility: visible;
}
/* Close (X) button inside the drawer — injected by JS */
#mobile-menu-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 9999px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
#mobile-menu-close:hover,
#mobile-menu-close:focus {
  background: rgba(255, 255, 255, 0.16);
  outline: none;
}
/* Hide the sticky bottom CTA while the mobile menu is open */
body.menu-open #rf-sticky-cta {
  display: none !important;
}
/* Dismiss (×) button injected into the sticky bottom CTA */
#rf-sticky-cta-close {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  background: rgba(15, 23, 42, 0.06);
  border: 0;
  border-radius: 9999px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  z-index: 1;
}
#rf-sticky-cta-close:hover,
#rf-sticky-cta-close:focus {
  background: rgba(15, 23, 42, 0.12);
  color: #0f172a;
  outline: none;
}
#rf-sticky-cta {
  position: fixed;
}
/* Add right padding to the CTA link so it doesn't run under the close button */
#rf-sticky-cta > a {
  padding-right: 44px;
}

/* --- Smooth scroll offset for anchor links --- */
[id] {
  scroll-margin-top: 80px;
}

/* --- Star rating color --- */
.star-gold {
  color: #f59e0b;
}

/* --- Store badge hover --- */
.store-badge {
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
  opacity: 0.9;
}
.store-badge:hover {
  transform: scale(1.05);
  opacity: 1;
}

/* --- Legal pages: table of contents --- */
.toc-link {
  transition:
    color 0.2s ease,
    padding-left 0.2s ease;
}
.toc-link:hover,
.toc-link.active {
  color: #586f7d;
  padding-left: 4px;
}

/* --- Platform detection highlight --- */
.platform-highlight {
  animation: fadeInUp 0.5s ease-out;
  border: 2px solid #f59e0b;
}

/* --- Print styles --- */
@media print {
  nav,
  footer,
  .no-print {
    display: none !important;
  }
  body {
    font-size: 12pt;
  }
  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
  }
}

/* ===== Blog & long-form content ===== */
.blog-content {
  line-height: 1.75;
  color: #334155;
}
.blog-content h1,
.blog-content h2,
.blog-content h3,
.blog-content h4 {
  color: #0f172a;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 2em;
  margin-bottom: 0.75em;
}
.blog-content h1 {
  font-size: 2rem;
}
.blog-content h2 {
  font-size: 1.6rem;
}
.blog-content h3 {
  font-size: 1.3rem;
}
.blog-content h4 {
  font-size: 1.1rem;
}
.blog-content p {
  margin-bottom: 1.25em;
}
.blog-content ul,
.blog-content ol {
  margin: 1em 0 1.5em;
  padding-left: 1.5em;
}
.blog-content ul {
  list-style: disc;
}
.blog-content ol {
  list-style: decimal;
}
.blog-content li {
  margin-bottom: 0.4em;
}
.blog-content a {
  color: #586f7d;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.blog-content a:hover {
  color: #3d4f59;
}
.blog-content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
  margin: 1.5em 0;
}
.blog-content blockquote {
  border-left: 4px solid #f59e0b;
  padding: 0.5em 1.25em;
  margin: 1.5em 0;
  color: #475569;
  font-style: italic;
  background: #f8fafc;
  border-radius: 0.5rem;
}
.blog-content code {
  background: #f1f5f9;
  padding: 0.15em 0.4em;
  border-radius: 0.25rem;
  font-size: 0.9em;
}
.blog-content pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1.25em;
  border-radius: 0.75rem;
  overflow-x: auto;
  margin: 1.5em 0;
}
.blog-content iframe {
  max-width: 100%;
  border-radius: 0.75rem;
  margin: 1.5em 0;
}
.blog-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
}
.blog-content th,
.blog-content td {
  border: 1px solid #e2e8f0;
  padding: 0.6em 0.8em;
  text-align: left;
}
.blog-content th {
  background: #f8fafc;
  font-weight: 700;
}
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.language-select option {
  color: #0f172a;
  background: #ffffff;
}

/* --- Job flow section (home) --- */
/* Timestamp markers encode the real sequence of a job, so they are typed as
   data (mono, uppercase) rather than decorative 01/02/03 step numbers. */
.jobflow-marker {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a94a6;
  white-space: nowrap;
}
.jobflow-step {
  scroll-margin-top: 6rem;
}

/* --- Job flow: the rail that carries the job forward --- */
/* Desktop only: a vertical track with a node per step. The node fills as the
   step becomes the active one, so the rail reads as job progress, not decoration. */
@media (min-width: 1024px) {
  .jobflow-track {
    position: relative;
    padding-left: 2.75rem;
  }
  .jobflow-track::before {
    content: "";
    position: absolute;
    left: 0.5rem;
    top: 18vh;
    bottom: 18vh;
    width: 2px;
    background: linear-gradient(
      to bottom,
      transparent,
      rgba(88, 111, 125, 0.22) 8%,
      rgba(88, 111, 125, 0.22) 92%,
      transparent
    );
  }
  .jobflow-step {
    position: relative;
  }
  .jobflow-step::before {
    content: "";
    position: absolute;
    left: -2.75rem;
    top: 0.45rem;
    width: 1.0625rem;
    height: 1.0625rem;
    border-radius: 9999px;
    background: #ffffff;
    border: 2px solid rgba(88, 111, 125, 0.3);
    transition:
      background-color 0.35s ease,
      border-color 0.35s ease,
      transform 0.35s ease;
  }
  .jobflow-step.is-current::before {
    background: #f59e0b;
    border-color: #f59e0b;
    transform: scale(1.25);
  }
  /* Steps already passed stay filled but quiet — the job moved on. */
  .jobflow-step.is-done::before {
    background: rgba(88, 111, 125, 0.55);
    border-color: rgba(88, 111, 125, 0.55);
  }
  .jobflow-step h3,
  .jobflow-step p,
  .jobflow-marker {
    transition: opacity 0.35s ease;
  }
  /* Dim the steps that are not the current one so the eye follows the job. */
  .jobflow-track.has-current .jobflow-step:not(.is-current) h3,
  .jobflow-track.has-current .jobflow-step:not(.is-current) p,
  .jobflow-track.has-current .jobflow-step:not(.is-current) .jobflow-marker {
    opacity: 0.45;
  }
}
@media (prefers-reduced-motion: reduce) {
  .jobflow-step::before,
  .jobflow-step h3,
  .jobflow-step p,
  .jobflow-marker {
    transition: none;
  }
  .jobflow-track.has-current .jobflow-step:not(.is-current) h3,
  .jobflow-track.has-current .jobflow-step:not(.is-current) p,
  .jobflow-track.has-current .jobflow-step:not(.is-current) .jobflow-marker {
    opacity: 1;
  }
}
