/* ============================================
   REPACKD — Shared Styles
   Base design tokens, utilities, and components
   shared across all marketing pages.
   ============================================ */

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

/* DESIGN TOKENS */
:root {
  --bg: #09090b;
  --surface: #18181b;
  --surface2: #27272a;
  --border: #3f3f46;
  --text: #fafafa;
  --text-muted: #a1a1aa;
  --green: #22c55e;
  --green-dim: #16a34a;
  --green-glow: rgba(34,197,94,0.15);
  --amber: #f59e0b;
  --red: #ef4444;
  --gradient: linear-gradient(135deg, #22c55e 0%, #06b6d4 100%);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* SCROLL PROGRESS BAR */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; z-index: 200;
  background: var(--gradient);
  width: 0%; transition: width 0.1s linear;
}

/* CURSOR GLOW */
.cursor-glow {
  position: fixed; width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(34,197,94,0.04) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
  transform: translate(-50%, -50%);
  transition: left 0.3s ease, top 0.3s ease;
}

/* UTILITY */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }

.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px; border-radius: 100px;
  background: var(--green-glow); border: 1px solid rgba(34,197,94,0.3);
  color: var(--green); font-size: 13px; font-weight: 600;
  letter-spacing: 0.02em;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 32px; border-radius: 12px; font-size: 16px; font-weight: 600;
  text-decoration: none; cursor: pointer; border: none;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative; overflow: hidden;
}
.btn::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transform: translateX(-100%); transition: transform 0.6s;
}
.btn:hover::after { transform: translateX(100%); }
.btn-primary {
  background: var(--green); color: #000;
  box-shadow: 0 0 20px rgba(34,197,94,0.3), 0 4px 12px rgba(0,0,0,0.3);
}
.btn-primary:hover { background: #4ade80; transform: translateY(-3px) scale(1.02); box-shadow: 0 0 40px rgba(34,197,94,0.5), 0 12px 24px rgba(0,0,0,0.3); }
.btn-secondary {
  background: transparent; color: var(--text); border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--text-muted); background: var(--surface); transform: translateY(-2px); }

.section-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--green); margin-bottom: 16px;
}

h2.section-title {
  font-size: clamp(32px, 5vw, 48px); font-weight: 800;
  line-height: 1.1; margin-bottom: 20px;
}

p.section-desc {
  font-size: 18px; color: var(--text-muted); max-width: 600px; line-height: 1.7;
}

/* LOGO */
.logo { font-size: 24px; font-weight: 900; color: var(--text); text-decoration: none; letter-spacing: -0.03em; }
.logo span { color: var(--green); }

/* HERO (shared base) */
.hero {
  padding: 160px 0 120px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-mesh {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none;
}
.hero-mesh .blob {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.07;
}
.hero-mesh .blob:nth-child(1) {
  width: 600px; height: 600px; background: #22c55e;
  top: -200px; left: 20%; animation: float1 20s ease-in-out infinite;
}
.hero-mesh .blob:nth-child(2) {
  width: 500px; height: 500px; background: #06b6d4;
  top: 100px; right: 10%; animation: float2 25s ease-in-out infinite;
}
.hero-mesh .blob:nth-child(3) {
  width: 400px; height: 400px; background: #8b5cf6;
  bottom: -100px; left: 40%; animation: float3 18s ease-in-out infinite;
}
@keyframes float1 { 0%,100% { transform: translate(0,0) scale(1); } 33% { transform: translate(60px,40px) scale(1.1); } 66% { transform: translate(-30px,60px) scale(0.95); } }
@keyframes float2 { 0%,100% { transform: translate(0,0) scale(1); } 33% { transform: translate(-50px,30px) scale(0.9); } 66% { transform: translate(40px,-20px) scale(1.05); } }
@keyframes float3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(50px,-40px) scale(1.1); } }

#particles { position: absolute; inset: 0; pointer-events: none; }

.hero h1 {
  font-size: clamp(44px, 7vw, 72px);
  font-weight: 900; line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 24px 0;
  max-width: 900px; margin-left: auto; margin-right: auto;
}
.hero h1 .highlight {
  background: var(--gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 200%;
  animation: gradientShift 4s ease-in-out infinite;
}
@keyframes gradientShift {
  0%,100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero p {
  font-size: 20px; color: var(--text-muted);
  max-width: 620px; margin: 0 auto 40px; line-height: 1.7;
}
.hero-cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.hero-img {
  width: 100%; max-width: 1000px; margin: 60px auto 0;
  border-radius: 16px; overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  transform-style: preserve-3d; perspective: 1000px;
}
.hero-img:hover { box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 40px rgba(34,197,94,0.1); }
.hero-img img { width: 100%; height: auto; display: block; }

/* ARTICLE HERO (blog posts) */
.article-hero {
  padding: 140px 0 60px;
  position: relative;
  overflow: hidden;
}

.article-hero-mesh {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none;
}
.article-hero-mesh .blob {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.07;
}
.article-hero-mesh .blob:nth-child(1) {
  width: 600px; height: 600px; background: #22c55e;
  top: -200px; left: 20%; animation: float1 20s ease-in-out infinite;
}
.article-hero-mesh .blob:nth-child(2) {
  width: 500px; height: 500px; background: #06b6d4;
  top: 100px; right: 10%; animation: float2 25s ease-in-out infinite;
}

.article-hero-inner {
  max-width: 720px;
  margin: 0 auto;
}

.article-category {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(34,197,94,0.1);
  color: var(--green);
  margin-bottom: 20px;
}

.article-hero h1 {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.article-meta .dot {
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--text-muted); opacity: 0.5;
}

.article-hero-image {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #22c55e 0%, #06b6d4 50%, #0891b2 100%);
  position: relative;
}

.article-hero-image img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}

.article-hero-image .gradient-pattern {
  position: absolute; inset: 0;
  opacity: 0.15;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(255,255,255,0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.2) 0%, transparent 40%),
    radial-gradient(circle at 50% 80%, rgba(255,255,255,0.15) 0%, transparent 45%);
}

/* ARTICLE CONTENT */
.article-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 0 80px;
}

.article-content h2 {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
  margin: 48px 0 16px;
  letter-spacing: -0.02em;
}

.article-content h3 {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  margin: 36px 0 12px;
}

.article-content p {
  font-size: 17px;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 20px;
}

.article-content strong {
  color: var(--text);
  font-weight: 600;
}

.article-content a:not(.btn) {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

.article-content a:not(.btn):hover {
  color: #4ade80;
}

.article-content ul, .article-content ol {
  margin: 0 0 20px 24px;
  font-size: 17px;
  color: var(--text-muted);
  line-height: 1.8;
}

.article-content li {
  margin-bottom: 8px;
}

.article-content blockquote {
  border-left: 3px solid var(--green);
  padding: 16px 24px;
  margin: 32px 0;
  background: var(--surface);
  border-radius: 0 12px 12px 0;
}

.article-content blockquote p {
  font-size: 18px;
  color: var(--text);
  font-style: italic;
  margin-bottom: 0;
}

/* TABLES */
.article-content .table-wrapper {
  overflow-x: auto;
  margin: 24px 0 32px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.article-content thead {
  background: var(--surface2);
}

.article-content th {
  padding: 14px 20px;
  text-align: left;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.article-content td {
  padding: 12px 20px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.article-content tbody tr:last-child td {
  border-bottom: none;
}

.article-content tbody tr:hover {
  background: rgba(34,197,94,0.03);
}

/* HIGHLIGHT BOX */
.highlight-box {
  background: linear-gradient(135deg, rgba(34,197,94,0.06) 0%, var(--surface) 100%);
  border: 1px solid rgba(34,197,94,0.2);
  border-radius: 16px;
  padding: 28px 32px;
  margin: 32px 0;
}

.highlight-box h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 12px;
}

.highlight-box p {
  font-size: 15px;
  margin-bottom: 0;
}

/* WARNING BOX */
.warning-box {
  background: linear-gradient(135deg, rgba(239,68,68,0.06) 0%, var(--surface) 100%);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: 16px;
  padding: 28px 32px;
  margin: 32px 0;
}

.warning-box h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--red);
  margin-bottom: 12px;
}

.warning-box p {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* CTA BANNER */
.article-cta {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  text-align: center;
  margin: 48px 0;
  position: relative;
  overflow: hidden;
}

.article-cta::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient);
}

.article-cta h3 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--text);
}

.article-cta p {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 24px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.article-cta .btn-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* RELATED POSTS */
.related-posts {
  padding: 80px 0;
  border-top: 1px solid var(--border);
}

.related-posts h2 {
  font-size: 32px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 48px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 960px;
  margin: 0 auto;
}

.related-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  text-decoration: none;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: block;
}

.related-card:hover {
  border-color: rgba(34,197,94,0.3);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.3);
}

.related-card .related-category {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(34,197,94,0.1);
  color: var(--green);
  margin-bottom: 12px;
}

.related-card h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 8px;
  transition: color 0.3s;
}

.related-card:hover h3 {
  color: var(--green);
}

.related-card .related-meta {
  font-size: 13px;
  color: var(--text-muted);
}

/* FOOTER */
footer {
  padding: 64px 0 32px;
  border-top: 1px solid var(--border);
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px;
  margin-bottom: 48px;
}
.footer-brand { font-size: 14px; color: var(--text-muted); max-width: 300px; line-height: 1.7; margin-top: 12px; }
footer h4 { font-size: 14px; font-weight: 700; margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.05em; }
footer ul { list-style: none; }
footer ul li { margin-bottom: 10px; }
footer ul a { color: var(--text-muted); text-decoration: none; font-size: 14px; transition: color 0.2s, padding-left 0.2s; }
footer ul a:hover { color: var(--green); padding-left: 4px; }
.footer-bottom {
  padding-top: 32px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: var(--text-muted);
}

/* SCROLL REVEAL ANIMATIONS */
.reveal {
  opacity: 0; transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-left {
  opacity: 0; transform: translateX(-40px);
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.reveal-left.visible { opacity: 1; transform: translateX(0); }
.reveal-right {
  opacity: 0; transform: translateX(40px);
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.reveal-right.visible { opacity: 1; transform: translateX(0); }
.reveal-scale {
  opacity: 0; transform: scale(0.9);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal-scale.visible { opacity: 1; transform: scale(1); }

.stagger-children > * { transition-delay: calc(var(--i, 0) * 0.1s); }

/* ==============================================
   RESPONSIVE — TABLET (max-width: 900px)
   ============================================== */
@media (max-width: 900px) {
  /* Shared */
  .cursor-glow { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .article-cta { padding: 32px 20px; }

  /* Homepage */
  .problem-grid, .features-grid, .how .steps, .ram-visual,
  .pricing-grid, .testimonial-grid, .comparison-grid {
    grid-template-columns: 1fr;
  }
  .feature-card.featured { grid-column: span 1; }
  .hero-stats { gap: 32px; flex-wrap: wrap; }
  .price-card.popular { transform: scale(1); }
  .price-card.popular:hover { transform: translateY(-6px); }

  /* Blog */
  .blog-grid { grid-template-columns: 1fr; }
  .start-grid { grid-template-columns: 1fr; }
  .featured-post { grid-template-columns: 1fr; }
  .featured-image { height: 200px; }
  .newsletter-form { flex-direction: column; }
  .newsletter-box { padding: 36px 24px; }
  .filter-bar { gap: 8px; }
  .filter-btn { padding: 6px 14px; font-size: 13px; }

  /* Pricing */
  .comparison-table-wrap { overflow-x: auto; }
  .comparison-table { min-width: 700px; }
  .guarantees { gap: 24px; }

  /* Features */
  .module-grid { grid-template-columns: 1fr; gap: 48px; }
  .module-grid.reversed .module-content { order: 1; }
  .module-grid.reversed .module-visual { order: 2; }
  .integration-grid { grid-template-columns: 1fr 1fr; }
  .api-banner { flex-direction: column; text-align: center; }
  .api-banner-content p { margin: 0 auto; }
  .api-code { min-width: unset; width: 100%; }
  .hero-img { margin-top: 40px; }

  /* Compare */
  .comp-table { font-size: 14px; }
  .comp-table thead th, .comp-table tbody td { padding: 14px 16px; }
  .dilemma-grid, .case-grid { grid-template-columns: 1fr; }
  .calc-inputs { grid-template-columns: 1fr; }
  .calc-results-grid { grid-template-columns: 1fr; gap: 16px; }

  /* Resources */
  .start-here-grid { grid-template-columns: 1fr; }
  .guide-grid { grid-template-columns: 1fr; }
  .checklist-grid { grid-template-columns: 1fr; }
  .blog-list { grid-template-columns: 1fr; }
  .cta-box { padding: 36px 24px; }
  .cta-buttons { flex-direction: column; align-items: center; }
  .checklist-card { flex-direction: column; gap: 16px; }

  /* Guide pages (EPR, RAM, Fees) */
  .article-layout { grid-template-columns: 1fr; gap: 0; }
  .toc { display: none; }
  .toc-mobile { display: block; }
  .producer-cards { grid-template-columns: 1fr; }
  .ram-inline { grid-template-columns: 1fr; }
  .modifier-cards { grid-template-columns: 1fr; }
  .fee-timeline { grid-template-columns: repeat(2, 1fr); }
  .related-resources { grid-template-columns: 1fr; }
  .guide-hero { padding: 120px 0 60px; }

  /* Glossary */
  .alpha-nav a { width: 32px; height: 32px; font-size: 12px; }
  .glossary-hero { padding: 120px 0 60px; }

  /* Contact */
  .contact-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .contact-form-wrapper { padding: 32px 24px; }

  /* About */
  .mission-grid, .story-timeline { grid-template-columns: 1fr; }
  .values-grid, .team-grid, .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .careers-box { padding: 40px 24px; }
}

/* Tablet range — 2-col grids for blog/resources */
@media (min-width: 601px) and (max-width: 900px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
  .start-grid { grid-template-columns: repeat(2, 1fr); }
  .start-here-grid { grid-template-columns: repeat(2, 1fr); }
  .guide-grid { grid-template-columns: repeat(2, 1fr); }
  .blog-list { grid-template-columns: repeat(2, 1fr); }
}

/* ==============================================
   RESPONSIVE — PHONE (max-width: 600px)
   ============================================== */
@media (max-width: 600px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }

  /* Pricing */
  .billing-toggle { flex-direction: column; border-radius: 16px; padding: 4px; }
  .billing-save { margin-left: 0; margin-top: 4px; }
  .guarantees { flex-direction: column; align-items: center; gap: 16px; }

  /* Features */
  .integration-grid { grid-template-columns: 1fr; }

  /* Compare */
  .comp-table { display: block; overflow-x: auto; }
  .dilemma-bar-label { width: 80px; font-size: 11px; }
  .calc-card { padding: 24px; }

  /* Guide pages */
  .guide-meta { flex-direction: column; gap: 8px; }
  .fee-timeline { grid-template-columns: 1fr; }
  .formula-box .formula { font-size: 14px; gap: 6px; }
  .payment-item { flex-direction: column; gap: 12px; }
  .payment-date { min-width: auto; }

  /* Glossary */
  .alpha-nav a { width: 28px; height: 28px; font-size: 11px; }
  .alpha-nav .container { gap: 4px; }
  .term-entry { padding: 20px; }

  /* Blog posts */
  .blog-hero h1 { font-size: 28px; }
  .article-body h2 { font-size: 24px; }
  .article-table { font-size: 13px; }
  .article-table thead th, .article-table tbody td { padding: 8px 10px; }

  /* About */
  .values-grid, .team-grid, .stats-grid, .story-timeline { grid-template-columns: 1fr; }
}
