/* ============================================================
   IDEL — modern.css
   Camada de modernização sobre o style.css existente.
   Refina paleta, adiciona page-hero editorial, índice
   interativo (scrollspy), parallax sutil e transições suaves.
   Movimento discreto — respeita prefers-reduced-motion.
   ============================================================ */

:root {
  /* Paleta refinada — mantém o marfim/dourado, com um tom de
     tinta profunda (ink) para numerais editoriais e trilha. */
  --ink:        #0a0a0a;
  --ink-soft:   #2e2e2e;
  --accent:     #1a1a1a;
  --accent-2:   #444444;
  --line:       #e0e0e0;
  --paper:      #ffffff;
  --paper-2:    #f4f4f4;
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
}

/* micro-tipografia tech: eyebrows e numerais em mono */
.page-tratamentos .eyebrow,
.page-modern .eyebrow,
.page-hero-editorial .kicker .num,
.page-hero-editorial .kicker .label,
.tx-rail .rail-title,
.tx-rail .r-num {
  font-family: var(--mono);
  font-weight: 500;
}
.page-tratamentos .eyebrow,
.page-modern .eyebrow { letter-spacing: 0.16em; font-size: 0.74rem; }

/* ── Barra de progresso de leitura ──────────────────────────── */
.read-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, #222, #666);
  z-index: 1100;
  transition: width 0.1s linear;
  pointer-events: none;
  box-shadow: 0 0 12px rgba(0,0,0,0.18);
}

/* ── Cursor de brilho global (blend) ────────────────────────── */
.cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.25);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1200;
  transition: width 0.25s var(--ease), height 0.25s var(--ease), background 0.25s var(--ease), opacity 0.3s ease;
  opacity: 0;
  mix-blend-mode: multiply;
}
.cursor-glow.on { opacity: 1; }
.cursor-glow.big { width: 64px; height: 64px; background: rgba(0,0,0,0.05); }

/* ── Page-hero editorial ────────────────────────────────────── */
.page-hero-editorial {
  position: relative;
  min-height: 34vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: calc(var(--nav-h) + 1.5rem) 0 2.5rem;
  background:
    linear-gradient(165deg, #ffffff 0%, #f4f4f4 100%);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

/* numeral fantasma gigante no fundo — removido a pedido */
.page-hero-editorial .ghost-index { display: none; }

.page-hero-editorial .container { position: relative; z-index: 2; container-type: inline-size; }

.page-hero-editorial .kicker {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.6rem;
}
.page-hero-editorial .kicker .num {
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  color: var(--accent);
}
.page-hero-editorial .kicker .label {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.page-hero-editorial .kicker .rule {
  flex: 1;
  height: 1px;
  max-width: 120px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.page-hero-editorial h1 {
  font-weight: 400;
  color: var(--ink);
  max-width: 900px;
  font-size: clamp(2.2rem, 7cqi, 3.6rem);
  line-height: 1.14;
}

.page-hero-editorial .lede {
  margin-top: 1.8rem;
  max-width: 54ch;
  font-size: 1.02rem;
  font-weight: 300;
  line-height: 1.85;
  color: var(--ink-soft);
}

/* revelação por linha do h1 */
.reveal-line { overflow: hidden; display: block; }
.reveal-line > span {
  display: block;
  transform: translateY(105%);
  transition: transform 1.05s var(--ease);
}
.is-revealed .reveal-line > span { transform: translateY(0); }
.is-revealed .reveal-line:nth-child(2) > span { transition-delay: 0.08s; }
.is-revealed .reveal-line:nth-child(3) > span { transition-delay: 0.16s; }

/* fade suave para kicker e lede */
.fade-rise {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
.is-revealed .fade-rise    { opacity: 1; transform: none; }
.is-revealed .fade-rise.d1 { transition-delay: 0.25s; }
.is-revealed .fade-rise.d2 { transition-delay: 0.38s; }

/* hero: elementos sempre visíveis — sem depender de JS ou keyframes */
.page-hero-editorial .fade-rise {
  opacity: 1 !important;
  transform: translateY(0) !important;
  animation: heroFadeRise 0.9s var(--ease, cubic-bezier(0.16,1,0.3,1)) both;
}
.page-hero-editorial .fade-rise.d1 { animation-delay: 0.22s; }
.page-hero-editorial .fade-rise.d2 { animation-delay: 0.38s; }
.page-hero-editorial .kicker.fade-rise { animation-delay: 0.05s; }

.page-hero-editorial .reveal-line > span {
  transform: translateY(0) !important;
  animation: heroLineReveal 1.05s var(--ease, cubic-bezier(0.16,1,0.3,1)) both;
}
.page-hero-editorial .reveal-line:nth-child(2) > span { animation-delay: 0.10s; }
.page-hero-editorial .reveal-line:nth-child(3) > span { animation-delay: 0.20s; }

@keyframes heroFadeRise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes heroLineReveal {
  from { transform: translateY(105%); }
  to   { transform: translateY(0); }
}

/* ── Índice interativo de tratamentos ───────────────────────── */
.tx {
  position: relative;
  /* fundo contínuo — sem cortes secos entre seções */
  background: linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 45%, var(--paper) 100%);
  padding: 5.5rem 0 6rem;
}

.tx-intro {
  max-width: 640px;
  margin: 0 auto 4.5rem;
  text-align: center;
}
.tx-intro p {
  font-size: 1.05rem;
  font-weight: 300;
  line-height: 1.9;
  color: var(--ink-soft);
}

.tx-layout {
  display: grid;
  grid-template-columns: 248px 1fr;
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: start;
}

/* Trilha lateral fixa */
.tx-rail {
  position: sticky;
  top: calc(var(--nav-h) + 3rem);
  align-self: start;
}
.tx-rail .rail-title {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1.6rem;
  padding-left: 1.25rem;
}
.tx-rail ol { list-style: none; margin: 0; padding: 0; position: relative; }
.tx-rail li { position: relative; }

/* trilho-base + preenchimento de progresso */
.tx-rail ol::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 1px;
  background: var(--line);
}
.tx-rail .rail-fill {
  position: absolute;
  left: -0.5px; top: 0;
  width: 2px; height: 0;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  z-index: 2;
  box-shadow: 0 0 10px rgba(0,0,0,0.18);
  transition: height 0.18s linear;
}

.tx-rail a {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  padding: 0.62rem 0 0.62rem 1.25rem;
  color: var(--ink-soft);
  transition: color 0.4s var(--ease);
}
.tx-rail a .r-num {
  font-size: 0.74rem;
  color: var(--accent);
  opacity: 0.55;
  transition: opacity 0.4s var(--ease);
  min-width: 1.8em;
}
.tx-rail a .r-label {
  font-family: var(--sans);
  font-size: 0.84rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.4;
  transition: transform 0.4s var(--ease);
}

/* indicador ativo removido — apenas a linha de progresso (.rail-fill) marca a posição */
.tx-rail li.active a { color: var(--ink); }
.tx-rail li.active a .r-num { opacity: 1; }
.tx-rail li.active a .r-label { transform: translateX(3px); }
.tx-rail a:hover { color: var(--ink); }

/* Conteúdo */
.tx-content { position: relative; }

.tx-block {
  position: relative;
  padding: 2.5rem 0 5.5rem;
  scroll-margin-top: calc(var(--nav-h) + 2rem);
}
.tx-block:last-child { padding-bottom: 1rem; }
.tx-block + .tx-block { border-top: 1px solid var(--line); padding-top: 4.5rem; }

/* numeral fantasma que faz parallax */
.tx-block .block-ghost {
  position: absolute;
  top: 0.5rem; right: 0;
  font-family: var(--serif);
  font-size: clamp(7rem, 16vw, 13rem);
  line-height: 0.8;
  font-weight: 300;
  color: transparent;
  -webkit-text-stroke: 1px rgba(185,147,90,0.13);
  text-stroke: 1px rgba(185,147,90,0.13);
  pointer-events: none;
  user-select: none;
  z-index: 0;
  will-change: transform;
}

.tx-block .block-head {
  position: relative;
  z-index: 2;
  max-width: 620px;
  margin-bottom: 2.5rem;
  padding-bottom: 0.5rem;
  container-type: inline-size;
}
.tx-block .block-head h2 { font-size: clamp(1.5rem, 7.2cqi, 2.4rem); }
.tx-block .block-head .eyebrow { display: block; margin-bottom: 0.8rem; }
.tx-block .block-head h2 { margin-bottom: 1rem; color: var(--ink); }
.tx-block .block-head p { color: var(--ink-soft); font-size: 0.95rem; line-height: 1.85; }

.tx-block .treatment-grid { position: relative; z-index: 1; }

/* card refinado */
.tx-block .procedure-card {
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(4px);
  border: 1px solid var(--line);
  border-top: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
}
.tx-block .procedure-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, #222, #666);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease);
  z-index: 3;
}
.tx-block .procedure-card:hover::before { transform: scaleX(1); }
.tx-block .procedure-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), rgba(185,147,90,0.16), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
  z-index: 0;
}
.tx-block .procedure-card:hover::after { opacity: 1; }
.tx-block .procedure-card > * { position: relative; z-index: 1; }
.tx-block .procedure-card:hover {
  box-shadow: 0 30px 70px rgba(32,33,28,0.13);
  border-color: rgba(185,147,90,0.4);
}

/* ── Animação de entrada dos blocos (sutil) ─────────────────── */
.tx-block .block-head {
  opacity: 0; /* animate.css takes over on .in */
}
.tx-block .procedure-card {
  clip-path: inset(0 0 110% 0);
  transition: clip-path 0.9s var(--ease),
              box-shadow var(--transition), border-color var(--transition);
}
.tx-block.in .procedure-card { clip-path: inset(0 0 0% 0); }

/* ── CTA de fechamento ──────────────────────────────────────── */
.tx-cta {
  position: relative;
  text-align: center;
  padding: 6.5rem 0;
  background: linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
  border-top: 1px solid var(--line);
}

/* botão magnético */
.magnetic { display: inline-block; transition: transform 0.25s var(--ease); will-change: transform; }

/* ── Vídeo de fundo — fumaça dourada ─────────────────────── */
#idel-bg-video {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  object-fit: cover;
  object-position: center;
}

/* Layout acima do canvas de feixes */
body { background: var(--bg); }
section,
header.page-hero-editorial,
footer { position: relative; z-index: 1; }

/* Seções com fundo sólido — texto sempre legível */
section         { background: var(--bg); }
.section-alt    { background: linear-gradient(135deg, var(--bg-alt) 0%, #e4dfd9 50%, var(--bg-alt) 100%) !important; }

/* Hero e seção de tratamentos: fundo transparente — feixes visíveis */
header.page-hero-editorial { background: rgba(241,237,232,0.30); }
.tx                        { background: rgba(241,237,232,0.45) !important; }

/* Rodapé mantém o estilo original escuro */
footer { /* sem override de background — usa o #0c0a07 do style.css */ }

#nav, .mobile-menu { position: fixed !important; z-index: 1000 !important; }
.read-progress     { position: fixed; z-index: 999; }

/* Texto sempre legível */
header.page-hero-editorial h1,
header.page-hero-editorial .lede,
section h2, section h3,
.block-head h2 { color: var(--ink) !important; }
section p, section li,
.block-head p  { color: var(--ink-soft) !important; }
.procedure-card { background: rgba(255,255,255,0.78) !important; backdrop-filter: blur(4px); }

/* CTA integrado ao .tx — continuação do mesmo shader */
.tx-cta-inner {
  text-align: center;
  padding: 4rem 0 2rem;
  border-top: 1px solid rgba(42,40,39,0.14);
  position: relative;
  z-index: 1;
}
.tx-cta-inner h2 { color: var(--ink); }
.tx-cta-inner p { color: var(--ink-soft); }

/* Texto mais forte sobre o fundo dourado */
.tx .block-head h2 { color: var(--ink); font-weight: 400; }
.tx .block-head p  { color: var(--ink); font-weight: 400; font-size: 0.97rem; }
.tx-block .procedure-card h4,
.tx .procedure-card h4 {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
}
.tx .procedure-card p  { color: var(--ink); font-weight: 400; font-size: 0.88rem; }

/* ── Hover glow nos cards genéricos (.card) ──────────────── */
.card {
  position: relative;
  overflow: hidden;
}
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), rgba(0,0,0,0.06), transparent 65%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
  z-index: 0;
  border-radius: inherit;
}
.card:hover::after { opacity: 1; }
.card > * { position: relative; z-index: 1; }

.block-head {
  position: relative;
  padding: 1.6rem 1.8rem;
  border-radius: 8px;
  background: rgba(255,255,255,0.62);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.55);
  box-shadow: 0 4px 32px rgba(0,0,0,0.06);
  max-width: 580px;
}

/* ── Legibilidade CTA final sobre o vídeo de fundo ────────── */
.tx-cta-inner .section-header {
  position: relative;
  padding: 2rem 2.2rem;
  border-radius: 8px;
  background: rgba(255,255,255,0.62);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.55);
  box-shadow: 0 4px 32px rgba(0,0,0,0.06);
  max-width: 640px;
  margin: 0 auto;
}
.tx-block .procedure-card {
  clip-path: inset(0 0 110% 0);
  transition: opacity 0.85s var(--ease), transform 0.85s var(--ease),
              clip-path 0.9s var(--ease),
              box-shadow var(--transition), border-color var(--transition);
}
.tx-block.in .procedure-card { clip-path: inset(0 0 0% 0); }

@media (max-width: 900px) {
  .tx-layout { grid-template-columns: 1fr; gap: 0; }
  .tx-rail { display: none; }
  .tx-block .block-ghost { font-size: clamp(5rem, 22vw, 8rem); opacity: 0.8; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal-line > span,
  .fade-rise,
  .tx-block .block-head,
  .tx-block .procedure-card { transition: none !important; transform: none !important; opacity: 1 !important; }
  .page-hero-editorial .ghost-index,
  .tx-block .block-ghost { will-change: auto; }
  .cursor-glow { display: none; }
  .tx-block .block-head { position: static; }
}
