/*
  New global stylesheet
  - Dark, desaturated palette
  - New class naming (masthead, keypoints, offers, offer-card, prose, etc.)
  - Improved accessibility (focus-visible, contrast, reduced motion)
  - Responsive card grid (auto-fit with minmax)
*/

:root {
  --bg: #0b0f14;
  --surface: #11161e;
  --surface-2: #151b24;
  --surface-3: #0e131a;
  --text: #e6e9ef;
  --text-dim: #c4c9d4;
  --muted: #94a3b8;
  --primary: #5e9bff; /* muted blue */
  --primary-600: #4d84e6;
  --primary-700: #426fbe;
  --accent: #4fd1b8; /* teal */
  --accent-600: #40b8a1;
  --warning: #ffb454; /* amber */
  --border: #202a36;
  --ring: #9dbbff;
  --link: #78c0ff;
}

/* Reset & base */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  font-size: 16px;
}
@media (max-width: 1023.98px) {
  html {
    font-size: 15px;
  }
}
@media (max-width: 767.98px) {
  html {
    font-size: 14px;
  }
}

html,
body {
  height: 100%;
}
body {
  margin: 0;
  color: var(--text);
  line-height: 1.55;
  background: var(--bg);
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Ubuntu,
    Cantarell, Noto Sans, Arial, sans-serif;
  display: flex;
  flex-direction: column;
}

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

.wrap {
  max-width: 76rem;
  width: 100%;
  padding: 0 1rem;
  margin: 0 auto;
}
main {
  position: relative;
  flex: 1 0 auto;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

/* Accessibility */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  padding: 0.5rem 0.75rem;
  background: var(--surface-2);
  color: var(--text);
  border-radius: 6px;
  outline: 2px solid var(--ring);
}

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* Links */
.link {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
}
@media (hover: hover) {
  .link:hover {
    color: #b6dbff;
  }
}

/* Button */
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  padding: 0.875rem 1rem;
  color: #0b0f14;
  background: linear-gradient(
    180deg,
    var(--primary) 0%,
    var(--primary-600) 100%
  );
  border-radius: 10px;
  box-shadow: 0 6px 16px rgba(22, 35, 55, 0.35);
  transition: transform 160ms ease, box-shadow 200ms ease, background 200ms ease;
}
@media (hover: hover) {
  .button:hover {
    transform: translateY(-2px);
    background: linear-gradient(
      180deg,
      var(--primary) 0%,
      var(--primary-700) 100%
    );
    box-shadow: 0 10px 22px rgba(22, 35, 55, 0.45);
  }
}
.button:active {
  transform: translateY(0);
}
.button:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
}

/* Masthead */
.masthead {
  padding: 3rem 0 2rem;
  background: radial-gradient(
      1200px 500px at 50% -10%,
      rgba(94, 155, 255, 0.15),
      transparent 70%
    ),
    radial-gradient(
      800px 400px at 80% 10%,
      rgba(79, 209, 184, 0.08),
      transparent 60%
    ),
    linear-gradient(180deg, var(--surface-3), var(--bg));
}
@media (max-width: 767.98px) {
  .masthead {
    padding: 1.25rem 0;
  }
}

.masthead__title {
  text-align: center;
  margin-bottom: 1.25rem;
  font-size: clamp(1.75rem, 3vw + 1rem, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-top: 0;
}
.masthead__title span {
  color: var(--primary);
}

.masthead__subtitle {
  text-align: center;
  font-size: clamp(1rem, 1vw + 0.75rem, 1.375rem);
  font-weight: 400;
  color: var(--text-dim);
  max-width: 60ch;
  margin: 0 auto;
}

/* Key points */
.keypoints {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
@media (max-width: 767.98px) {
  .keypoints {
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
  }
}

.keypoint {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: transform 160ms ease, background 200ms ease,
    border-color 200ms ease;
}
.keypoint__icon {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
  filter: grayscale(10%) brightness(1.2);
}
.keypoint span {
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
}
@media (hover: hover) {
  .keypoint:hover {
    transform: translateY(-3px);
    border-color: #2a3646;
  }
}
@media (max-width: 767.98px) {
  .keypoint {
    width: 32%;
    padding: 0.5rem;
  }
  .keypoint__icon {
    width: 1.5rem;
    height: 1.5rem;
  }
  .keypoint span {
    font-size: 0.75rem;
    text-align: center;
  }
}

/* Offers list */
.offers {
  padding: 2rem 0;
}
.offer-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.25rem;
}

.offer-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(5, 10, 15, 0.25);
  padding: 1rem;
  transition: transform 160ms ease, box-shadow 200ms ease,
    border-color 200ms ease;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto 1fr auto;
  row-gap: 0.75rem;
}
.offer-card--featured::after {
  content: "Top Pick";
  position: absolute;
  z-index: 1;
  top: -12px;
  left: 16px;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #0b0f14;
  background: var(--accent);
  border-radius: 6px;
  border: 1px solid var(--border);
}
@media (hover: hover) {
  .offer-card:hover {
    transform: translateY(-4px);
    border-color: #2a3646;
    box-shadow: 0 12px 28px rgba(5, 10, 15, 0.35);
  }
}

.offer-card__head {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 0.75rem;
}
.offer-card__rank {
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 50%;
}
@media (max-width: 767.98px) {
  .offers {
    padding: 1rem 0;
  }
  .offer-card__rank {
    display: none;
  }
  .prose__title {
    display: none;
  }
}

.brand-logo {
  width: 136px;
  height: 56px;
  display: inline-block;
}
.brand-logo__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.score {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}
.score__row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.score__value {
  font-weight: 700;
  color: var(--accent);
}
.score__stars {
  width: 80px;
  height: 14px;
  object-fit: cover;
  filter: grayscale(5%) brightness(1.1);
}
.score__reviews {
  margin: 0;
  font-weight: 600;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.offer-card__divider {
  height: 1px;
  width: 100%;
  background: linear-gradient(90deg, transparent, #263142 50%, transparent);
  margin: 0.25rem 0;
}

.offer-card__promo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}
.offer-card__promo span:nth-child(2) {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
}

.offer-card__bullets {
  padding: 0.25rem 0;
}
.offer-card__bullets li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  color: var(--text);
}
.offer-card__bullets img {
  width: 1rem;
  height: 1rem;
  filter: grayscale(10%) brightness(1.2);
}

.offer-card__cta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.payicons {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.25rem;
}
.payicons img {
  width: 100%;
  height: 28px;
  object-fit: contain;
  filter: grayscale(0%) brightness(1.1) contrast(1.05);
}
@media (max-width: 767.98px) {
  .payicons {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Prose content */
.prose {
  padding: 2rem 0;
}
.prose__title {
  font-size: clamp(1.5rem, 2vw + 1rem, 2.5rem);
  font-weight: 800;
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
}
.prose__h2 {
  font-size: clamp(1.25rem, 1.6vw + 0.6rem, 1.75rem);
  font-weight: 700;
  margin: 1.25rem 0 0.5rem;
}
.prose__h3 {
  font-size: clamp(1.05rem, 1.2vw + 0.6rem, 1.35rem);
  font-weight: 700;
  margin: 1rem 0 0.5rem;
}
.prose__h4 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0.75rem 0 0.5rem;
}
.prose__p {
  margin-bottom: 0.85rem;
  color: var(--text-dim);
}
.prose__ul {
  margin: 0.25rem 0 0.85rem 1.25rem;
  list-style: disc;
}
.prose__ul li {
  margin-bottom: 0.5rem;
}
.prose__table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0.75rem 0 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.prose__table th,
.prose__table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.prose__table thead th {
  background: var(--surface-2);
  color: var(--text);
}
.prose__table tbody tr:nth-child(even) {
  background: var(--surface-3);
}
.prose__link {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
}
@media (hover: hover) {
  .prose__link:hover {
    color: #b6dbff;
  }
}

/* Footer */
.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  background: var(--surface-3);
}
.foot__wrap {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.note__title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.note__text {
  color: var(--text-dim);
}
.note__text:not(:last-child) {
  margin-bottom: 0.5rem;
}

.trustmarks {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  gap: 0.75rem;
}
.trustmarks__link {
  padding: 0.35rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  height: 80px;
}
.trustmarks__link img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.footlinks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}
.footlinks__link {
  color: var(--link);
}
@media (hover: hover) {
  .footlinks__link:hover {
    color: #b6dbff;
  }
}

/* Utilities */
.hide-mobile {
  display: block;
}
@media (max-width: 767.98px) {
  .hide-mobile {
    display: none;
  }
}

/* Motion preferences */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
@media (max-width: 767.98px) {
  .offer-card {
    text-align: center;
  }
  .offer-card__head {
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .brand-logo {
    margin: 0 auto;
  }
  .score {
    align-items: center;
  }
  .score__row {
    justify-content: center;
  }
  .offer-card__promo {
    align-items: center;
  }
  .offer-card__bullets {
    display: grid;
    justify-items: center;
    row-gap: 0.3rem;
  }
  .offer-card__bullets li {
    justify-content: center;
  }
  .offer-card__cta {
    align-items: center;
  }
  .payicons {
    place-items: center;
  }

  /* Make tables scrollable horizontally on small screens */
  .prose__table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }
  .prose__table thead,
  .prose__table tbody,
  .prose__table tr,
  .prose__table th,
  .prose__table td {
    white-space: nowrap;
  }
}
