/* Global styles — mobile-first */

html { overflow-x: hidden; }
body {
  background: var(--bg-primary);
  color: var(--text);
  font-family: var(--font-base);
  font-size: var(--fs-body);
  overflow-x: hidden;
  max-width: 100%;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}

main {
  display: block;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -100px;
  z-index: 1000;
  background: var(--accent-bg);
  color: var(--text-on-light);
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  font-weight: 700;
  transition: top var(--transition);
}
.skip-link:focus { top: 0.5rem; }

/* Focus visibility */
:focus-visible {
  outline: 3px solid var(--heading);
  outline-offset: 2px;
}

/* Headings */
h1 { font-size: var(--fs-h1); color: var(--white); font-weight: 800; }
h2 { font-size: var(--fs-h2); color: var(--heading); font-weight: 700; }
h3 { font-size: var(--fs-h3); color: var(--white); font-weight: 600; }

/* Text & spacing */
p { color: var(--text); margin-bottom: var(--space-paragraph); }
p:last-child { margin-bottom: 0; }

.content-section { margin-block: var(--space-section); }
.content-section__title { margin-bottom: var(--space-h2-text); position: relative; padding-bottom: 0.5rem; }
.content-section__title::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 64px; height: 3px;
  background: var(--heading);
  border-radius: 2px;
}
.content-section h3 { margin-top: var(--space-paragraph); margin-bottom: var(--space-h3-text); }
.content-section__img {
  width: 100%; height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: var(--space-paragraph);
}

.content-section ul, .content-section ol {
  margin-bottom: var(--space-paragraph);
  padding-left: 1.25rem;
}
.content-section ul { list-style: disc; }
.content-section ol { list-style: decimal; }
.content-section li { margin-bottom: 0.5rem; }
.content-section a:not(.btn) { color: var(--heading); text-decoration: underline; text-underline-offset: 3px; }
.content-section a:not(.btn):hover { color: var(--accent-bg); }

.lead {
  color: var(--white);
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  margin-bottom: var(--space-paragraph);
}

/* Intro block */
.intro { margin-block: var(--space-section); }

/* Tables */
.data-table {
  margin-bottom: var(--space-paragraph);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-dark);
  box-shadow: var(--shadow-card);
  table-layout: fixed;
  width: 100%;
}
.data-table th, .data-table td { overflow-wrap: anywhere; word-break: break-word; }
.data-table caption {
  caption-side: top;
  text-align: left;
  color: var(--heading);
  font-weight: 600;
  padding: 0.75rem var(--pad-card) 0;
  font-size: var(--fs-h3);
}
.data-table th, .data-table td {
  padding: 0.75rem var(--pad-card);
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: top;
}
.data-table th { color: var(--white); font-weight: 600; width: 42%; }
.data-table tr:last-child th, .data-table tr:last-child td { border-bottom: none; }
.data-table thead th { background: rgba(255, 179, 117, 0.12); color: var(--heading); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: var(--fs-body);
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition);
}
.btn--primary {
  background: var(--btn-gradient);
  color: var(--text-on-light);
  box-shadow: 0 4px 14px rgba(255, 166, 110, 0.35);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(255, 166, 110, 0.5); }
.btn--outline {
  background: var(--white);
  border: 1px solid var(--border-outline);
  color: var(--text-on-light);
}
.btn--outline:hover { background: #ffffff; border-color: var(--accent-bg); }
.btn--block { width: 100%; }

.cta-row { margin-block: var(--space-paragraph); display: flex; flex-wrap: wrap; gap: var(--space-card-gap); }

/* Breadcrumb */
.breadcrumb { margin-top: 1rem; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 0.4rem; font-size: 0.85rem; }
.breadcrumb li::after { content: "›"; margin-left: 0.4rem; color: var(--border-outline); }
.breadcrumb li:last-child::after { content: ""; }
.breadcrumb a { color: var(--heading); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb [aria-current="page"] { color: var(--text); }

/* Cards grid (bonuses) */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-card-gap);
  margin-block: var(--space-paragraph);
}
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: var(--pad-card);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.card__img {
  width: 100%; height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: var(--bg-primary);
  border-radius: var(--radius);
}
.card__title { color: var(--heading); }
.card__text { flex: 1; }
.card .btn { margin-top: auto; }

/* Small platform icon (App page: Android / iOS) */
.platform-icon {
  width: 96px;
  height: auto;
  object-fit: contain;
  margin-inline: auto;
}

/* Two-column feature layout */
.two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-card-gap);
  margin-block: var(--space-paragraph);
}

/* Fade-in (animations.js adds .is-visible) */
.fade-in { opacity: 1; }
.js .fade-in { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.js .fade-in.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .fade-in { opacity: 1; transform: none; }
}

/* Responsive grids */
@media (min-width: 480px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 768px) {
  .two-col { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1024px) {
  .card-grid { grid-template-columns: repeat(4, 1fr); }
  .data-table th { width: 38%; }
}

/* Section intro paragraph appears before H3s */
.section-intro { margin-bottom: var(--space-paragraph); }

/* Utility */
.text-center { text-align: center; }
.mt { margin-top: var(--space-paragraph); }

/* 404 error page */
.error-page { text-align: center; padding-block: clamp(3rem, 10vw, 6rem); display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.error-page__code { font-size: clamp(5rem, 20vw, 10rem); font-weight: 800; color: var(--heading); line-height: 1; margin: 0; }
.error-page__title { color: var(--white); }
.error-page__text { color: var(--text); max-width: 52ch; }
