/* ============================================
   RipReader — Shared Styles
   ============================================ */

/* --- Custom Properties --- */
:root {
  /* Colors */
  --bg-primary: #0D0D0F;
  --bg-surface: #1A1A1E;
  --bg-elevated: #242428;
  --text-primary: #FFFFFF;
  --text-secondary: #A0A0A8;
  --text-tertiary: #5C5C66;
  --accent-primary: #FF6B35;
  --accent-primary-muted: rgba(255, 107, 53, 0.2);
  --accent-secondary: #3B82F6;
  --success: #22C55E;
  --error: #EF4444;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Spacing (4px base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;
  --space-30: 120px;

  /* Radii */
  --radius-card: 16px;
  --radius-button: 28px;
  --radius-sm: 8px;

  /* Sizes */
  --button-height: 56px;
  --container-max: 1100px;
  --container-narrow: 720px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #ff8a5c;
}

/* --- Focus Outlines (Accessibility) --- */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.container--narrow {
  max-width: var(--container-narrow);
}

/* --- Typography Scale --- */
.headline-hero {
  font-size: clamp(2.25rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.headline-section {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.text-body {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-secondary);
}

.text-label {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

/* --- Sections --- */
section {
  padding: var(--space-16) 0;
}

@media (min-width: 1024px) {
  section {
    padding: var(--space-24) 0;
  }
}

.section--surface {
  background-color: var(--bg-surface);
}

.section--primary {
  background-color: var(--bg-primary);
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.section-header .text-label {
  margin-bottom: var(--space-3);
}

.section-header .headline-section {
  margin-bottom: var(--space-4);
}

.section-header .text-body {
  max-width: 600px;
  margin: 0 auto;
}

/* --- Buttons --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: var(--button-height);
  padding: 0 var(--space-8);
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  background-color: var(--accent-primary);
  border: none;
  border-radius: var(--radius-button);
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary:hover {
  transform: scale(1.03);
  filter: brightness(1.1);
  color: var(--text-primary);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex-shrink: 0;
}

.btn-disabled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: var(--button-height);
  padding: 0 var(--space-8);
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-tertiary);
  background-color: var(--bg-elevated);
  border: 1px solid var(--text-tertiary);
  border-radius: var(--radius-button);
  cursor: default;
  white-space: nowrap;
  opacity: 0.6;
}

.btn-disabled svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex-shrink: 0;
}

/* --- Hero Section --- */
.hero {
  position: relative;
  padding: var(--space-20) 0 var(--space-16);
  overflow: hidden;
  text-align: center;
}

@media (min-width: 1024px) {
  .hero {
    padding: var(--space-30) 0 var(--space-24);
  }
}

.hero__glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 107, 53, 0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero__icon {
  width: 120px;
  height: 120px;
  margin: 0 auto var(--space-8);
  border-radius: var(--radius-card);
}

.hero__headline {
  margin-bottom: var(--space-5);
}

.hero__sub {
  max-width: 540px;
  margin: 0 auto var(--space-10);
  font-size: 1.125rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.hero__buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.discord-link {
  width: 100%;
  text-align: center;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--accent-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  margin-top: var(--space-2);
  transition: opacity 0.2s ease;
}

.discord-link:hover {
  opacity: 0.8;
}

/* --- How It Works --- */
.tutorial-images {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  max-width: 900px;
  margin: 0 auto;
}

.tutorial-images img {
  flex: 1;
  max-width: 33.333%;
  border-radius: var(--radius);
  object-fit: cover;
  aspect-ratio: 9 / 16.6;
  object-position: center 66.7%;
}

/* --- Feature Cards --- */
.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}

@media (min-width: 640px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature-card {
  background-color: var(--bg-surface);
  border-radius: var(--radius-card);
  padding: var(--space-8);
}

.feature-card__icon {
  font-size: 1.75rem;
  margin-bottom: var(--space-4);
  line-height: 1;
}

.feature-card__title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.feature-card__desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* --- Screenshot Cards --- */
.screenshot-card__frame {
  background-color: var(--bg-surface);
  border-radius: var(--radius-card);
  aspect-ratio: 9 / 20;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-5);
  overflow: hidden;
}

.screenshot-card__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-card);
}

.screenshot-card__title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.screenshot-card__desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* --- Carousel --- */
.carousel {
  position: relative;
  padding: 0 48px;
}

.carousel__viewport {
  overflow: hidden;
}

.carousel__track {
  display: flex;
  transition: transform 400ms cubic-bezier(0.25, 0.1, 0.25, 1);
}

.carousel__slide {
  flex: 0 0 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 var(--space-4);
}

.carousel__slide .screenshot-card__frame {
  max-width: 280px;
  width: 100%;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.carousel__btn {
  position: absolute;
  top: 45%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
  z-index: 2;
}

.carousel__btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.carousel__btn svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.carousel__btn--prev { left: 0; }
.carousel__btn--next { right: 0; }

.carousel__dots {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-6);
}

.carousel__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background-color: var(--text-tertiary);
  cursor: pointer;
  padding: 0;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.carousel__dot--active {
  background-color: var(--accent-primary);
  transform: scale(1.2);
}

@media (max-width: 639px) {
  .carousel {
    padding: 0;
  }
  .carousel__btn {
    display: none;
  }
  .carousel__slide .screenshot-card__frame {
    max-width: 240px;
  }
}

@media (min-width: 1024px) {
  .carousel__slide .screenshot-card__frame {
    max-width: 300px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .carousel__track {
    transition: none;
  }
  .carousel__dot {
    transition: none;
  }
}

/* --- Comparison Table --- */
.comparison-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 calc(-1 * var(--space-5));
  padding: 0 var(--space-5);
}

.comparison-table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.comparison-table th,
.comparison-table td {
  padding: var(--space-4) var(--space-5);
  text-align: center;
  border-bottom: 1px solid var(--bg-elevated);
}

.comparison-table th {
  font-weight: 600;
  color: var(--text-primary);
  padding-bottom: var(--space-5);
}

.comparison-table th:first-child,
.comparison-table td:first-child {
  text-align: left;
  color: var(--text-secondary);
  font-weight: 500;
}

.comparison-table td:first-child {
  color: var(--text-primary);
  font-weight: 500;
}

/* Highlighted RipReader column */
.comparison-table th.highlight,
.comparison-table td.highlight {
  background-color: var(--accent-primary-muted);
}

.comparison-table th.highlight {
  color: var(--accent-primary);
  font-weight: 700;
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

.check {
  color: var(--success);
  font-weight: 700;
}

.cross {
  color: var(--error);
  font-weight: 700;
}

.comparison-tagline {
  text-align: center;
  margin-top: var(--space-10);
  font-size: 1.125rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* --- Pricing Cards --- */
.pricing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  max-width: 700px;
  margin: 0 auto;
}

@media (min-width: 640px) {
  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.pricing-card {
  background-color: var(--bg-surface);
  border-radius: var(--radius-card);
  padding: var(--space-8);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pricing-card--featured {
  border: 2px solid var(--accent-primary);
  padding: var(--space-9, 2.5rem);
}

.pricing-trust {
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.875rem;
  margin-top: var(--space-6);
}

.pricing-card__name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
}

.pricing-card__price {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-primary);
  font-feature-settings: "tnum";
  line-height: 1;
  margin-bottom: var(--space-1);
}

.pricing-card__period {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  margin-bottom: var(--space-5);
}

.pricing-card__desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* --- Final CTA --- */
.cta {
  text-align: center;
}

.cta .headline-section {
  margin-bottom: var(--space-5);
}

.cta .text-body {
  margin-bottom: var(--space-8);
}

.cta__sub {
  margin-top: var(--space-6);
  font-size: 0.9375rem;
  color: var(--text-tertiary);
}

/* --- Footer --- */
.footer {
  padding: var(--space-10) 0;
  background-color: var(--bg-primary);
  border-top: 1px solid var(--bg-elevated);
  text-align: center;
}

.footer__links {
  display: flex;
  justify-content: center;
  gap: var(--space-6);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.footer__links a {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.footer__links a:hover {
  color: var(--accent-primary);
}

.footer__copy {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}

/* --- Fade-in-up Animation --- */
.fade-in-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .fade-in-up {
    opacity: 1;
    transform: none;
    transition: none;
  }

  html {
    scroll-behavior: auto;
  }

  .btn-primary {
    transition: none;
  }
}

/* --- Privacy Page --- */
.privacy-header {
  padding: var(--space-6) 0;
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--bg-elevated);
}

.privacy-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.privacy-header__logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
}

.privacy-header__name {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.privacy-header a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
}

.privacy-header a:hover .privacy-header__name {
  color: var(--accent-primary);
}

.privacy-content {
  padding: var(--space-12) 0 var(--space-16);
}

.privacy-content h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-2);
}

.privacy-content .effective-date {
  color: var(--text-tertiary);
  font-size: 0.9375rem;
  margin-bottom: var(--space-12);
}

.privacy-content h2 {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: var(--space-10);
  margin-bottom: var(--space-4);
}

.privacy-content h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
}

.privacy-content p {
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: var(--space-5);
}

.privacy-content ul {
  list-style: none;
  padding: 0;
  margin-bottom: var(--space-5);
}

.privacy-content ul li {
  position: relative;
  padding-left: var(--space-6);
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: var(--space-2);
}

.privacy-content ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-primary);
}

.privacy-content a {
  color: var(--accent-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

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