/* Home refinement v1 (2026-10-21). Loaded after home-en-polish-v1.css and applies to the same template
   (#publicHome.english-home.ai-pixel-home, every Home language). The extra html prefix outranks the polish layer.
   Covers: a hero headline that no longer reflows while phrases rotate, a softer video edge, a compact consent card,
   CJK heading typography, denser features, NEW badges on model rows, and a clearer pricing block with a CTA. */

/* ---- Hero ---- */
/* The rotating English phrases always fit two lines at this size, and two lines are reserved, so the copy below
   the headline stays put while phrases type out. */
html[lang="en"] body.public-home-view #publicHome.english-home.ai-pixel-home .public-copy { container-type: inline-size; }
html[lang="en"] body.public-home-view #publicHome.english-home.ai-pixel-home .public-copy .pixel-title {
  font-size: min(99px, 13.4cqi) !important;
  line-height: 0.92 !important;
  min-height: 1.84em !important;
  align-items: flex-start !important;
}
/* No single-word last lines in body copy. */
html body.public-home-view #publicHome.english-home.ai-pixel-home p:not(.eyebrow) { text-wrap: pretty; }
/* The showcase video fades into the copy side instead of ending on a hard edge. */
@media (min-width: 761px) {
  html body.public-home-view #publicHome.english-home.ai-pixel-home .public-showcase {
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16%) !important;
    mask-image: linear-gradient(90deg, transparent 0, #000 16%) !important;
  }
}
@media (max-width: 760px) {
  html body.public-home-view #publicHome.english-home.ai-pixel-home .public-showcase {
    -webkit-mask-image: linear-gradient(180deg, #000 68%, transparent 100%) !important;
    mask-image: linear-gradient(180deg, #000 68%, transparent 100%) !important;
  }
}

/* ---- Navigation: the language menu matches the outline buttons next to it ---- */
html body.public-home-view #publicHome.english-home.ai-pixel-home .public-nav-actions select {
  border-color: rgba(241, 243, 241, 0.28) !important;
  border-radius: 14px !important;
  background-color: transparent !important;
}
html body.public-home-view #publicHome.english-home.ai-pixel-home .public-nav-actions select:hover { border-color: rgba(241, 243, 241, 0.5) !important; }

/* ---- Model marquee: names fade out at both ends instead of being cut ---- */
html body.public-home-view #publicHome.english-home.ai-pixel-home .model-marquee-viewport {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent) !important;
  mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent) !important;
}

/* ---- Headings: balanced lines; Chinese, Japanese and Korean without the tight Latin tracking ---- */
html body.public-home-view #publicHome.english-home.ai-pixel-home :is(h2, .ai-pricing-head strong, .ai-feature-grid h3) { text-wrap: balance; }
html:is([lang^="zh"], [lang="ja"], [lang="ko"]) body.public-home-view #publicHome.english-home.ai-pixel-home :is(h2, .ai-pricing-head strong) {
  letter-spacing: 0 !important;
  line-height: 1.2 !important;
}
html:is([lang^="zh"], [lang="ja"], [lang="ko"]) body.public-home-view #publicHome.english-home.ai-pixel-home h2 { font-size: min(46px, 8.4vw) !important; }
html:is([lang^="zh"], [lang="ja"], [lang="ko"]) body.public-home-view #publicHome.english-home.ai-pixel-home :is(p, summary, details p) { line-break: strict; }

/* ---- Features: no empty space under short descriptions ---- */
html body.public-home-view #publicHome.english-home.ai-pixel-home .ai-feature-grid article:nth-child(n) {
  min-height: 0 !important;
  padding-bottom: 6px !important;
}
html body.public-home-view #publicHome.english-home.ai-pixel-home .ai-feature-grid article p { text-wrap: pretty; }

/* ---- Models: "NEW" is a badge, the second line is always price or capabilities ---- */
html body.public-home-view #publicHome.english-home.ai-pixel-home .model-logo-card { position: relative !important; }
html body.public-home-view #publicHome.english-home.ai-pixel-home .model-logo-card.is-new { padding-right: 92px !important; }
html body.public-home-view #publicHome.english-home.ai-pixel-home .model-new-badge {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  padding: 4px 7px 3px;
  border: 1px solid rgba(241, 243, 241, 0.22);
  border-radius: 999px;
  color: var(--en-text) !important;
  font: 500 10px/1 var(--en-mono) !important;
  font-style: normal !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---- Pricing: heading and rates on top, packs as equal cards, then one action ---- */
html body.public-home-view #publicHome.english-home.ai-pixel-home .ai-pricing-strip {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  grid-template-areas: "head rates" "packs packs" "action action" !important;
  gap: 40px 64px !important;
  align-items: start !important;
}
html body.public-home-view #publicHome.english-home.ai-pixel-home .ai-pricing-head { grid-area: head !important; max-width: 520px; gap: 14px !important; }
html body.public-home-view #publicHome.english-home.ai-pixel-home .ai-pricing-head span { text-wrap: pretty; }
html body.public-home-view #publicHome.english-home.ai-pixel-home .ai-topup-grid {
  grid-area: packs !important;
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 12px !important;
  width: 100% !important;
  border: 0 !important;
}
html body.public-home-view #publicHome.english-home.ai-pixel-home .ai-topup-grid article {
  display: grid !important;
  grid-template-rows: auto auto 1fr auto auto !important;
  gap: 4px !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 20px 20px 18px !important;
  border: 1px solid var(--en-line) !important;
  border-radius: 12px !important;
  background: rgba(241, 243, 241, 0.015) !important;
}
html body.public-home-view #publicHome.english-home.ai-pixel-home .ai-topup-grid article.is-best {
  border-color: rgba(241, 243, 241, 0.34) !important;
  background: rgba(241, 243, 241, 0.05) !important;
}
html body.public-home-view #publicHome.english-home.ai-pixel-home .ai-topup-grid article strong {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  min-height: 22px;
  color: var(--en-text) !important;
}
html body.public-home-view #publicHome.english-home.ai-pixel-home .ai-topup-grid article em {
  align-self: end;
  margin: 22px 0 0 !important;
  font-style: normal !important;
  line-height: 1 !important;
}
/* "Save 17%" under the price; "Best value" beside the largest pack's name. */
html body.public-home-view #publicHome.english-home.ai-pixel-home .ai-topup-save {
  justify-self: start;
  margin-top: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(241, 243, 241, 0.08);
  color: var(--en-text);
  font: 500 12px/1.3 var(--en-sans);
  white-space: nowrap;
}
html body.public-home-view #publicHome.english-home.ai-pixel-home .ai-topup-save.is-empty { visibility: hidden; }
html body.public-home-view #publicHome.english-home.ai-pixel-home .ai-topup-badge {
  flex: none;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--en-text);
  color: #0a0b0b;
  font: 600 11px/1.3 var(--en-sans);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
html body.public-home-view #publicHome.english-home.ai-pixel-home .ai-rate-grid {
  grid-area: rates !important;
  display: grid !important;
  gap: 0 !important;
  width: 100% !important;
  max-width: none !important;
  border-top: 1px solid var(--en-line) !important;
}
html body.public-home-view #publicHome.english-home.ai-pixel-home .ai-rate-grid > span {
  display: flex !important;
  justify-content: space-between !important;
  align-items: baseline !important;
  gap: 20px !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 12px 0 !important;
  border-bottom: 1px solid var(--en-line) !important;
}
html body.public-home-view #publicHome.english-home.ai-pixel-home .ai-rate-grid > span small {
  min-width: 0;
  color: var(--en-text-2);
  font: 400 14px/1.4 var(--en-sans);
}
html body.public-home-view #publicHome.english-home.ai-pixel-home .ai-rate-grid > span b {
  flex: none;
  color: var(--en-text);
  font: 500 13px/1.4 var(--en-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
html body.public-home-view #publicHome.english-home.ai-pixel-home .ai-pricing-action {
  grid-area: action !important;
  display: flex !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

/* The pricing button looks exactly like the hero button (the pricing block's own span and button colours do not apply). */
html body.public-home-view #publicHome.english-home.ai-pixel-home #englishPricingStudio {
  display: inline-flex !important;
  align-items: center !important;
  min-height: 54px !important;
  padding: 0 28px !important;
  border: 1px solid rgba(255, 255, 255, 0.88) !important;
  border-radius: 5px !important;
  background: rgb(238, 241, 238) !important;
  box-shadow: none !important;
  color: rgb(10, 11, 11) !important;
}
html body.public-home-view #publicHome.english-home.ai-pixel-home #englishPricingStudio span {
  color: rgb(10, 11, 11) !important;
  -webkit-text-fill-color: rgb(10, 11, 11) !important;
  font-size: 14.88px !important;
  font-weight: 650 !important;
}
html body.public-home-view #publicHome.english-home.ai-pixel-home #englishPricingStudio:hover { background: #fff !important; }

/* ---- FAQ: the plus/minus marker sits on the right edge, in line with the rules ---- */
html body.public-home-view #publicHome.english-home.ai-pixel-home .public-faq-list summary {
  justify-content: space-between !important;
  gap: 24px !important;
  padding-right: 0 !important;
}

/* ---- Consent: a compact card in the corner instead of a bar across the page ---- */
html body.public-home-view .cookie-consent {
  left: 20px !important;
  right: auto !important;
  bottom: 20px !important;
  transform: none !important;
  translate: none !important;
  width: min(380px, calc(100% - 40px)) !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 14px !important;
  padding: 16px !important;
  border-radius: 12px !important;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45) !important;
}
html body.public-home-view .cookie-consent-copy > :is(strong, span) { flex-basis: 100%; }
html body.public-home-view .cookie-consent-actions {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
}
html body.public-home-view .cookie-consent button { width: 100% !important; }

/* ---- Narrow screens ---- */
@media (max-width: 980px) {
  html body.public-home-view #publicHome.english-home.ai-pixel-home .ai-pricing-strip {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas: "head" "packs" "rates" "action" !important;
    gap: 32px !important;
  }
  /* Packs as rows: name and credits on the left, price and saving on the right. */
  html body.public-home-view #publicHome.english-home.ai-pixel-home .ai-topup-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 8px !important; }
  html body.public-home-view #publicHome.english-home.ai-pixel-home .ai-topup-grid article {
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-rows: auto auto !important;
    grid-template-areas: "name price" "credits save" !important;
    column-gap: 16px !important;
    align-items: baseline !important;
    padding: 14px 16px !important;
  }
  html body.public-home-view #publicHome.english-home.ai-pixel-home .ai-topup-grid article strong { grid-area: name; justify-content: flex-start !important; }
  html body.public-home-view #publicHome.english-home.ai-pixel-home .ai-topup-grid article span { grid-area: credits; }
  html body.public-home-view #publicHome.english-home.ai-pixel-home .ai-topup-grid article em { grid-area: price; margin: 0 !important; font-size: 24px !important; text-align: right; }
  html body.public-home-view #publicHome.english-home.ai-pixel-home .ai-topup-save { grid-area: save; justify-self: end; margin-top: 0; }
}
@media (max-width: 760px) {
  html body.public-home-view #publicHome.english-home.ai-pixel-home .ai-feature-grid article:nth-child(n) {
    display: grid !important;
    align-content: start !important;
    grid-template-columns: 40px minmax(0, 1fr) !important;
    column-gap: 0 !important;
    row-gap: 6px !important;
    padding: 20px 0 !important;
  }
  html body.public-home-view #publicHome.english-home.ai-pixel-home .ai-feature-grid article > span { grid-row: 1 / span 2; margin: 0 !important; padding-top: 4px; }
  html body.public-home-view #publicHome.english-home.ai-pixel-home .ai-feature-grid article > :is(h3, p) { grid-column: 2; max-width: 32em !important; margin: 0 !important; }
  html body.public-home-view #publicHome.english-home.ai-pixel-home .ai-feature-grid article:last-child { border-bottom: 0 !important; }
  html body.public-home-view #publicHome.english-home.ai-pixel-home .ai-rate-grid > span { flex-wrap: wrap; row-gap: 2px !important; width: auto !important; max-width: none !important; }
  html body.public-home-view #publicHome.english-home.ai-pixel-home .ai-pricing-action .solid-action { width: 100%; justify-content: center; }
  html body.public-home-view .cookie-consent {
    left: 12px !important;
    bottom: 12px !important;
    width: calc(100% - 24px) !important;
  }
}
