/* =========================================
   ReceiptScan.io Marketing — App-matched palette
   ========================================= */

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* --- CSS Variables (from app's index.css @theme) --- */
:root {
  --color-paper: #F5F0E8;
  --color-paper-dark: #EBE4D8;
  --color-surface: #FFFFFF;
  --color-ink: #2D2926;
  --color-ink-light: #4A4541;
  --color-muted: #8C8279;
  --color-accent: #C65D3E;
  --color-accent-hover: #D4714F;
  --color-accent-light: rgba(198, 93, 62, 0.1);
  --color-success: #2A6B4F;
  --color-success-light: rgba(42, 107, 79, 0.1);
  --color-border: #E2DCD3;
  --color-border-dark: #D1C9BD;
  --color-danger: #B44332;
  --color-danger-light: rgba(180, 67, 50, 0.1);
  --color-amber-warm: #D4890A;
  --color-tier-free: #5B7A5E;
  --color-tier-free-light: rgba(91, 122, 94, 0.1);
  --color-tier-pro: #C4960C;
  --color-tier-pro-light: rgba(196, 150, 12, 0.1);

  --font-display: 'Fraunces', serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --max-w: 960px;
  --gap: 1.25rem;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--color-paper);
  color: var(--color-ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Noise overlay — matches app's body::before */
.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* --- Utility --- */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem; }
.font-mono { font-family: var(--font-mono); }
.text-accent { color: var(--color-accent); }

/* --- Animations (marketing originals; not shared with app keyframes) --- */
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes hero-word-enter {
  from {
    opacity: 0;
    transform: translateY(calc(0.4em + 10px));
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes hero-ink-soft {
  from {
    opacity: 0;
    transform: translateY(12px);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}
@keyframes hero-pill-pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes hero-cta-soft {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes hero-rule-draw {
  from {
    transform: scaleX(0);
    opacity: 0;
  }
  to {
    transform: scaleX(1);
    opacity: 1;
  }
}
@keyframes hero-sheen-pass {
  0% {
    transform: translateX(-35%);skewX(-12deg)*/
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  100% {
    transform: translateX(220%);/*skewX(-12deg)*/
    opacity: 0;
  }
}
@keyframes hero-scan-drift {
  0% {
    top: 10%;
    opacity: 0;
  }
  12% {
    opacity: 0.55;
  }
  48% {
    opacity: 0.4;
  }
  88% {
    opacity: 0.15;
  }
  100% {
    top: 90%;
    opacity: 0;
  }
}
@keyframes pulse-warm {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.animate-fade-in-up { animation: fade-in-up 0.5s ease-out both; }
.animate-fade-in { animation: fade-in 0.4s ease-out both; }
.animate-pulse-warm { animation: pulse-warm 2s ease-in-out infinite; }

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Receipt Design System (from app) --- */

/* Receipt paper card */
.receipt-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.5rem;
  position: relative;
}

/* Receipt perforated edge — CSS mask */
.receipt-paper-edge {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  border-radius: 12px;
  --perf-s: 14px;
  --perf-r: 5px;
  -webkit-mask-image:
    radial-gradient(circle var(--perf-r) at calc(var(--perf-s) / 2) 0, transparent 97%, black),
    radial-gradient(circle var(--perf-r) at calc(var(--perf-s) / 2) 100%, transparent 97%, black);
  -webkit-mask-size: var(--perf-s) 51%;
  -webkit-mask-position: center top, center bottom;
  -webkit-mask-repeat: repeat-x;
  mask-image:
    radial-gradient(circle var(--perf-r) at calc(var(--perf-s) / 2) 0, transparent 97%, black),
    radial-gradient(circle var(--perf-r) at calc(var(--perf-s) / 2) 100%, transparent 97%, black);
  mask-size: var(--perf-s) 51%;
  mask-position: center top, center bottom;
  mask-repeat: repeat-x;
}

/* Dot-matrix separator (from app) */
.dot-separator {
  border: none;
  height: 1px;
  background: repeating-linear-gradient(
    to right,
    var(--color-border-dark) 0px,
    var(--color-border-dark) 2px,
    transparent 2px,
    transparent 6px
  );
}

/* Viewfinder corner brackets (from app) */
.vf-corner {
  position: absolute;
  width: 28px;
  height: 28px;
  border-color: var(--color-accent);
  border-style: solid;
  pointer-events: none;
  z-index: 3;
}
.vf-tl { top: 0; left: 0; border-width: 3px 0 0 3px; border-radius: 4px 0 0 0; }
.vf-tr { top: 0; right: 0; border-width: 3px 3px 0 0; border-radius: 0 4px 0 0; }
.vf-bl { bottom: 0; left: 0; border-width: 0 0 3px 3px; border-radius: 0 0 0 4px; }
.vf-br { bottom: 0; right: 0; border-width: 0 3px 3px 0; border-radius: 0 0 4px 0; }

/* Tier badges (from app) */
.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border-radius: 6px;
  vertical-align: middle;
}
.tier-badge-free {
  color: var(--color-tier-free);
  background: var(--color-tier-free-light);
}
.tier-badge-pro {
  color: var(--color-tier-pro);
  background: var(--color-tier-pro-light);
}

/* --- Section Layout --- */
.section {
  padding: 4rem 0;
}
.section-alt {
  background: var(--color-paper-dark);
}
.section-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-accent);
  margin-bottom: 0.75rem;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--color-ink);
  margin-bottom: 0.5rem;
}
.section-sub {
  font-size: 1.0625rem;
  color: var(--color-muted);
  max-width: 500px;
  margin-bottom: 2rem;
}

/* --- Card Typography (from app) --- */
.card-title {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: 0.375rem;
}
.card-text {
  font-size: 0.875rem;
  color: var(--color-muted);
  line-height: 1.55;
}

/* --- Buttons (app accent color) --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 2rem;
  background: var(--color-accent);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
}
.btn-primary:hover {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 2rem;
  background: transparent;
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  border: 1.5px solid var(--color-border-dark);
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s, transform 0.15s;
}
.btn-outline:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  transform: translateY(-1px);
}

/* ===========================
   HERO
   =========================== */
.hero {
  padding: 3rem 0 4rem;
  text-align: center;
}
.hero-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  padding: 3rem 2rem 2.5rem;
  position: relative;
  overflow: hidden;
}

/* Ambient scan: sheen + line sit behind copy */
.hero-atmos {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.hero-sheen {
  position: absolute;
  top: 0%;
  left: -30%;
  width: 55%;
  height: 100%;
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgba(198, 93, 62, 0.06) 42%,
    rgba(198, 93, 62, 0.12) 50%,
    rgba(198, 93, 62, 0.05) 58%,
    transparent 72%
  );
  filter: blur(0.1px);
  animation: hero-sheen-pass 2.2s cubic-bezier(0.4, 0, 0.2, 1) 0.12s both;
}
.hero-scan-line {
  position: absolute;
  left: 8%;
  right: 8%;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
  box-shadow: 0 0 14px rgba(198, 93, 62, 0.25);
  opacity: 0;
  animation: hero-scan-drift 4.2s cubic-bezier(0.45, 0, 0.25, 1) 0.35s off;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  font-weight: 700;
  line-height: 1.12;
  margin-bottom: 0.85rem;
}
.hero-title-row {
  display: inline-block;
}
.hero-word {
  display: inline-block;
  opacity: 0;
  animation: hero-word-enter 0.75s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.hero-word-accent {
  color: var(--color-accent);
  animation-delay: 0.06s;
}
.hero-word-plain {
  color: var(--color-ink);
  margin-left: 0.12em;
  animation-delay: 0.2s;
}
.hero-title::after {
  content: "";
  display: block;
  height: 2px;
  margin: 0.35rem auto 0;
  max-width: min(12rem, 42vw);
  background: linear-gradient(90deg, var(--color-accent), rgba(198, 93, 62, 0.15));
  border-radius: 2px;
  transform-origin: center;
  transform: scaleX(0);
  opacity: 0;
  animation: hero-rule-draw 0.95s cubic-bezier(0.16, 1, 0.3, 1) 0.42s forwards;
}

.hero-sub {
  font-size: 1.125rem;
  color: var(--color-ink-light);
  margin-bottom: 1rem;
  opacity: 0;
  animation: hero-ink-soft 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.38s both;
}
.hero-tags {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-muted);
  margin-bottom: 1.5rem;
}
.tag-sep { color: var(--color-border-dark); }
.hero-pill {
  opacity: 0;
  animation: hero-pill-pop 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hero-tags .hero-pill:nth-child(1) { animation-delay: 0.52s; }
.hero-tags .hero-pill:nth-child(3) { animation-delay: 0.62s; }
.hero-tags .hero-pill:nth-child(5) { animation-delay: 0.72s; }

.hero-cta {
  opacity: 0;
  animation: hero-cta-soft 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.82s both;
}
.hero-fine {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--color-muted);
  margin-top: 0.75rem;
  opacity: 0;
  animation: fade-in 0.55s ease-out 0.92s both;
}
.hero-signin-note {
  font-size: 0.625rem;
  color: var(--color-muted);
  max-width: 22rem;
  margin: 0.5rem auto 0;
  line-height: 1.45;
  opacity: 0;
  animation: fade-in 0.55s ease-out 1.02s both;
}

/* ===========================
   PROBLEM
   =========================== */
.problem-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
  margin-top: 1.5rem;
}
@media (min-width: 640px) {
  .problem-grid { grid-template-columns: repeat(3, 1fr); }
}
.problem-card {
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.problem-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(45, 41, 38, 0.06);
}
.problem-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  line-height: 1;
}

/* ===========================
   HOW IT WORKS
   =========================== */
.steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
  margin-top: 1.5rem;
}
@media (min-width: 640px) {
  .steps-grid { grid-template-columns: repeat(3, 1fr); }
}
.step-card {
  text-align: center;
}
.step-num {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--color-accent);
  background: var(--color-accent-light);
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  margin-bottom: 0.75rem;
}
.step-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  line-height: 1;
}

/* ===========================
   FEATURES
   =========================== */
.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
  margin-top: 1.5rem;
}
@media (min-width: 640px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .features-grid { grid-template-columns: repeat(3, 1fr); }
}
.feature-card {
  transition: transform 0.2s, box-shadow 0.2s;
}
.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(45, 41, 38, 0.06);
}
.feature-icon {
  font-size: 1.75rem;
  margin-bottom: 0.625rem;
  line-height: 1;
}
.feature-badge {
  display: inline-block;
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-success);
  background: var(--color-success-light);
  padding: 2px 8px;
  border-radius: 4px;
}

/* ===========================
   DEMO
   =========================== */
.demo-card {
  max-width: 560px;
  margin: 1.5rem auto 0;
}
.demo-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.demo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
  animation: pulse-warm 2s ease-in-out infinite;
}
.demo-label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-muted);
}
.demo-body {
  background: var(--color-paper);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
}
.demo-text {
  font-size: 1rem;
  color: var(--color-ink);
  margin-bottom: 1rem;
}
.demo-placeholder {
  font-size: 0.75rem;
  color: var(--color-border-dark);
  padding: 1rem;
  border: 1.5px dashed var(--color-border-dark);
  border-radius: 8px;
  background: var(--color-surface);
}

/* ===========================
   PRICING
   =========================== */
.pricing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
  margin-top: 1.5rem;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}
@media (min-width: 640px) {
  .pricing-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .pricing-grid { grid-template-columns: repeat(3, 1fr); }
}
.pricing-card {
  display: flex;
  flex-direction: column;
}
.pricing-card-pro {
  border-color: var(--color-tier-pro);
  border-width: 1.5px;
}
.pricing-header {
  margin-bottom: 0.75rem;
}
.pricing-name {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-ink);
}
.popular-label {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-tier-pro);
  display: block;
  margin-bottom: 0.25rem;
}
.pricing-price {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}
.pricing-amount {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-ink);
}
.pricing-period {
  font-size: 0.8125rem;
  color: var(--color-muted);
}
.pricing-list {
  list-style: none;
  padding: 0.75rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.pricing-list li {
  font-size: 0.875rem;
  color: var(--color-ink-light);
  padding-left: 1.25rem;
  position: relative;
}
.pricing-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--color-success);
  font-weight: 600;
  font-size: 0.8125rem;
}
.pricing-list li strong {
  color: var(--color-ink);
  font-weight: 600;
}
.pricing-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.75rem 0 1rem;
}
.pricing-total-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-muted);
}
.pricing-total-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-ink);
}
.pricing-total-pro {
  color: var(--color-tier-pro);
}
.pricing-btn {
  width: 100%;
  margin-top: auto;
}

/* ===========================
   TESTIMONIAL
   =========================== */
.testimonial-card {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
  padding: 2.5rem 2rem;
}
.testimonial-quote {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 500;
  font-style: italic;
  color: var(--color-ink);
  line-height: 1.6;
  margin-bottom: 1rem;
}
.testimonial-author {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-muted);
  font-style: normal;
  letter-spacing: 0.02em;
}

/* ===========================
   FOOTER
   =========================== */
.site-footer {
  padding: 3rem 0 2rem;
  text-align: center;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.footer-thanks {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-ink);
}
.footer-btn { padding: 0.625rem 1.5rem; }
.footer-links {
  display: flex;
  gap: 1.5rem;
}
.footer-links a {
  font-size: 0.8125rem;
  color: var(--color-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--color-accent); }
.footer-cta {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-cta:hover { color: var(--color-accent-hover); }
.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--color-muted);
}
.footer-app-link {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-app-link:hover { color: var(--color-accent-hover); }

/* ===========================
   MOBILE STICKY CTA
   =========================== */
.mobile-cta {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.75rem 1.25rem;
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  background: var(--color-paper);
  border-top: 1px solid var(--color-border);
  z-index: 100;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}
.mobile-cta.is-visible {
  transform: translateY(0);
}
.mobile-cta-btn {
  width: 100%;
  padding: 0.875rem;
  font-size: 1rem;
}
@media (max-width: 640px) {
  .mobile-cta { display: block; }
  body { padding-bottom: 5rem; }
}

/* ===========================
   RESPONSIVE TWEAKS
   =========================== */
@media (max-width: 640px) {
  .section { padding: 3rem 0; }
  .hero { padding: 2rem 0 3rem; }
  .hero-card { padding: 2rem 1.25rem 1.75rem; }
  .hero-title { font-size: 2.25rem; }
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .hero-sheen,
  .hero-scan-line {
    animation: none !important;
    opacity: 0 !important;
  }
  .hero-word,
  .hero-sub,
  .hero-pill,
  .hero-cta,
  .hero-fine,
  .hero-signin-note {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    animation: none !important;
  }
  .hero-title::after {
    transform: scaleX(1) !important;
    opacity: 0.85 !important;
    animation: none !important;
  }
}

/* Scrollbar (from app) */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-border-dark); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-muted); }
