/* Final additive homepage geometry. Load after the existing homepage layers. */

:root {
  --tr-release-gutter: clamp(24px, 3.2vw, 52px);
  --tr-release-content: 1360px;
  --tr-release-section-space: clamp(52px, 5vw, 76px);
  --tr-release-grid-gap: clamp(18px, 2vw, 28px);
  --tr-release-header-height: 76px;
}

body.tr-home-v3 {
  overflow-x: clip;
}

body.tr-home-v3 > header.site > .wrap,
body.tr-home-v3 main > section > .wrap,
body.tr-home-v3 main > .tr-hero > .wrap,
body main > .hero:first-child > .wrap {
  width: min(calc(100% - (2 * var(--tr-release-gutter))), var(--tr-release-content));
  max-width: none;
  margin-inline: auto;
}

/* The animated mark grows outside its layout box, keeping the header compact. */
body > header.site > .wrap > nav.nav {
  min-height: var(--tr-release-header-height) !important;
  height: var(--tr-release-header-height);
}

body > header.site .home-unified-brand {
  min-width: 230px;
  gap: 14px;
}

body > header.site .home-unified-brand > .mono {
  width: 58px !important;
  height: 58px !important;
  flex: 0 0 58px;
  margin-right: 6px;
  transform: scale(1.18);
  transform-origin: left center;
  overflow: visible;
}

body > header.site .home-unified-brand > .mono > img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
}

/* Shared compact rhythm across EN, PL and ES. */
body.tr-home-v3 main > .tr-sec {
  padding-block: var(--tr-release-section-space) !important;
}

body.tr-home-v3 .tr-sec-head {
  margin-bottom: clamp(24px, 2.5vw, 34px) !important;
}

body.tr-home-v3 :where(.tr-cards, .tr-panels, .tr-steps, .tr-path) {
  gap: var(--tr-release-grid-gap) !important;
}

body.tr-home-v3 :where(.tr-card, .tr-panel, .tr-step, .tr-spec) {
  min-width: 0;
}

body.tr-home-v3 .tr-sec + .tr-sec {
  scroll-margin-top: calc(var(--tr-release-header-height) + 12px);
}

/* Current photographic hero. */
body.tr-home-v3 .tr-hero {
  min-height: clamp(610px, 78svh, 780px) !important;
  height: auto;
}

body.tr-home-v3 .tr-hero-in {
  width: min(calc(100% - (2 * var(--tr-release-gutter))), var(--tr-release-content));
  min-height: clamp(610px, 78svh, 780px);
  box-sizing: border-box;
  padding-block: clamp(84px, 9vh, 118px) clamp(44px, 6vh, 72px) !important;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

body.tr-home-v3 .tr-hero h1 {
  max-width: 820px;
  text-wrap: balance;
}

body.tr-home-v3 .tr-hero-cta {
  margin-top: 24px !important;
}

/* Legacy split hero remains release-compatible until all routes converge. */
body main > .hero:first-child .hero-grid {
  min-height: clamp(580px, 72svh, 720px) !important;
  grid-template-columns: minmax(0, 1.04fr) minmax(460px, .96fr);
}

body main > .hero:first-child .hero-copy {
  padding-block: clamp(56px, 7vw, 92px) !important;
  padding-right: clamp(34px, 4vw, 64px) !important;
}

body main > .hero:first-child .hero-visual {
  min-width: 0;
  margin-left: 0 !important;
}

/* Search owns its result geometry and never pushes the hero into a narrow island. */
body.tr-home-v3 [data-search-root] {
  position: relative;
  width: min(100%, 780px);
  max-width: none;
  margin-top: 24px;
  isolation: isolate;
}

body.tr-home-v3 [data-search-results] {
  position: absolute;
  z-index: 30;
  inset: calc(100% + 8px) 0 auto;
  width: 100%;
  max-height: min(420px, 46svh);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-sizing: border-box;
}

body.tr-home-v3 [data-search-results]:empty,
body.tr-home-v3 [data-search-results][hidden] {
  display: none !important;
}

/* Localized tips share the same measurable footprint in every language. */
body.tr-home-v3 :where([data-homepage-tips], [data-localized-tips], .tr-homepage-tips-fallback) {
  width: min(calc(100% - (2 * var(--tr-release-gutter))), var(--tr-release-content));
  margin-inline: auto;
}

body.tr-home-v3 :where([data-homepage-tips], [data-localized-tips], .tr-homepage-tips-fallback) .tr-tips,
body.tr-home-v3 .tr-tips[data-localized-tip] {
  height: 100%;
  box-sizing: border-box;
}

body.tr-home-v3 .tr-tips ul {
  align-content: start;
}

/* Compact localized facts deck. The component is intentionally styled here,
   after all legacy homepage layers, so browser list/button defaults can never
   leak into the released EN, PL or ES layouts. */
body.tr-home-v3 [data-homepage-tips].tr-tips-deck-host {
  margin-block: clamp(18px, 2.2vw, 30px) clamp(28px, 3vw, 42px);
  padding: 0;
}

body.tr-home-v3 [data-homepage-tips] [data-homepage-tips-fallback][hidden] {
  display: none !important;
}

body.tr-home-v3 .tr-tips-deck {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, .62fr) minmax(0, 1.75fr);
  grid-template-rows: auto 1fr;
  gap: 8px clamp(22px, 3vw, 46px);
  overflow: hidden;
  border: 1px solid var(--rule, rgba(239, 231, 220, .14));
  border-radius: 18px;
  padding: clamp(22px, 2.7vw, 36px);
  color: var(--ink, #f2efea);
  background:
    radial-gradient(circle at 4% 8%, rgba(232, 84, 142, .13), transparent 34%),
    linear-gradient(135deg, rgba(19, 17, 21, .98), rgba(11, 12, 15, .99));
  box-shadow: 0 20px 60px rgba(0, 0, 0, .24), inset 0 1px 0 rgba(255, 255, 255, .025);
  isolation: isolate;
}

body.tr-home-v3 .tr-tips-deck::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--pink, #e8548e), rgba(232, 84, 142, .08));
}

body.tr-home-v3 .tr-tips-deck-kicker {
  align-self: end;
  margin: 0;
  color: var(--pink, #e8548e);
  font: 700 13px/1.25 var(--sans, var(--ui, system-ui, sans-serif));
  letter-spacing: .22em;
  text-transform: uppercase;
}

body.tr-home-v3 .tr-tips-deck-heading {
  align-self: start;
  margin: 3px 0 0;
  max-width: 9ch;
  color: var(--ink, #f2efea);
  font: 600 clamp(30px, 3vw, 46px)/.98 var(--serif, Georgia, serif);
  letter-spacing: -.035em;
  text-wrap: balance;
}

body.tr-home-v3 .tr-tips-deck-list {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: grid;
  align-content: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

body.tr-home-v3 .tr-tips-deck-item {
  min-width: 0;
  overflow: hidden;
  margin: 0;
  border: 1px solid rgba(239, 231, 220, .11);
  border-radius: 12px;
  padding: 0;
  background: rgba(255, 255, 255, .018);
  transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}

body.tr-home-v3 .tr-tips-deck-item::marker {
  content: "";
}

body.tr-home-v3 .tr-tips-deck-item.is-open {
  border-color: rgba(232, 84, 142, .48);
  background: linear-gradient(110deg, rgba(232, 84, 142, .11), rgba(255, 255, 255, .022));
  box-shadow: inset 3px 0 0 var(--pink, #e8548e);
}

body.tr-home-v3 .tr-tips-deck-trigger {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 22px;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  align-items: center;
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 9px 14px 9px 11px;
  color: var(--ink, #f2efea);
  background: transparent;
  box-shadow: none;
  font-family: var(--sans, var(--ui, system-ui, sans-serif));
  text-align: left;
  cursor: pointer;
}

body.tr-home-v3 .tr-tips-deck-trigger::after {
  content: "+";
  justify-self: end;
  color: var(--pink, #e8548e);
  font: 400 21px/1 var(--sans, var(--ui, system-ui, sans-serif));
  transition: transform .2s ease;
}

body.tr-home-v3 .tr-tips-deck-item.is-open .tr-tips-deck-trigger::after {
  content: "−";
  transform: rotate(180deg);
}

body.tr-home-v3 .tr-tips-deck-trigger:hover {
  color: #fff8ef;
  background: rgba(255, 255, 255, .022);
}

body.tr-home-v3 .tr-tips-deck-trigger:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid var(--pink, #e8548e);
  outline-offset: -3px;
}

body.tr-home-v3 .tr-tips-deck-index {
  display: grid;
  width: 36px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(232, 84, 142, .32);
  border-radius: 8px;
  color: var(--pink, #e8548e);
  background: rgba(232, 84, 142, .07);
  font: 750 13px/1 var(--sans, var(--ui, system-ui, sans-serif));
  letter-spacing: .16em;
}

body.tr-home-v3 .tr-tips-deck-title {
  min-width: 0;
  color: inherit;
  font: 650 clamp(13px, 1.05vw, 15px)/1.32 var(--sans, var(--ui, system-ui, sans-serif));
  overflow-wrap: anywhere;
}

body.tr-home-v3 .tr-tips-deck-panel {
  margin: 0;
  padding: 0 48px 15px 61px;
}

body.tr-home-v3 .tr-tips-deck-panel[hidden] {
  display: none !important;
}

body.tr-home-v3 .tr-tips-deck-body {
  max-width: 78ch;
  margin: 0;
  color: var(--muted, #b4aea7);
  font: 500 12.5px/1.55 var(--sans, var(--ui, system-ui, sans-serif));
}

@media (max-width: 520px) {
  body.tr-home-v3 [data-homepage-tips].tr-tips-deck-host {
    margin-block: 14px 26px;
  }

  body.tr-home-v3 .tr-tips-deck {
    border-radius: 14px;
    padding: 19px 14px 14px;
  }

  body.tr-home-v3 .tr-tips-deck-trigger {
    grid-template-columns: 32px minmax(0, 1fr) 18px;
    gap: 9px;
    min-height: 58px;
    padding-inline: 9px 11px;
  }

  body.tr-home-v3 .tr-tips-deck-index {
    width: 30px;
    height: 28px;
  }

  body.tr-home-v3 .tr-tips-deck-title {
    font-size: 13px;
  }

  body.tr-home-v3 .tr-tips-deck-panel {
    padding: 0 37px 14px 50px;
  }

  body.tr-home-v3 .tr-tips-deck-body {
    font-size: 12px;
  }
}

/* Prescription-process hook supports both the current class and future renderer. */
body.tr-home-v3 [data-prescription-process] {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--tr-release-grid-gap);
  width: 100%;
  max-width: none;
  align-items: stretch;
}

body.tr-home-v3 [data-prescription-process] > * {
  min-width: 0;
}

body.tr-home-v3 [data-prescription-process] :where(.tr-step, .tr-card) {
  height: 100%;
  box-sizing: border-box;
}

/* 1910/1920: use the canvas instead of leaving a narrow centered island. */
@media (min-width: 1800px) {
  :root {
    --tr-release-gutter: 56px;
    --tr-release-content: 1680px;
    --tr-release-section-space: 72px;
    --tr-release-grid-gap: 30px;
  }

  body.tr-home-v3 .tr-hero h1 {
    max-width: 900px;
  }

  body.tr-home-v3 .tr-cards.cols-4,
  body.tr-home-v3 [data-prescription-process] {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  body.tr-home-v3 .tr-cards.cols-2,
  body.tr-home-v3 .tr-panels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body main > .hero:first-child .hero-grid {
    grid-template-columns: minmax(0, 1.08fr) minmax(620px, .92fr);
  }
}

/* Polished 1440 desktop: full but controlled measure. */
@media (max-width: 1440px) {
  :root {
    --tr-release-content: 1280px;
    --tr-release-section-space: 62px;
  }

  body.tr-home-v3 .tr-hero,
  body.tr-home-v3 .tr-hero-in {
    min-height: clamp(590px, 76svh, 720px) !important;
  }

  body.tr-home-v3 .tr-hero-in {
    padding-block: 80px 50px !important;
  }
}

/* 900 tablet landscape. */
@media (max-width: 900px) {
  :root {
    --tr-release-gutter: 28px;
    --tr-release-section-space: 52px;
    --tr-release-grid-gap: 18px;
    --tr-release-header-height: 72px;
  }

  body > header.site .home-unified-brand {
    min-width: 0;
  }

  body > header.site .home-unified-brand > .mono {
    width: 54px !important;
    height: 54px !important;
    flex-basis: 54px;
    transform: scale(1.14);
  }

  body.tr-home-v3 .tr-hero,
  body.tr-home-v3 .tr-hero-in {
    min-height: 590px !important;
  }

  body.tr-home-v3 .tr-hero-in {
    padding-block: 76px 44px !important;
  }

  body main > .hero:first-child .hero-grid {
    min-height: 0 !important;
    grid-template-columns: 1fr;
  }

  body main > .hero:first-child .hero-copy {
    padding: 46px 0 !important;
  }

  body main > .hero:first-child .hero-visual {
    min-height: 340px;
    order: -1;
  }

  body.tr-home-v3 [data-prescription-process] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.tr-home-v3 .tr-tips-deck {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 4px;
  }

  body.tr-home-v3 .tr-tips-deck-heading {
    max-width: none;
    margin-bottom: 14px;
  }

  body.tr-home-v3 .tr-tips-deck-list {
    grid-column: 1;
    grid-row: auto;
  }
}

/* 768 tablet portrait. */
@media (max-width: 768px) {
  :root {
    --tr-release-gutter: 22px;
    --tr-release-section-space: 46px;
    --tr-release-header-height: 68px;
  }

  body.tr-home-v3 main > .tr-sec {
    padding-block: var(--tr-release-section-space) !important;
  }

  body.tr-home-v3 .tr-hero,
  body.tr-home-v3 .tr-hero-in {
    min-height: 560px !important;
  }

  body.tr-home-v3 .tr-hero-in {
    padding-block: 70px 38px !important;
  }

  body.tr-home-v3 [data-search-root] {
    width: 100%;
    margin-top: 20px;
  }

  body.tr-home-v3 [data-search-results] {
    max-height: min(360px, 42svh);
  }

  body.tr-home-v3 :where(.tr-cards.cols-4, .tr-cards.cols-2, .tr-panels, .tr-steps),
  body.tr-home-v3 [data-prescription-process] {
    grid-template-columns: 1fr;
  }
}

/* 390 mobile. */
@media (max-width: 390px) {
  :root {
    --tr-release-gutter: 16px;
    --tr-release-section-space: 40px;
    --tr-release-grid-gap: 14px;
    --tr-release-header-height: 66px;
  }

  body > header.site .home-unified-brand {
    gap: 8px;
  }

  body > header.site .home-unified-brand > .mono {
    width: 48px !important;
    height: 48px !important;
    flex-basis: 48px;
    margin-right: 2px;
    transform: scale(1.12);
  }

  body > header.site .home-unified-brand .wordmark {
    font-size: 17px !important;
  }

  body.tr-home-v3 .tr-hero,
  body.tr-home-v3 .tr-hero-in {
    min-height: 530px !important;
  }

  body.tr-home-v3 .tr-hero-in {
    padding-block: 66px 32px !important;
  }

  body.tr-home-v3 .tr-hero-cta,
  body main > .hero:first-child .hero-cta {
    gap: 10px !important;
  }

  body.tr-home-v3 .tr-hero-cta > *,
  body main > .hero:first-child .hero-cta > * {
    width: 100%;
  }

  body.tr-home-v3 [data-search-results] {
    inset-inline: 0;
    max-height: min(320px, 40svh);
  }
}

/* 375 compact mobile. */
@media (max-width: 375px) {
  :root {
    --tr-release-gutter: 14px;
    --tr-release-section-space: 36px;
  }

  body > header.site .home-unified-brand > .mono {
    width: 46px !important;
    height: 46px !important;
    flex-basis: 46px;
  }

  body.tr-home-v3 .tr-hero-in {
    padding-bottom: 28px !important;
  }

  body.tr-home-v3 :where(.tr-card, .tr-panel, .tr-step, .tr-spec, .tr-tips) {
    padding-inline: 16px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body > header.site .home-unified-brand > .mono {
    transition: none;
  }
}
