/* Home v2 — mais movimento, com propósito:
   o filme da Polisul no hero, mercado em tempo real, marcas em rolagem horizontal,
   manifesto que acende com a leitura. Tudo amarrado à rolagem, nada em loop sem motivo. */

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:root { --up: #3f7d3a; --down: #b0452e; }

/* ---------- 00 · Hero com vídeo, fixado e recuando para uma moldura ---------- */

.hero--v2 { height: 175svh; min-height: 0; display: block; background: var(--paper); overflow: visible; }
.hv2__pin {
  position: sticky; top: 0; height: 100svh; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.hv2__frame { position: absolute; inset: 0; z-index: -2; isolation: isolate; background: var(--soil); will-change: clip-path; }
.hv2__frame .hero__media { z-index: -3; }
.hv2__video { position: absolute; inset: 0; z-index: -2; overflow: hidden; opacity: 0; transition: opacity 1400ms ease; pointer-events: none; }
.hv2__video.is-ready { opacity: 1; }
.hv2__video iframe {
  position: absolute; top: 50%; left: 50%; border: 0;
  width: max(100%, 177.78svh); height: max(100%, 56.25vw);
  transform: translate(-50%, -50%) scale(1.18);
}
.hero--v2 .hero__shade {
  background:
    linear-gradient(180deg, rgba(20, 18, 13, 0.5) 0%, rgba(20, 18, 13, 0) 24%),
    linear-gradient(0deg, rgba(20, 18, 13, 0.86) 0%, rgba(20, 18, 13, 0.2) 50%, rgba(20, 18, 13, 0) 72%);
}
.hv2__body { padding-bottom: clamp(72px, 9vh, 104px); will-change: transform, opacity; }
.hv2__body .eyebrow { color: rgba(239, 233, 220, 0.72); }

.hv2__ctrl { position: absolute; z-index: 2; right: var(--gutter); top: calc(var(--header-h) + 18px); display: flex; gap: 8px; }
.hv2__btn {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 12px; border-radius: 999px;
  background: rgba(20, 18, 13, 0.42); color: var(--on-soil); font-size: 13px; font-weight: 500;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 1px rgba(239, 233, 220, 0.18);
  transition: transform 160ms var(--ease-out), background-color 200ms ease;
}
.hv2__btn:active { transform: scale(0.96); }
.hv2__btn svg { width: 14px; height: 14px; }
.hv2__btn .i-play, .hv2__btn[aria-pressed="true"] .i-pause { display: none; }
.hv2__btn[aria-pressed="true"] .i-play { display: block; }
.hv2__btn[data-video="sound"] .wave { opacity: 0.35; transition: opacity 200ms ease; }
.hv2__btn[data-video="sound"][aria-pressed="true"] .wave { opacity: 1; }
@media (hover: hover) and (pointer: fine) { .hv2__btn:hover { background: rgba(20, 18, 13, 0.62); } }

.hv2__scroll {
  position: absolute; left: var(--gutter); bottom: 24px; z-index: 1; margin: 0;
  display: flex; align-items: center; gap: 12px; color: rgba(239, 233, 220, 0.6); font-size: 11px;
}
.hv2__scroll span { position: relative; width: 1px; height: 28px; background: rgba(239, 233, 220, 0.2); overflow: hidden; }
.hv2__scroll span::after { content: ""; position: absolute; inset: 0; background: var(--wheat-hi); transform: translateY(-100%); animation: drip 2.2s var(--ease-in-out) infinite 1.6s; }
@keyframes drip { 0% { transform: translateY(-100%); } 55% { transform: translateY(0); } 100% { transform: translateY(100%); } }

/* ---------- 01 · Faixa de mercado ---------- */

.ticker { display: block; min-height: 58px; position: relative; z-index: 1; background: var(--soil); color: var(--on-soil); overflow: hidden; border-bottom: 1px solid var(--soil-line); }
.ticker__track { display: flex; width: max-content; animation: tick 70s linear infinite; }
.ticker__group { display: flex; }
.ticker__item { display: inline-flex; align-items: center; gap: 10px; height: 58px; padding: 0 26px; border-right: 1px solid var(--soil-line); white-space: nowrap; font-size: 15px; }
.ticker__item .n { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--on-soil-muted); }
.ticker__item .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.ticker__item .c { font-family: var(--mono); font-size: 12px; }
.ticker__item .c.up { color: #8fc27f; }
.ticker__item .c.down { color: #e3866f; }
.ticker__item .u { color: var(--on-soil-muted); font-size: 12px; }
.ticker__mark { width: 22px; height: 10px; background: var(--wheat); -webkit-mask: url("img/slashes.svg") center / contain no-repeat; mask: url("img/slashes.svg") center / contain no-repeat; }
.ticker:hover .ticker__track, .ticker:focus-visible .ticker__track { animation-play-state: paused; }
@keyframes tick { to { transform: translateX(-50%); } }

/* ---------- 02 · Manifesto ---------- */

.mf2__title { font-size: clamp(56px, 9.6vw, 168px); max-width: 16ch; }
.mf2__title em { font-style: normal; color: var(--wheat-ink); }
.js .mf2__title .w { opacity: 0.14; transition: opacity 260ms ease; }
.js .mf2__title .w.on { opacity: 1; }
.mf2__body { margin: clamp(40px, 5vw, 72px) 0 0 auto; width: min(100%, 560px); font-size: clamp(17px, 1.35vw, 20px); }
.mf2__body p { color: var(--ink-2); }
.mf2__stats { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: clamp(64px, 9vw, 128px); border-top: 1px solid var(--line-2); }
.mf2__stats > div { padding: 22px 24px 0 0; }
.mf2__stats > div + div { padding-left: 24px; border-left: 1px solid var(--line-2); }
.mf2__stats strong { display: block; font-weight: 800; font-stretch: 68%; font-size: clamp(64px, 7.4vw, 128px); line-height: 0.85; font-variant-numeric: tabular-nums; margin-bottom: 14px; }
.mf2__stats span { color: var(--muted); font-size: 15px; display: block; max-width: 22ch; }

/* ---------- 03 · Marcas em rolagem horizontal ---------- */

.hz { position: relative; background: var(--soil); color: var(--on-soil); height: var(--hz-h, 320vh); }
.hz__pin { position: sticky; top: 0; height: 100svh; overflow: hidden; display: flex; align-items: center; }
.hz__track { display: flex; gap: 20px; padding: 0 var(--gutter); height: min(76svh, 760px); will-change: transform; }
.hz__intro { flex: 0 0 min(36vw, 520px); display: flex; flex-direction: column; justify-content: flex-end; padding-right: 3vw; }
.hz__intro h2 { font-size: clamp(52px, 6.4vw, 112px); }
.hz__hint { margin: 32px 0 0; color: var(--on-soil-muted); display: flex; gap: 10px; align-items: center; }
.hz__hint span { display: inline-block; animation: nudge 1.8s var(--ease-in-out) infinite; }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(6px); } }

.hz__panel { position: relative; flex: 0 0 min(74vw, 1120px); display: grid; grid-template-columns: 1.55fr 1fr; background: var(--soil-2); border-radius: 6px; overflow: hidden; }
.hz__img { position: relative; overflow: hidden; }
.hz__img img { position: absolute; top: 0; left: -8%; width: 116%; height: 100%; object-fit: cover; will-change: transform; transition: scale 900ms var(--ease-out); }
.hz__cap { display: flex; flex-direction: column; gap: 14px; padding: clamp(24px, 2.6vw, 40px); }
.hz__num { color: var(--on-soil-muted); margin-bottom: auto; }
.hz__logo { height: 30px; width: auto; align-self: flex-start; margin-bottom: 10px; }
.hz__cap h3 { margin: 0; font-size: clamp(22px, 1.9vw, 30px); line-height: 1.15; font-weight: 600; text-wrap: balance; }
.hz__cap p { margin: 0; color: var(--on-soil-muted); font-size: 15.5px; }
.hz__cap .link { margin-top: 10px; align-self: flex-start; color: var(--wheat-hi); }
@media (hover: hover) and (pointer: fine) { .hz__panel:hover .hz__img img { scale: 1.04; } }

.hz__bar { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 28px; height: 1px; background: var(--soil-line); }
.hz__bar span { position: absolute; inset: 0; background: var(--wheat); transform-origin: left; transform: scaleX(var(--p, 0)); }

/* Sem fixação (celular, movimento reduzido): carrossel nativo */
.hz.is-static { height: auto; }
.hz.is-static .hz__pin { position: static; height: auto; padding: clamp(80px, 12vw, 140px) 0; }
.hz.is-static .hz__track { scroll-padding-inline: var(--gutter); height: auto; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; transform: none !important; }
.hz.is-static .hz__track::-webkit-scrollbar { display: none; }
.hz.is-static .hz__track > * { scroll-snap-align: start; }
.hz.is-static .hz__bar, .hz.is-static .hz__hint span { display: none; }

/* ---------- Pessoas com parallax ---------- */
.people img[data-parallax] { top: -12%; height: 124%; will-change: transform; }

/* ---------- Trilho arrastável ---------- */
.rail[data-drag] { cursor: grab; }
.rail.is-drag { cursor: grabbing; scroll-snap-type: none; }
.rail.is-drag a { pointer-events: none; }

/* ---------- 08 · Mercado e campo ---------- */

.mk { background: var(--paper-2); }
.mk__grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
.mk__card { background: var(--paper); border-radius: 6px; padding: clamp(20px, 2.4vw, 34px); box-shadow: 0 0 0 1px var(--line); min-width: 0; }
.mk__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 22px; }
.mk__head h3 { margin: 0; color: var(--muted); font-weight: 400; font-size: 12px; }
.mk__live { display: inline-flex; align-items: center; gap: 8px; color: var(--up); font-size: 11px; }
.mk__live i { position: relative; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.mk__live i::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: currentColor; animation: ping 2.4s var(--ease-out) infinite; }
@keyframes ping { 0% { transform: scale(1); opacity: 0.6; } 80%, 100% { transform: scale(3.2); opacity: 0; } }
.mk__skel { height: 180px; border-radius: 4px; background: linear-gradient(90deg, var(--paper-2), var(--paper-3), var(--paper-2)) 0 0 / 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.mk__cities { display: flex; width: 100%; overflow-x: auto; scrollbar-width: none; margin-bottom: 26px; }
.mk__cities::-webkit-scrollbar { display: none; }
.mk__cities button { flex: 1 0 auto; padding: 0 14px; font-size: 14px; }

.mk__now { display: grid; grid-template-columns: auto 1fr; gap: 12px 40px; align-items: end; transition: opacity 200ms ease, filter 200ms ease; }
.mk__now.is-swap { opacity: 0; filter: blur(4px); }
.mk__temp { display: flex; align-items: flex-start; gap: 18px; }
.mk__temp strong { font-weight: 800; font-stretch: 68%; font-size: clamp(88px, 9vw, 148px); line-height: 0.8; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.mk__temp svg { width: 56px; height: 56px; color: var(--wheat-ink); margin-top: 4px; }
.mk__cond { grid-column: 1; font-size: 19px; font-weight: 600; margin: 0; }
.mk__meta { grid-column: 2; grid-row: 1 / span 2; margin: 0; display: grid; grid-template-columns: repeat(2, auto); gap: 14px 28px; justify-content: end; align-self: center; }
.mk__meta dt { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.mk__meta dd { margin: 2px 0 0; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }

.mk__days { list-style: none; margin: 30px 0 0; padding: 22px 0 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.mk__days li { min-width: 0; display: grid; justify-items: center; gap: 8px; text-align: center; }
.mk__days .d { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.mk__days svg { width: 28px; height: 28px; color: var(--ink-2); }
.mk__days .t { font-weight: 600; font-variant-numeric: tabular-nums; }
.mk__days .t span { color: var(--muted); font-weight: 400; margin-left: 6px; }
.mk__rain { width: 100%; max-width: 72px; height: 4px; border-radius: 2px; background: var(--paper-3); overflow: hidden; }
.mk__rain i { display: block; height: 100%; background: #4f86b8; transform-origin: left; transform: scaleX(var(--r, 0)); transition: transform 700ms var(--ease-out); }
.mk__days small { font-family: var(--mono); font-size: 11px; color: #3f6f99; }

.fx__val { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.fx__val strong { font-weight: 800; font-stretch: 68%; font-size: clamp(64px, 6vw, 104px); line-height: 0.85; font-variant-numeric: tabular-nums; transition: color 600ms ease; }
.fx__val strong.flash-up { color: var(--up); transition-duration: 0ms; }
.fx__val strong.flash-down { color: var(--down); transition-duration: 0ms; }
.chg { font-family: var(--mono); font-size: 13px; font-weight: 500; }
.chg.up { color: var(--up); }
.chg.down { color: var(--down); }
.chg.flat { color: var(--muted); }
.fx__range { display: flex; gap: 24px; margin: 18px 0 0; color: var(--muted); font-size: 14px; }
.fx__range b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.fx__spark { margin-top: 22px; }
.fx__eur { display: flex; justify-content: space-between; align-items: baseline; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.fx__eur b { font-size: 22px; font-variant-numeric: tabular-nums; }
.fx__time { margin: 12px 0 0; color: var(--muted); font-size: 12.5px; }

.spark { display: block; width: 100%; height: auto; overflow: visible; }
.spark .ln { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1100ms var(--ease-in-out); }
.spark .ar { fill: var(--wheat); opacity: 0; transition: opacity 700ms ease 500ms; }
.spark .dot { fill: var(--ink); opacity: 0; transition: opacity 200ms ease 1000ms; }
.is-drawn .spark .ln { stroke-dashoffset: 0; }
.is-drawn .spark .ar { opacity: 0.14; }
.is-drawn .spark .dot { opacity: 1; }

.mk__crops { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.crop { min-width: 0; display: flex; flex-direction: column; gap: 6px; background: var(--paper); border-radius: 6px; padding: 22px; box-shadow: 0 0 0 1px var(--line); }
.crop h3 { margin: 0; font-weight: 800; font-stretch: 68%; text-transform: uppercase; font-size: 34px; line-height: 0.9; }
.crop .ind { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); line-height: 1.4; min-height: 2.8em; }
.crop .val { flex-wrap: wrap; display: flex; align-items: baseline; gap: 8px; margin-top: 14px; }
.crop .val strong { font-size: 30px; font-weight: 700; font-stretch: 85%; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.crop .unit { color: var(--muted); font-size: 12.5px; }
.crop .spark { margin: 12px 0 4px; }
.crop ul { list-style: none; margin: auto 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); display: grid; gap: 6px; font-size: 13px; }
.crop li { min-width: 0; display: flex; justify-content: space-between; gap: 10px; }
.crop li span:first-child { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crop li b { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.crop .date { font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-top: 10px; }
.mk__note { margin: 22px 0 0; color: var(--muted); font-size: 13px; max-width: 90ch; }
.mk__err { color: var(--muted); font-size: 15px; margin: 0; }

/* ---------- 11 · CTA final ---------- */

.cta2 { padding: clamp(72px, 9vw, 128px) 0 clamp(72px, 9vw, 120px); overflow: hidden; }
.cta2__line {
  display: flex; align-items: center; gap: 3vw; white-space: nowrap; width: max-content; will-change: transform;
  font-weight: 800; font-stretch: 66%; text-transform: uppercase; font-size: clamp(88px, 15vw, 260px); line-height: 0.86;
  color: transparent; -webkit-text-stroke: 1px rgba(239, 233, 220, 0.28);
  margin-bottom: clamp(48px, 6vw, 88px);
}
.cta2__line i { flex: none; width: 0.9em; height: 0.42em; background: var(--wheat); -webkit-mask: url("img/slashes.svg") center / contain no-repeat; mask: url("img/slashes.svg") center / contain no-repeat; }
.cta2__body { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: end; }

/* ---------- Responsivo ---------- */

@media (max-width: 1100px) {
  .mk__grid { grid-template-columns: 1fr; }
  .mk__crops { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mf2__stats { grid-template-columns: 1fr 1fr; }
  .mf2__stats > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .mf2__stats > div:nth-child(n + 3) { border-top: 1px solid var(--line-2); margin-top: 22px; }
}

@media (max-width: 760px) {
  .hero--v2 { height: 150svh; }
  .hv2__ctrl { top: auto; bottom: 20px; right: var(--gutter); }
  .hv2__btn span { display: none; }
  .hv2__btn { width: 40px; padding: 0; justify-content: center; }
  .hv2__scroll { display: none; }
  .hv2__body { padding-bottom: 80px; }
  .ticker__item { height: 50px; padding: 0 18px; font-size: 14px; }
  .mf2__stats > div { padding-right: 12px; }
  .mf2__stats > div + div { padding-left: 12px; }
  .mf2__stats span { font-size: 14px; }
  .hz__intro { flex-basis: 78vw; padding-right: 0; justify-content: flex-start; }
  .hz__panel { flex-basis: 84vw; grid-template-columns: 1fr; grid-template-rows: 260px auto; }
  .hz__img img { left: 0; width: 100%; }
  .hz__num { margin-bottom: 8px; }
  .mk__now { grid-template-columns: 1fr; }
  .mk__meta { grid-column: 1; grid-row: auto; justify-content: start; }
  .mk__days { gap: 2px; }
  .mk__days svg { width: 24px; height: 24px; }
  .mk__days .t span { display: block; margin: 0; }
  .mk__days .mm { display: none; }
  .mk__card { padding: 20px 16px; }
  .mk__crops { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .crop { padding: 16px; }
  .crop h3 { font-size: 28px; }
  .crop .val strong { font-size: 24px; }
  .crop ul { font-size: 12px; }
  .crop li { flex-direction: column; gap: 0; }
  .cta2__body { grid-template-columns: 1fr; }
}

/* ---------- Movimento reduzido: nada corre sozinho, nada se move com a rolagem ---------- */

@media (prefers-reduced-motion: reduce) {
  .ticker__track { animation: none; }
  .ticker { overflow-x: auto; }
  .ticker__group + .ticker__group { display: none; }
  .hv2__scroll span::after, .hz__hint span, .mk__live i::after, .mk__skel { animation: none; }
  .js .mf2__title .w { opacity: 1; }
  .spark .ln { transition: none; stroke-dashoffset: 0; }
  .spark .ar { transition: none; opacity: 0.14; }
  .spark .dot { transition: none; opacity: 1; }
  .people img[data-parallax] { top: 0; height: 100%; }
}

/* ---------- Placas: cada seção desliza por cima da anterior ---------- */
.plate { --rad: clamp(20px, 2.6vw, 40px); position: relative; z-index: 1; border-radius: var(--rad) var(--rad) 0 0; margin-top: calc(var(--rad) * -1); }
.plate--paper { background: var(--paper); }
.people.plate { overflow: hidden; }
.footer { position: relative; z-index: 1; }
