/* ==========================================================
   TOPHARMA — Cabeçalho, Hero, Showcase e Faixa Editorial
   ========================================================== */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px var(--gutter);
  border-bottom: 1px solid transparent;
  transition: padding .35s var(--ease), background-color .35s, border-color .35s, transform .4s var(--ease);
}
.nav.is-scrolled {
  padding-top: 10px;
  padding-bottom: 10px;
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border-color: var(--line);
}
.nav.is-hidden { transform: translateY(-100%); }

.nav__logo { display: flex; align-items: center; gap: 12px; }
.nav__word {
  font-family: var(--f-display);
  font-weight: 800;
  letter-spacing: .14em;
  font-size: 16px;
  line-height: 1.15;
}
/* Piso legível ≥ 11px (corrige undersized-ui-text de 9.92px) */
.nav__word b {
  display: block;
  white-space: nowrap;
  color: var(--gold);
  font-size: 11px;
  letter-spacing: .14em;
  font-weight: 800;
  margin-top: 2px;
}

.nav__links { display: flex; gap: 30px; }
.nav__links a {
  position: relative;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--muted);
  padding: 6px 0;
  transition: color .25s;
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1.5px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .3s var(--ease);
}
.nav__links a:hover,
.nav__links a.is-active { color: var(--fg); }
.nav__links a:hover::after,
.nav__links a.is-active::after { transform: scaleX(1); transform-origin: left; }

.nav__actions { display: flex; align-items: center; gap: 12px; }

/* Seletor de idioma com área touch confortável (≥ 40px) e sem glow colorido */
.lang {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: calc(var(--r-btn) + 3px);
  border: 1px solid var(--line-strong);
  background: var(--card);
}
.lang__btn {
  --tip-gap: 12px;
  position: relative;
  display: grid;
  place-items: center;
  min-width: 38px;
  min-height: 34px;
  padding: 5px;
  border-radius: calc(var(--r-btn) - 2px);
  border: 1px solid transparent;
  transition: border-color .25s, background-color .25s;
}
.lang__btn .flag {
  width: 26px;
  height: 18px;
  border-radius: 3px;
  overflow: hidden;
  opacity: .62;
  filter: saturate(.7);
  transition: opacity .25s, filter .25s;
}
.lang__btn:hover .flag,
.lang__btn:focus-visible .flag { opacity: .95; filter: none; }
.lang__btn.is-active {
  border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 12%, transparent);
}
.lang__btn.is-active .flag { opacity: 1; filter: none; }

/* Alternador de tema sem glow colorido no knob */
.theme-toggle { position: relative; display: inline-flex; align-items: center; padding: 0; min-height: 40px; }
.theme-toggle__track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 64px;
  height: 34px;
  padding: 0 8px;
  border-radius: calc(var(--r-btn) + 3px);
  border: 1px solid var(--line-strong);
  background: var(--card);
  transition: border-color .25s;
}
.theme-toggle:hover .theme-toggle__track { border-color: var(--gold); }
.theme-toggle svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
  position: relative;
  z-index: 1;
}
.theme-toggle__knob {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: var(--gold);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
  transition: transform .36s var(--ease);
}
:root[data-theme="dark"] .theme-toggle__knob { transform: translateX(30px); }
:root[data-theme="dark"] .ico-moon,
:root[data-theme="light"] .ico-sun { stroke: var(--gold-ink); }

/* Tooltip compartilhado dos controles do cabeçalho */
.nav-tip {
  position: absolute;
  top: calc(100% + var(--tip-gap, 10px));
  left: 50%;
  z-index: 120;
  padding: 7px 12px;
  border-radius: var(--r-btn);
  border: 1px solid var(--line-strong);
  background: var(--bg-2);
  color: var(--fg);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -4px);
  transition: opacity .2s var(--ease), transform .2s var(--ease), visibility .2s;
}
:is(.lang__btn, .theme-toggle):focus-visible .nav-tip {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}
@media (hover: hover) and (pointer: fine) {
  :is(.lang__btn, .theme-toggle):hover .nav-tip {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
  }
}

.nav__burger { display: none; width: 44px; height: 44px; position: relative; border-radius: var(--r-btn); }
.nav__burger i {
  position: absolute;
  left: 11px;
  right: 11px;
  height: 1.8px;
  background: var(--fg);
  transition: transform .35s var(--ease);
}
.nav__burger i:first-child { top: 17px; }
.nav__burger i:last-child { top: 25px; }
.nav.is-open .nav__burger i:first-child { transform: translateY(4px) rotate(45deg); }
.nav.is-open .nav__burger i:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ==========================================================
   HERO
   ========================================================== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 116px var(--gutter) 40px;
  overflow: hidden;
  isolation: isolate;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  background: var(--bg);
  opacity: var(--dim, 0);
  pointer-events: none;
}
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero__flag { position: absolute; left: 0; top: 0; width: min(66vw, 1180px); height: 100%; z-index: -1; pointer-events: none; }
.hero__flag--flat {
  opacity: .4;
  -webkit-mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, .5) 40%, transparent 95%);
  mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, .5) 40%, transparent 95%);
}

/* Selo "100% Original" com tipografia legível ≥ 11px */
.hud {
  position: absolute;
  z-index: 3;
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-btn);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.hud--tr {
  top: 96px;
  right: var(--gutter);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
}
.hud__info { display: flex; flex-direction: column; gap: 4px; }
.hud__info small { display: block; max-width: 164px; font-size: 12px; line-height: 1.38; color: var(--fg); font-weight: 600; }
.ring { position: relative; width: 64px; height: 64px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 2.2; }
.ring__bg { stroke: var(--line); }
.ring__fg {
  stroke: var(--gold);
  stroke-linecap: round;
  stroke-dasharray: 276.5;
  stroke-dashoffset: 276.5;
  transition: stroke-dashoffset 1.8s var(--ease);
}
.ring__label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring__label b { font-family: var(--f-display); font-size: 16px; color: var(--fg); letter-spacing: 0; line-height: 1; }
.ring__label small { font-size: 10.5px; letter-spacing: .04em; color: var(--gold); margin-top: 2px; font-weight: 700; }

.hero__inner {
  width: min(1240px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: 40px;
}
.hero__title {
  margin: 0 0 20px;
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(50px, 6.2vw, 90px);
  line-height: .9;
  letter-spacing: -.02em;
}
.hero__title .line { display: block; overflow: hidden; padding-bottom: .05em; }
.hero__title .word { display: inline-block; transform: translateY(110%); transition: transform 1s var(--ease); }
.hero__title .line:nth-child(2) .word { transition-delay: .08s; }
.hero__title .line--sub {
  font-size: .58em;
  line-height: 1.05;
  letter-spacing: 0;
  white-space: nowrap;
  margin-top: .18em;
}
.hero__series {
  font-size: .56em;
  font-weight: 700;
  letter-spacing: .26em;
  margin-left: .18em;
  color: var(--muted);
}
.hero__title .line--sub .gold-text { letter-spacing: .1em; }
body.is-ready .hero__title .word { transform: none; }

.hero__tag {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--fg);
}
.hero__tag span { color: var(--gold); }
.hero__lead {
  max-width: 480px;
  margin: 0 0 32px;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.65;
  color: color-mix(in srgb, var(--fg) 88%, transparent);
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; }

/* Palco do produto */
.hero__stage {
  position: relative;
  height: clamp(360px, 50vw, 560px);
  display: grid;
  place-items: center;
  perspective: 1400px;
  touch-action: pan-y;
  user-select: none;
  container-type: inline-size;
}

.showcase {
  --pw: min(560px, 94cqw);
  --ease-swap: cubic-bezier(.77, 0, .18, 1);
  --t-swap: .55s;
  --mx: 0;
  --my: 0;
  --float: 0;
  position: relative;
  width: var(--pw);
  aspect-ratio: 1220 / 952;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  transform:
    translate3d(calc(var(--mx) * 6px), calc(var(--my) * 4px + var(--float) * -4px), 0)
    rotateY(calc(var(--mx) * 6deg))
    rotateX(calc(var(--my) * -4deg));
}
.showcase::before {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: -4%;
  height: 12%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 0, 0, .52), rgba(0, 0, 0, .16) 52%, transparent 72%);
}
.showcase__img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.showcase__img--front {
  clip-path: polygon(-30% -10%, 150% -10%, 150% 110%, -50% 110%);
  transition: clip-path var(--t-swap) var(--ease-swap);
}
.showcase__img--back {
  clip-path: polygon(-50% -10%, -30% -10%, -50% 110%, -50% 110%);
  transition: clip-path var(--t-swap) var(--ease-swap);
}
.showcase.is-back .showcase__img--front { clip-path: polygon(130% -10%, 150% -10%, 150% 110%, 110% 110%); }
.showcase.is-back .showcase__img--back { clip-path: polygon(-50% -10%, 130% -10%, 110% 110%, -50% 110%); }
.showcase__edge {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask: url("../assets/web/durateston-front.webp") 0 0 / 100% 100% no-repeat;
  mask: url("../assets/web/durateston-front.webp") 0 0 / 100% 100% no-repeat;
}
.showcase__edge::before {
  content: "";
  position: absolute;
  top: -10%;
  bottom: -10%;
  left: -48%;
  width: 16%;
  background: linear-gradient(90deg, transparent, rgba(255, 232, 160, .14) 30%, rgba(255, 246, 214, .75) 50%, rgba(255, 232, 160, .14) 70%, transparent);
  transform: skewX(-11deg);
  transition: left var(--t-swap) var(--ease-swap);
}
.showcase.is-back .showcase__edge::before { left: 112%; }
.showcase:focus-visible { outline: 2px solid var(--gold); outline-offset: 8px; border-radius: var(--r-card); }

.hero__features {
  width: min(1240px, 100%);
  margin: 46px auto 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
}
.feat {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 18px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  line-height: 1.45;
  border-right: 1px solid var(--line);
  transition: background-color .3s;
}
.feat:last-child { border-right: 0; }
.feat:hover { background: var(--card); }
.feat svg {
  flex: none;
  width: 36px;
  height: 36px;
  padding: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.6;
}

/* Faixa editorial estática (substitui marquee contínuo) */
.editorial-strip {
  border-block: 1px solid var(--line);
  background: var(--bg-2);
  padding: 22px 0;
}
.editorial-strip__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  text-align: center;
}
.editorial-strip__list li {
  font-family: var(--f-display);
  font-size: clamp(14px, 1.5vw, 18px);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg);
}
.editorial-strip__list li::before {
  content: "✦ ";
  color: var(--gold);
  font-size: 12px;
}

@media (max-width: 900px) {
  .hud--tr { display: none; }
  /* Menu mobile inacessível ao Tab quando fechado (visibility: hidden + inert via JS) */
  .nav__links {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 99;
    flex-direction: column;
    gap: 0;
    padding: 88px var(--gutter) 28px;
    background: var(--bg);
    border-bottom: 1px solid var(--line-strong);
    transform: translateY(-105%);
    visibility: hidden;
    transition: transform .45s var(--ease), visibility 0s linear .45s;
  }
  .nav__links a {
    padding: 16px 0;
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 22px;
    color: var(--fg);
    border-bottom: 1px solid var(--line);
  }
  .nav__links a::after { display: none; }
  .nav.is-open .nav__links {
    transform: none;
    visibility: visible;
    transition: transform .45s var(--ease), visibility 0s linear 0s;
  }
  .nav__burger { display: block; }
  .nav__actions .btn { display: none; }

  .hero { padding-top: 96px; }
  .hero__flag { width: 100%; height: 500px; }
  .hero__inner { grid-template-columns: 1fr; gap: 16px; }
  .hero__stage { height: 360px; order: -1; }
  .hero__features { grid-template-columns: repeat(2, 1fr); }
  .feat:nth-child(2) { border-right: 0; }
  .feat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .editorial-strip__list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .hero__stage { height: 310px; }
  .hero__tag { letter-spacing: .18em; font-size: 12px; }
  .hero__cta .btn { flex: 1 1 auto; }
  .nav__word { font-size: 14px; }
  .nav__actions { gap: 8px; }
  /* Mantém área clicável ≥ 38×34px no mobile (WCAG 2.5.8 ≥ 24px!) */
  .lang__btn { min-width: 38px; min-height: 36px; }
  .editorial-strip__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .nav__word { display: none; }
}
