/* ==========================================================================
   Plait redesign proposal, phase 2 — landing continuity (flag on only; loaded by
   public/redesign.js on /whoop-meal-plan.html, /garmin-meal-plan.html and /pro.html in all four
   languages). The pages keep their copy, CTAs, tracking scripts and creator credit; this layer
   restyles them in the paper/ink/basil system so an ad, its landing page, sign-up, onboarding
   and the plan reveal read as one product.
   The nav, pill buttons, footer, consent card, language pill and reveal-once are shared with
   every other public page (html.px-public, which adds public/redesign-public.css on top).
   ========================================================================== */

html.px-landing {
  --bg: var(--px-paper);
  --bg-card: var(--px-card);
  --bg-card-2: var(--px-paper-2);
  --border: var(--px-line);
  --border-strong: var(--px-line-strong);
  --accent: var(--px-accent);
  --accent-2: var(--px-accent-hover);
  --accent-soft: var(--px-accent-tint);
  --green: var(--px-accent);
  --text: var(--px-ink);
  --text-2: var(--px-ink2);
  --text-3: var(--px-muted-ink);
  --font: var(--px-sans);
  --shadow-accent: none;
}
html:is(.px-landing, .px-public) {
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  html:is(.px-landing, .px-public):not([data-px-theme='light']) {
    color-scheme: dark;
  }
}
html:is(.px-landing, .px-public)[data-px-theme='dark'] {
  color-scheme: dark;
}
html:is(.px-landing, .px-public) body {
  background: var(--px-paper) !important;
  color: var(--px-ink);
  font-family: var(--px-sans);
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------------------ nav that settles */
html:is(.px-landing, .px-public) .pl-nav {
  background: transparent;
  border-bottom: 1px solid transparent;
  transition:
    background 0.4s,
    box-shadow 0.4s,
    backdrop-filter 0.4s;
}
html:is(.px-landing, .px-public) .pl-nav.is-stuck {
  background: color-mix(in srgb, var(--px-paper) 80%, transparent);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: 0 1px 0 var(--px-line);
}
html:is(.px-landing, .px-public) .pl-nav__logo img,
html:is(.px-landing, .px-public) main img[src*='whoopy_logo'] {
  filter: invert(1) brightness(0.15);
}
html:is(.px-landing, .px-public) .pl-nav a {
  color: var(--px-ink2);
}

/* ------------------------------------------------------------------ type and buttons */
html.px-landing main h1 {
  color: var(--px-ink);
  font-weight: 650;
  font-size: clamp(42px, 8vw, 84px) !important;
  line-height: 1 !important;
  letter-spacing: -0.05em !important;
  text-wrap: balance;
}
html.px-landing main h1 em,
html.px-landing main h2 em {
  font-family: var(--px-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--px-accent-ink);
}
html.px-landing main h2 {
  color: var(--px-ink);
  font-weight: 650;
  letter-spacing: -0.04em;
}
html.px-landing .garmin-eyebrow,
html.px-landing .pro-eyebrow,
html.px-landing .eyebrow {
  color: var(--px-accent-ink) !important;
  font: 600 12px/1.3 var(--px-mono) !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase;
}
html.px-landing .garmin-intro,
html.px-landing .pro-lead {
  color: var(--px-ink2) !important;
}
html:is(.px-landing, .px-public) .pl-btn {
  border-radius: 999px !important;
  min-height: 52px;
  padding: 16px 26px;
  font-weight: 600;
  transition:
    transform 0.35s var(--px-spring),
    box-shadow 0.35s,
    background 0.25s;
}
html:is(.px-landing, .px-public) .pl-btn--primary,
html.px-landing .garmin-page .pl-btn--primary {
  background: var(--px-ink) !important;
  color: var(--px-paper) !important;
  box-shadow: 0 12px 28px rgba(18, 26, 27, 0.18) !important;
}
@media (hover: hover) and (pointer: fine) {
  html:is(.px-landing, .px-public) .pl-btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(18, 26, 27, 0.24) !important;
  }
}
html.px-landing .garmin-small,
html.px-landing .garmin-context,
html.px-landing .garmin-section p,
html.px-landing .garmin-benefits {
  color: var(--px-ink2) !important;
}
html.px-landing .garmin-benefits li::marker {
  color: var(--px-accent-ink);
}
html.px-landing .garmin-secondary,
html.px-landing main a:not(.pl-btn) {
  color: var(--px-accent-ink) !important;
}
html.px-landing .garmin-steps article > span {
  color: var(--px-accent-ink) !important;
}
html.px-landing .garmin-steps article,
html.px-landing .garmin-section,
html.px-landing .pro-card,
html.px-landing main details {
  border-color: var(--px-line) !important;
}
html.px-landing .garmin-steps article,
html.px-landing .pro-card {
  border: 0 !important;
  border-radius: var(--px-r) !important;
  background: var(--px-card) !important;
  box-shadow: var(--px-shadow) !important;
  transition:
    transform 0.45s var(--px-spring),
    box-shadow 0.45s;
}
@media (hover: hover) and (pointer: fine) {
  html.px-landing .garmin-steps article:hover,
  html.px-landing .pro-card:hover {
    transform: translateY(-4px) rotate(-0.25deg);
    box-shadow: var(--px-shadow-lift) !important;
  }
}
html.px-landing .pro-card.is-recommended {
  box-shadow:
    inset 0 0 0 2px var(--px-accent),
    var(--px-shadow) !important;
}
html.px-landing .pro-badge {
  background: var(--px-accent-tint) !important;
  color: var(--px-accent-ink) !important;
}
/* The product preview stays a dark "screen": it reads as the app on a phone, so it keeps the
   original dark tokens inside. */
html.px-landing .product-plan-example {
  --bg: #0d0f12;
  --bg-card: #161a1f;
  --bg-card-2: #1c2127;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #ffffff;
  --text-2: rgba(255, 255, 255, 0.76);
  --text-3: rgba(255, 255, 255, 0.58);
  --accent: #7dd87a;
  color: #fff;
  border-radius: 28px !important;
  box-shadow: 0 30px 70px rgba(18, 26, 27, 0.22) !important;
}

/* ------------------------------------------------------------------ footer */
html:is(.px-landing, .px-public) .pl-footer {
  border-top-color: var(--px-line);
}
html:is(.px-landing, .px-public) .pl-footer a {
  color: var(--px-ink2);
}

/* ------------------------------------------------------------------ consent card */
/* public/analytics.js sets inline styles; the system card overrides them (flag on only). */
html:is(.px-landing, .px-public) .px-consent {
  left: 12px !important;
  right: 12px !important;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
  max-width: 520px !important;
  gap: 10px 12px !important;
  padding: 14px 16px !important;
  border: 1px solid var(--px-line) !important;
  border-radius: 20px !important;
  background: var(--px-card) !important;
  color: var(--px-ink2) !important;
  box-shadow: 0 18px 48px rgba(18, 26, 27, 0.18) !important;
  font: 400 13.5px/1.45 var(--px-sans) !important;
}
/* Wide screens: a corner card, clear of the hero's call to action. */
@media (min-width: 861px) {
  html:is(.px-landing, .px-public) .px-consent {
    left: auto !important;
    right: 24px !important;
    bottom: 24px !important;
    width: 440px !important;
    margin: 0 !important;
  }
}
html:is(.px-landing, .px-public).px-has-pill .px-consent {
  bottom: calc(84px + env(safe-area-inset-bottom, 0px)) !important;
}
html:is(.px-landing, .px-public) .px-consent > span:first-child {
  color: var(--px-ink) !important;
}
html:is(.px-landing, .px-public) .px-consent a {
  color: var(--px-accent-ink) !important;
  font-weight: 600;
  text-underline-offset: 3px;
}
html:is(.px-landing, .px-public) .px-consent label {
  gap: 8px !important;
  color: var(--px-ink2) !important;
  font-size: 12.5px !important;
  line-height: 1.4 !important;
}
html:is(.px-landing, .px-public) .px-consent .px-option-row {
  display: flex;
  flex: 1 1 100%;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
html:is(.px-landing, .px-public) .px-consent .px-option-row label {
  flex: 1;
  min-width: 0;
  align-items: center !important;
}
html:is(.px-landing, .px-public) .px-consent .px-clamp {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  overflow: hidden;
}
html:is(.px-landing, .px-public) .px-consent label.is-open {
  align-items: flex-start !important;
}
html:is(.px-landing, .px-public) .px-consent label.is-open .px-clamp {
  display: block;
}
html:is(.px-landing, .px-public) .px-consent .px-more {
  flex: none;
  min-height: 32px !important;
  padding: 0 4px !important;
  border: 0 !important;
  background: none !important;
  color: var(--px-accent-ink) !important;
  font: 600 12.5px/1 var(--px-sans) !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}
html:is(.px-landing, .px-public) .px-consent input[type='checkbox'] {
  width: 18px;
  height: 18px;
  margin-top: 1px !important;
  accent-color: var(--px-accent);
}
html:is(.px-landing, .px-public) .px-consent button {
  min-height: 44px;
  padding: 0 16px !important;
  border-radius: 999px !important;
  font: 600 14px/1.2 var(--px-sans) !important;
  cursor: pointer;
}
/* Primary: ink; secondary: ghost. */
html:is(.px-landing, .px-public) .px-consent :is([data-consent='all'], [data-privacy-dismiss]) {
  border: 0 !important;
  background: var(--px-ink) !important;
  color: var(--px-paper) !important;
}
html:is(.px-landing, .px-public)
  .px-consent
  :is([data-consent='essential'], [data-privacy-opt-out]) {
  border: 1px solid var(--px-line-strong) !important;
  background: transparent !important;
  color: var(--px-ink) !important;
}
html:is(.px-landing, .px-public) .px-consent button:focus-visible {
  outline: none;
  box-shadow: var(--px-focus);
}
@media (max-width: 640px) {
  html:is(.px-landing, .px-public) .px-consent {
    padding: 12px 14px !important;
    gap: 8px 10px !important;
    font-size: 13px !important;
  }
  html:is(.px-landing, .px-public) .px-consent > span:last-child {
    width: 100%;
    display: grid !important;
    grid-template-columns: 1fr auto;
  }
  html:is(.px-landing, .px-public) #plait-privacy-notice.px-consent [data-privacy-opt-out] {
    min-height: 40px;
    padding: 0 12px !important;
    font-size: 13px !important;
    white-space: normal;
    text-align: left;
  }
}

/* Pro on phones: a compact hero, so its call to action sits above the consent card. */
@media (max-width: 640px) {
  html.px-landing .pro-main {
    padding-top: 20px !important;
  }
  html.px-landing .pro-main > a:first-child img {
    width: auto !important;
    height: 30px !important;
  }
  html.px-landing .pro-main h1 {
    margin: 14px 0 12px !important;
    font-size: clamp(34px, 9vw, 42px) !important;
  }
  html.px-landing .pro-lead {
    font-size: 17px !important;
    line-height: 1.5 !important;
  }
  html.px-landing .pro-actions {
    margin: 18px 0 !important;
  }
}

/* ------------------------------------------------------------------ language pill */
html:is(.px-landing, .px-public) .px-lang [data-plait-language-label] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
html:is(.px-landing, .px-public) .px-lang select {
  -webkit-appearance: none;
  appearance: none;
  width: auto !important;
  min-width: 132px;
  min-height: 36px;
  padding: 0 30px 0 34px !important;
  border: 1px solid var(--px-line-strong) !important;
  border-radius: 999px !important;
  background-color: var(--px-card) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23121a1b' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M3.5 12h17M12 3.5c2.6 2.6 2.6 14.4 0 17M12 3.5c-2.6 2.6-2.6 14.4 0 17'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23121a1b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position:
    12px center,
    right 10px center !important;
  background-size: 16px, 12px !important;
  color: var(--px-ink) !important;
  font: 600 13px/1 var(--px-sans) !important;
}
html:is(.px-landing, .px-public) .px-lang select:focus-visible {
  outline: none !important;
  box-shadow: var(--px-focus);
}
html:is(.px-landing, .px-public) .px-lang.in-header {
  margin-inline-start: 0;
}
/* Pages without the shared nav: a pill at the top right, no card around it. */
html:is(.px-landing, .px-public) .px-lang:not(.in-header) {
  top: 14px;
  right: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
html:is(.px-landing, .px-public) .px-lang-slot {
  display: flex;
  justify-content: center;
  margin: 0 0 16px;
}
html:is(.px-landing, .px-public) .px-lang-slot .px-lang {
  position: static;
}
@media (prefers-color-scheme: dark) {
  html:is(.px-landing, .px-public):not([data-px-theme='light']) .px-lang select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23eef1ec' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M3.5 12h17M12 3.5c2.6 2.6 2.6 14.4 0 17M12 3.5c-2.6 2.6-2.6 14.4 0 17'/%3E%3C/svg%3E"),
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23eef1ec' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
  }
}
html:is(.px-landing, .px-public)[data-px-theme='dark'] .px-lang select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23eef1ec' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M3.5 12h17M12 3.5c2.6 2.6 2.6 14.4 0 17M12 3.5c-2.6 2.6-2.6 14.4 0 17'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23eef1ec' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
}

/* ------------------------------------------------------------------ rise once on view */
/* Phones: a 250ms fade, no blur and no stagger (the mobile QA: blur-reveal reads as a web page
   and filter animations are the costliest thing to animate). Wide screens: a short rise. */
html:is(.px-landing, .px-public).px-js [data-rv] {
  opacity: 0;
  transition: opacity 0.25s var(--px-ease-standard, ease-out);
}
html:is(.px-landing, .px-public).px-js [data-rv].is-in {
  opacity: 1;
  transform: none;
}
@media (min-width: 900px) and (hover: hover) {
  html:is(.px-landing, .px-public).px-js [data-rv] {
    transform: translateY(16px);
    transition:
      opacity 0.5s var(--px-ease),
      transform 0.5s var(--px-ease);
    transition-delay: min(var(--d, 0s), 0.15s);
  }
}
@media (prefers-reduced-motion: reduce) {
  html:is(.px-landing, .px-public).px-js [data-rv] {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }
}
@media (prefers-color-scheme: dark) {
  html:is(.px-landing, .px-public):not([data-px-theme='light']) .pl-nav__logo img,
  html:is(.px-landing, .px-public):not([data-px-theme='light']) main img[src*='whoopy_logo'] {
    filter: none;
  }
}
html:is(.px-landing, .px-public)[data-px-theme='dark'] .pl-nav__logo img,
html:is(.px-landing, .px-public)[data-px-theme='dark'] main img[src*='whoopy_logo'] {
  filter: none;
}

/* ------------------------------------------------------------------ touch: no stuck hover */
/* The pages' own sheets (plait.css, blog-guides.css) lift cards and buttons on :hover. On a touch
   screen :hover sticks after a tap, so without a real hover those lifts are switched off (a press
   gives feedback instead, below). */
@media not all and (hover: hover) {
  html:is(.px-landing, .px-public)
    :is(
      .pl-btn,
      .pl-card--hover,
      .blog-post-card,
      .guide-card,
      .plan-card,
      .cta-button,
      .provider,
      .chooser-option,
      .garmin-steps article,
      .pro-card
    ):hover:not(:active) {
    transform: none !important;
  }
}

/* ------------------------------------------------------------------ phones (mobile QA) */
/* K2: iOS Safari zooms into any field under 16px and stays zoomed. Every form control on the
   public pages (language pill, sign-in, calculators) is 16px on phones; the pill keeps its
   compact look through its padding. W2: the consent card's buttons and the nav links are 44px
   tall targets, and a press gives feedback instead of a hover lift. */
@media (max-width: 860px) {
  html:is(.px-landing, .px-public)
    :is(input:not([type='checkbox']):not([type='radio']):not([type='range']), select, textarea) {
    font-size: 16px !important;
  }
}
html:is(.px-landing, .px-public) :is(.pl-btn, .pl-pill, .cta-button, .chooser-option) {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
html:is(.px-landing, .px-public) :is(.pl-btn, .pl-pill, .cta-button, .chooser-option):active {
  transform: scale(0.97);
  opacity: 0.88;
  transition-duration: 80ms;
}
@media (max-width: 860px) {
  html:is(.px-landing, .px-public) .pl-nav__links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
}
