/* ============================================================================
 * pdftool.work v2 Design System — polish layer
 * Adds micro-interactions, active states, trust signals, motion, and CTA
 * polish on top of the editorial base styles. Idempotent; safe with v1.
 * ========================================================================== */

/* ----- Design tokens (shared with v1) ----------------------------------- */
:root {
  --v2-primary: #e5483f;
  --v2-primary-dark: #bd302b;
  --v2-ink: #18323a;
  --v2-muted: #637076;
  --v2-line: #d8d0c2;
  --v2-paper: #f6f0e4;
  --v2-paper-bright: #fffaf1;
  --v2-focus: #1f6f78;
  --v2-success: #16a34a;
  --v2-radius-sm: 6px;
  --v2-radius: 10px;
  --v2-radius-lg: 16px;
  --v2-shadow-sm: 0 1px 2px rgba(24, 50, 58, 0.05), 0 1px 3px rgba(24, 50, 58, 0.04);
  --v2-shadow: 0 4px 12px rgba(24, 50, 58, 0.07), 0 2px 4px rgba(24, 50, 58, 0.04);
  --v2-shadow-lg: 0 12px 32px rgba(24, 50, 58, 0.10), 0 4px 8px rgba(24, 50, 58, 0.05);
  --v2-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --v2-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ----- 1. Active nav state ------------------------------------------------ */
.v2-nav-active {
  position: relative;
  color: var(--v2-primary) !important;
  font-weight: 600;
}

.v2-nav-active::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -10px;
  height: 2px;
  background: var(--v2-primary);
  border-radius: 2px;
  animation: v2-slide-in 280ms var(--v2-ease-out) both;
}

@keyframes v2-slide-in {
  from { transform: scaleX(0); opacity: 0; }
  to { transform: scaleX(1); opacity: 1; }
}

/* Mobile active uses bottom border on the link itself */
.v2-mobile-active {
  color: var(--v2-primary) !important;
  font-weight: 600;
  background: rgba(229, 72, 63, 0.06);
  border-left: 3px solid var(--v2-primary);
}

/* ----- 2. Hover micro-interactions -------------------------------------- */
.nav-link,
.mobile-nav-link,
.footer-link {
  transition: color 180ms var(--v2-ease),
              background 180ms var(--v2-ease),
              transform 180ms var(--v2-ease);
  will-change: transform;
}

.nav-link:hover {
  color: var(--v2-primary);
  transform: translateY(-1px);
}

.footer-link:hover {
  color: var(--v2-ink);
  transform: translateX(2px);
}

/* ----- 3. Primary button / CTA polish ----------------------------------- */
.v2-cta-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(180deg, var(--v2-primary) 0%, var(--v2-primary-dark) 100%);
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  border-radius: var(--v2-radius);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: var(--v2-shadow);
  text-decoration: none;
  transition: all 200ms var(--v2-ease);
  cursor: pointer;
  letter-spacing: 0.01em;
}

.v2-cta-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--v2-shadow-lg);
  background: linear-gradient(180deg, #ed5a52 0%, var(--v2-primary) 100%);
}

.v2-cta-primary:active {
  transform: translateY(0);
  box-shadow: var(--v2-shadow-sm);
}

.v2-cta-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  background: var(--v2-paper-bright);
  color: var(--v2-ink);
  font-weight: 600;
  font-size: 16px;
  border-radius: var(--v2-radius);
  border: 1px solid var(--v2-line);
  text-decoration: none;
  transition: all 200ms var(--v2-ease);
  cursor: pointer;
}

.v2-cta-secondary:hover {
  border-color: var(--v2-ink);
  transform: translateY(-1px);
  box-shadow: var(--v2-shadow-sm);
}

/* ----- 4. Trust signal badges ------------------------------------------- */
.v2-trust-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  margin-top: 16px;
  font-size: 14px;
  color: var(--v2-muted);
}

.v2-trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 250, 241, 0.7);
  border: 1px solid var(--v2-line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--v2-ink);
  white-space: nowrap;
  transition: all 200ms var(--v2-ease);
}

.v2-trust-badge:hover {
  border-color: var(--v2-ink);
  background: #fff;
  transform: translateY(-1px);
}

.v2-trust-badge svg {
  width: 14px;
  height: 14px;
  color: var(--v2-success);
  flex-shrink: 0;
}

/* ----- 5. Scroll-triggered fade-in ------------------------------------- */
.v2-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 600ms var(--v2-ease-out),
              transform 600ms var(--v2-ease-out);
}

.v2-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .v2-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .nav-link,
  .footer-link,
  .v2-cta-primary,
  .v2-cta-secondary,
  .v2-trust-badge {
    transition: none;
  }
}

/* ----- 6. Loading / progress bar --------------------------------------- */
.v2-progress {
  position: relative;
  height: 4px;
  background: rgba(229, 72, 63, 0.12);
  border-radius: 2px;
  overflow: hidden;
}

.v2-progress::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--v2-primary) 50%,
    transparent 100%);
  animation: v2-progress-shimmer 1.6s ease-in-out infinite;
}

@keyframes v2-progress-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ----- 7. Skip link (accessibility) ------------------------------------ */
.v2-skip {
  position: absolute;
  top: -40px;
  left: 8px;
  background: var(--v2-ink);
  color: #fff;
  padding: 8px 16px;
  border-radius: 0 0 var(--v2-radius) var(--v2-radius);
  text-decoration: none;
  font-weight: 600;
  z-index: 1000;
  transition: top 200ms var(--v2-ease);
}

.v2-skip:focus {
  top: 0;
}

/* ----- 8. Sticky bottom mobile CTA ------------------------------------- */
.v2-mobile-cta {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent 0%, var(--v2-paper-bright) 30%);
  z-index: 40;
  transform: translateY(100%);
  transition: transform 320ms var(--v2-ease-out);
}

.v2-mobile-cta.is-shown {
  transform: translateY(0);
}

.v2-mobile-cta .v2-cta-primary {
  width: 100%;
  justify-content: center;
  font-size: 15px;
  padding: 14px 20px;
}

@media (max-width: 768px) {
  .v2-mobile-cta.is-shown {
    display: block;
  }
  body.v2-mobile-cta-active {
    padding-bottom: 80px;
  }
}

/* ----- 9. Section heading polish --------------------------------------- */
.v2-section-heading {
  font-family: inherit;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.v2-section-heading::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 3px;
  background: var(--v2-primary);
  border-radius: 2px;
  margin-right: 12px;
  vertical-align: middle;
  margin-bottom: 4px;
}

/* ----- 10. Brand mark hover glow --------------------------------------- */
.brand-mark {
  transition: transform 280ms var(--v2-ease-out);
}

a:hover .brand-mark {
  transform: rotate(-6deg) scale(1.05);
}

/* ----- 11. Footer polish ----------------------------------------------- */
footer {
  position: relative;
}

footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--v2-primary);
  border-radius: 0 0 3px 3px;
}

/* ----- 12. Header background on scroll --------------------------------- */
header.v2-scrolled {
  background: rgba(255, 250, 241, 0.92) !important;
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 rgba(24, 50, 58, 0.06);
}