:root {
  --bg: #07131f;
  --bg-elevated: #102536;
  --fg: #f4fbff;
  --muted: #7d93a8;
  --accent: #2ec4b6;
  --accent-hover: #5eead4;
  --card-bg: #e8f4f2;
  --card-border: #b7d4d0;
  --card-text: #06202a;
  --rank: #7c9cff;
  --header-h: 80px;
  --container: 1056px;
  --font: "Open Sans", sans-serif;
  --font-display: "Kumbh Sans", sans-serif;
}

[data-theme="light"] {
  --bg: #f5f5f5;
  --bg-elevated: #ffffff;
  --fg: #121212;
  --muted: #5c5c5c;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  min-height: 100vh;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
}

.container {
  width: min(100% - 32px, var(--container));
  margin-inline: auto;
}

#home,
#ranking,
#info {
  scroll-margin-top: calc(var(--header-h) + 8px);
}

/* ——— Header ——— */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--accent);
}

.header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 148px;
  height: 44px;
  border: 1px dashed var(--accent);
  border-radius: 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: rgba(46, 196, 182, 0.08);
}

.nav {
  display: flex;
  align-items: center;
  gap: 32px;
  flex: 1;
  justify-content: center;
}

.nav__link {
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.nav__link:hover,
.nav__link.is-active {
  color: var(--accent);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
}

.icon-btn:hover {
  background: rgba(46, 196, 182, 0.12);
}

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.theme-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: #292929;
  border-radius: 999px;
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.theme-toggle input:checked + .switch {
  background: var(--accent);
}

.theme-toggle input:checked + .switch::after {
  transform: translateX(20px);
}

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  place-items: center;
}

.menu-toggle .icon-close {
  display: none;
}

body.nav-open .menu-toggle .icon-open {
  display: none;
}

body.nav-open .menu-toggle .icon-close {
  display: block;
}

/* ——— Hero ——— */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: min(56vw, 520px);
  background:
    radial-gradient(ellipse 80% 70% at 12% 18%, rgba(46, 196, 182, 0.38), transparent 55%),
    radial-gradient(ellipse 70% 60% at 88% 8%, rgba(124, 156, 255, 0.28), transparent 50%),
    radial-gradient(ellipse 90% 80% at 70% 100%, rgba(20, 184, 166, 0.18), transparent 55%),
    linear-gradient(160deg, #0a2236 0%, #07131f 42%, #0d2a32 100%);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(40px);
}

.hero::before {
  width: 280px;
  height: 280px;
  top: -80px;
  right: 18%;
  background: rgba(94, 234, 212, 0.22);
}

.hero::after {
  width: 340px;
  height: 340px;
  bottom: -140px;
  left: -40px;
  background: rgba(46, 196, 182, 0.16);
}

.hero__overlay {
  position: relative;
  z-index: 1;
  min-height: inherit;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 48px 0 40px;
}

.hero h1 {
  font-size: clamp(28px, 8.5vw, 120px);
  font-weight: 800;
  line-height: 0.98;
  width: 100%;
  max-width: none;
  color: #fff;
  letter-spacing: -0.03em;
}

/* ——— Article ——— */
.page {
  padding: 36px 0 72px;
}

.lead {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
}

.intro {
  font-size: 16px;
  color: #e8e8e8;
  margin-bottom: 40px;
}

[data-theme="light"] .intro {
  color: #333;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

h2 {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  color: var(--accent);
}

.ranking-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.ranking-tab {
  min-width: 140px;
  min-height: 52px;
  padding: 14px 28px;
  border: 2px solid var(--accent);
  border-radius: 6px;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease;
}

.ranking-tab:hover {
  background: rgba(46, 196, 182, 0.12);
}

.ranking-tab.is-active {
  background: var(--accent);
  color: #000;
}

/* ——— Offers: list (original) ——— */
.offers {
  display: flex;
  flex-direction: column;
  gap: 32px;
  counter-reset: rank;
}

.offer {
  counter-increment: rank;
}

.offer.is-hidden,
.offers.is-hidden {
  display: none;
}

.offer__inner {
  position: relative;
  display: grid;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--card-border);
  border-radius: 5px;
  background: var(--card-bg);
  gap: 15px;
  grid-template: "logo title info cta" 1fr / 135px 1fr 98px 158px;
}

.offer__inner::before {
  content: counter(rank);
  font-family: Helvetica, Arial, sans-serif;
  font-size: 12px;
  line-height: 16px;
  position: absolute;
  z-index: 2;
  top: 10px;
  left: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: #000;
  border-radius: 5px 0 5px 5px;
  background: var(--rank);
}

.offer__logo-wrap {
  grid-area: logo;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 72px;
  margin-right: 5px;
  padding-right: 20px;
  background-image: url("data:image/svg+xml,%3Csvg width='1' height='92' viewBox='0 0 1 92' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cline x1='0.5' y1='0' x2='0.5' y2='92' stroke='%23CDCDCD' stroke-dasharray='6 6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right center;
}

.offer__logo {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 110px;
  height: 100%;
  border-radius: 5px;
}

.offer__logo::before,
.offer__logo::after {
  content: "";
  position: absolute;
  right: -34.5px;
  width: 30px;
  height: 15px;
}

.offer__logo::before {
  top: -11px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='15' viewBox='0 0 30 15' fill='none'%3E%3Cpath d='M15 15C23.2843 15 30 8.28432 30 0H0C0 8.28432 6.71569 15 15 15Z' fill='%23EBEBEB'/%3E%3Cpath d='M30 0C30 8.28431 23.2843 15 15 15V14C22.3958 14 28.4511 8.26528 28.9639 1H1.03613C1.54891 8.26528 7.60423 14 15 14V15L14.6133 14.9951C6.5077 14.79 0 8.15502 0 0H30Z' fill='%23CDCDCD'/%3E%3C/svg%3E");
}

.offer__logo::after {
  bottom: -11px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='15' viewBox='0 0 30 15' fill='none'%3E%3Cpath d='M15 0C6.71569 0 0 6.71569 0 15H30C30 6.71569 23.2843 0 15 0Z' fill='%23EBEBEB'/%3E%3Cpath d='M0 15C0 6.71569 6.71569 0 15 0V1C7.60423 1 1.54891 6.73472 1.03613 14H28.9639C28.4511 6.73472 22.3958 1 15 1V0C23.4923 0.21 30 6.845 30 15H0Z' fill='%23CDCDCD'/%3E%3C/svg%3E");
}

.offer__logo img {
  width: 110px;
  height: 60px;
  object-fit: contain;
  border-radius: 5px;
}

.offer__title {
  grid-area: title;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  font-family: var(--font-display);
  font-size: clamp(18px, 2.2vw, 24px);
  font-weight: 700;
  line-height: 1.2;
  color: var(--card-text);
}

.offer__name {
  display: block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.offer__info {
  grid-area: info;
  display: flex;
  align-items: center;
}

.stars {
  position: relative;
  width: 61px;
  height: 8px;
}

.stars__empty,
.stars__full {
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-size: 61px 8px;
}

.stars__empty {
  background-image: url("../assets/stars-empty.svg");
  filter: hue-rotate(155deg) saturate(1.15);
}

.stars__full {
  background-image: url("../assets/stars-full.svg");
  filter: hue-rotate(155deg) saturate(1.15);
}

.cta {
  grid-area: cta;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 5px 10px;
  color: #000;
  border-radius: 4px;
  background: linear-gradient(#7ef0e4 0%, #14b8a6 82%);
  transition: background 0.15s ease, transform 0.15s ease;
}

.cta::after {
  content: "";
  width: 21px;
  height: 21px;
  min-width: 21px;
  margin-left: 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='21' height='21' viewBox='0 0 21 21' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M10.5 20.125C15.8157 20.125 20.125 15.8157 20.125 10.5C20.125 5.18426 15.8157 0.875 10.5 0.875C5.18426 0.875 0.875 5.18426 0.875 10.5C0.875 15.8157 5.18426 20.125 10.5 20.125ZM10.5 21C16.299 21 21 16.299 21 10.5C21 4.70101 16.299 0 10.5 0C4.70101 0 0 4.70101 0 10.5C0 16.299 4.70101 21 10.5 21Z' fill='black'/%3E%3Cpath d='M5.25 9.625H12.6875L10.5 7.4375L11.8125 6.125L16.1875 10.5L11.8125 14.875L10.5 13.5625L12.6875 11.375H5.25V9.625Z' fill='black'/%3E%3C/svg%3E");
}

.cta:hover {
  background: linear-gradient(0deg, #7ef0e4 0%, #14b8a6 82%);
  transform: translateY(-1px);
}

/* ——— Offers: cards (variant 2) ——— */
.offers[data-style="cards"] {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.offers[data-style="cards"] .offer__inner {
  grid-template: "logo" auto "title" auto "info" auto "cta" auto / 1fr;
  gap: 14px;
  padding: 16px 16px 18px;
  background: var(--bg-elevated);
  border: 1px solid rgba(46, 196, 182, 0.35);
  border-radius: 12px;
  min-height: 100%;
}

.offers[data-style="cards"] .offer__inner::before {
  top: 16px;
  left: 16px;
  width: 28px;
  height: 28px;
  font-weight: 700;
  font-size: 13px;
  border-radius: 8px;
  background: var(--accent);
  color: #000;
}

.offers[data-style="cards"] .offer__logo-wrap {
  margin: 0;
  padding: 0;
  height: auto;
  background: none;
}

.offers[data-style="cards"] .offer__logo::before,
.offers[data-style="cards"] .offer__logo::after {
  display: none;
}

.offers[data-style="cards"] .offer__logo {
  display: flex;
  width: 100%;
  height: 88px;
  border-radius: 8px;
}

.offers[data-style="cards"] .offer__logo img {
  width: 140px;
  height: 64px;
}

.offers[data-style="cards"] .offer__name {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}

.offers[data-style="cards"] .offer__title {
  color: var(--fg);
  text-align: center;
  font-size: 22px;
}

.offers[data-style="cards"] .offer__info {
  justify-content: center;
}

.offers[data-style="cards"] .cta {
  width: 100%;
  height: 48px;
}

.offers[data-style="cards"] .offer__inner:hover {
  border-color: var(--accent);
}

.offers[data-style="list"] .offer__name {
  display: block;
}

/* ——— Info ——— */
.info {
  margin-top: 56px;
}

.info h2 {
  margin-bottom: 16px;
}

.info p {
  margin-bottom: 16px;
  font-size: 16px;
  color: #e8e8e8;
}

[data-theme="light"] .info p {
  color: #333;
}

.info strong {
  color: var(--fg);
}

.key-points {
  margin: 20px 0 0;
  padding: 20px 22px;
  border: 1px solid rgba(46, 196, 182, 0.4);
  border-radius: 8px;
  background: rgba(46, 196, 182, 0.08);
}

.key-points h3 {
  color: var(--accent);
  font-size: 16px;
  margin-bottom: 10px;
}

.key-points li {
  margin-left: 18px;
  margin-bottom: 8px;
  font-size: 15px;
}

/* ——— Footer ——— */
.footer {
  border-top: 1px solid var(--accent);
  padding: 48px 0 0;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px 96px;
  padding-bottom: 48px;
}

.footer .logo-placeholder {
  width: 126px;
  height: 40px;
  margin-bottom: 16px;
}

.footer p {
  font-size: 14px;
  line-height: 1.6;
  color: #ddd;
  max-width: 36ch;
}

.footer h3 {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 16px;
}

.footer__col a,
.footer__label {
  display: block;
  color: var(--accent);
  font-weight: 700;
  font-size: 18px;
  margin-top: 12px;
}

.footer__col a:hover {
  text-decoration: underline;
}

/* ——— Mobile nav ——— */
.mobile-nav {
  display: none;
  position: fixed;
  inset: var(--header-h) 0 0 0;
  background: var(--accent);
  z-index: 99;
  padding: 8px 0;
  overflow-y: auto;
}

.mobile-nav a {
  display: block;
  padding: 16px 24px;
  font-weight: 700;
  color: #fff;
  border-top: 1px solid rgba(255, 255, 255, 0.35);
}

body.nav-open .mobile-nav {
  display: block;
}

body.nav-open {
  overflow: hidden;
}

/* ——— Responsive ——— */
@media (max-width: 1024px) {
  :root {
    --header-h: 64px;
  }

  .nav {
    display: none;
  }

  .menu-toggle {
    display: grid;
  }

  .logo-placeholder {
    width: 120px;
    height: 38px;
    font-size: 11px;
  }

  .offer__inner {
    padding: 0 0 10px;
    background: #fff;
    gap: 10px 0;
    grid-template-areas:
      "logo info"
      "title title"
      "cta cta";
    grid-template-columns: 135px 1fr;
  }

  .offer__inner::before {
    top: 10px;
    left: 10px;
  }

  .offer__logo-wrap {
    margin-right: 0;
    padding: 10px 20px 10px 10px;
    height: auto;
    border-bottom: 1px solid var(--card-border);
    border-top-left-radius: 4px;
    background-color: var(--card-bg);
    background-image: none;
  }

  .offer__logo {
    width: 105px;
  }

  .offer__logo::before,
  .offer__logo::after {
    display: none;
  }

  .offer__logo img {
    width: 105px;
    height: 50px;
  }

  .offer__title {
    margin: 0;
    padding: 0 10px;
    font-size: 20px;
  }

  .offer__info {
    justify-content: center;
    height: 100%;
    padding: 15px 10px 15px 20px;
    border-bottom: 1px solid var(--card-border);
    border-top-right-radius: 4px;
    background-color: var(--card-bg);
  }

  .cta {
    width: calc(100% - 20px);
    margin: 0 auto;
  }

  .offers[data-style="cards"] {
    grid-template-columns: 1fr;
  }

  .offers[data-style="cards"] .offer__inner {
    background: var(--bg-elevated);
    padding: 16px;
    grid-template-areas:
      "logo"
      "title"
      "info"
      "cta";
    grid-template-columns: 1fr;
  }

  .offers[data-style="cards"] .offer__logo-wrap,
  .offers[data-style="cards"] .offer__info {
    background: transparent;
    border: 0;
    padding: 0;
  }

  .offers[data-style="cards"] .offer__title {
    padding: 0;
  }

  .offers[data-style="cards"] .cta {
    width: 100%;
  }

  .footer__grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

@media (max-width: 640px) {
  .hero {
    min-height: 0;
  }

  .hero__overlay {
    min-height: 0;
    justify-content: flex-start;
    padding: 16px 0 18px;
  }

  .hero h1 {
    font-size: 28px;
    line-height: 1.08;
  }

  .page {
    padding: 16px 0 48px;
  }

  .page .container {
    display: flex;
    flex-direction: column;
  }

  #ranking {
    order: -1;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 12px;
  }

  .ranking-tabs {
    width: 100%;
    gap: 10px;
  }

  .ranking-tab {
    flex: 1;
    min-width: 0;
    min-height: 48px;
    padding: 12px 16px;
    font-size: 16px;
  }

  h2 {
    font-size: 20px;
  }

  .offers {
    gap: 16px;
  }

  .lead {
    margin-top: 28px;
  }

  .intro {
    margin-bottom: 24px;
  }

  .lead,
  .intro,
  .info p {
    font-size: 15px;
  }

  .theme-toggle span.switch-icon {
    display: none;
  }
}
