/* =========================================================
   SOBRE MIM (#sobre): duas etapas na mesma seção.
     1. .stage   o quadro com a silhueta e "?" + botão "Aperte para conhecer"
     2. .content cena com o nome gigante e o Johny + bio
   O clique abre o quadro ao meio (duas metades clonadas deslizam para os
   lados). Coreografia em js/modules/sobre.js; referência original em
   docs/sobre-mim-standalone-v18.html.

   Tudo escopado em .sobre (classes genéricas como .stage/.frame/.side não
   vazam para o resto do site) e keyframes com prefixo "sobre-".
   ========================================================= */
@layer sections {
  .sobre {
    position: relative;
    min-height: max(100svh, 680px);
    overflow: hidden;
    background: var(--c-green-base);
    /* a seção foi desenhada com Cormorant, creme e entrelinha "normal" */
    font-family: var(--ff-garamond); font-size: 1rem; line-height: normal;
    color: var(--c-cream-warm);
    /* seção de tela cheia: a âncora #sobre alinha no topo, sob o navbar translúcido */
    scroll-margin-top: calc(-1 * (var(--nav-h) + var(--space-md)));
  }

  /* ---------- 1. STAGE (quadro) ---------- */
  /* padding-top = navbar: a composição centraliza na área visível abaixo dele */
  .sobre .stage { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; padding: var(--nav-h) 16px 0; }

  /* metades que deslizam + divisor de luz (criados pelo JS) */
  .sobre .half { position: absolute; left: 0; right: 0; top: 0; z-index: 3; pointer-events: none; will-change: transform; }
  .sobre .half .stage { position: absolute; inset: 0; }
  .sobre .half .edge { position: absolute; top: 0; bottom: 0; width: 60px; pointer-events: none; }
  .sobre .seam {
    position: absolute; left: 50%; top: 0; bottom: 0; z-index: 4; width: 2px; pointer-events: none;
    transform: translateX(-50%) scaleY(0); transform-origin: 50% 0;
    background: linear-gradient(180deg, rgba(255, 244, 214, 0), rgba(255, 244, 214, .9) 20%, rgba(255, 244, 214, .9) 80%, rgba(255, 244, 214, 0));
    box-shadow: 0 0 18px 4px rgba(255, 236, 196, .45);
  }

  .sobre .wall {
    position: absolute; inset: 0; pointer-events: none;
    background: var(--c-green-deep) url(../../img/sobre-parede.jpg) 50% 0 / cover no-repeat;
    background-image: image-set(url(../../img/sobre-parede.webp) type("image/webp"), url(../../img/sobre-parede.jpg) type("image/jpeg"));
  }
  .sobre .vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 80% 75% at 50% 42%, transparent 45%, rgba(8, 20, 14, .45) 100%); }

  .sobre .composition {
    position: relative; display: flex; flex-direction: column; align-items: center;
    gap: clamp(22px, 3.4vh, 36px); padding-block: clamp(16px, 4vh, 48px); perspective: 1200px;
  }

  .sobre .frame {
    position: relative; width: min(60vw, 38svh); max-width: 100%; aspect-ratio: 830 / 1233;
    transform-style: preserve-3d; transition: transform .5s var(--ease-soft);
    filter: drop-shadow(0 34px 28px rgba(0, 0, 0, .55)) drop-shadow(0 6px 6px rgba(0, 0, 0, .4));
    animation: sobre-shadow-float 7s ease-in-out infinite;
  }
  /* flutuação leve: o quadro sobe e desce; a sombra na parede acompanha */
  .sobre .float { animation: sobre-float 7s ease-in-out infinite; will-change: transform; }
  /* fora da tela, pausa (a sombra animada repinta a cada quadro: poupa bateria/CPU) */
  .sobre:not(.is-visible) :is(.float, .frame, .scroll-cue) { animation-play-state: paused; }
  @keyframes sobre-float { 0%, 100% { transform: translateY(0) rotate(-.35deg); } 50% { transform: translateY(-12px) rotate(.35deg); } }
  @keyframes sobre-shadow-float {
    0%, 100% { filter: drop-shadow(0 30px 24px rgba(0, 0, 0, .55)) drop-shadow(0 6px 6px rgba(0, 0, 0, .4)); }
    50%      { filter: drop-shadow(0 46px 34px rgba(0, 0, 0, .42)) drop-shadow(0 10px 10px rgba(0, 0, 0, .3)); }
  }

  /* abertura interna da moldura: left 9.76% · top 6.49% · width 80.48% · height 86.94% */
  .sobre .canvas { position: absolute; left: 9.76%; top: 6.49%; width: 80.48%; height: 86.94%; overflow: hidden; background: #101713; }
  .sobre .canvas img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  .sobre .canvas::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 10px 18px rgba(0, 0, 0, .6), inset 0 0 40px rgba(0, 0, 0, .35); }
  .sobre .glare { position: absolute; inset: 6.49% 19.52% 6.57% 9.76%; pointer-events: none; background: linear-gradient(115deg, transparent 30%, rgba(255, 244, 220, .08) 45%, transparent 60%); mix-blend-mode: screen; }
  .sobre .molding { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
  .sobre .qmark { position: absolute; left: 9.76%; top: 6.49%; width: 80.48%; height: 86.94%; display: grid; place-items: center; pointer-events: none; }
  .sobre .qmark span {
    font-family: var(--ff-garamond); font-weight: 500; line-height: 1; color: var(--c-cream-warm);
    font-size: calc(min(60vw, 38svh) * .52);
    transform: translate(4%, -9%);
    text-shadow: 0 0 30px rgba(241, 234, 216, .35), 0 2px 0 rgba(0, 0, 0, .2);
  }

  .sobre .ask {
    font-family: var(--ff-small); font-size: clamp(13px, 1.1vw, 15px); letter-spacing: .34em; text-transform: uppercase;
    color: var(--c-cream-warm); padding-left: .42em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .85), 0 0 22px rgba(0, 0, 0, .7), 0 0 44px rgba(0, 0, 0, .5);
  }
  .sobre .plaque { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
  .sobre .plaque h2 { font-family: var(--ff-caps); font-weight: 400; font-size: clamp(24px, 3.4vw, 40px); letter-spacing: .2em; padding-left: .2em; }
  .sobre .plaque .rule { width: 56px; height: 1px; margin-top: 4px; background: linear-gradient(90deg, transparent, var(--c-sage-light), transparent); }

  /* ---------- 2. CONTEÚDO REVELADO ---------- */
  .sobre .content { position: relative; z-index: 1; display: none; background: var(--c-green-deep); }
  .sobre .content:focus { outline: none; }          /* recebe foco por script ao abrir o quadro */
  .sobre.revealed .content { display: block; }

  /* cena: nome gigante atrás, Johny à frente */
  .sobre .scene { position: relative; height: clamp(620px, 100svh, 980px); overflow: hidden; isolation: isolate; }
  .sobre .scene-bg {
    position: absolute; inset: -3%; z-index: -3; filter: saturate(.95);
    background:
      radial-gradient(ellipse 36% 50% at 50% 40%, rgba(255, 226, 180, .07), transparent 70%),
      linear-gradient(180deg, rgba(10, 24, 17, .10) 40%, rgba(10, 24, 17, .65)),
      var(--c-green-deep) url(../../img/sobre-cenario.jpg) 50% 40% / cover no-repeat;
    background-image:
      radial-gradient(ellipse 36% 50% at 50% 40%, rgba(255, 226, 180, .07), transparent 70%),
      linear-gradient(180deg, rgba(10, 24, 17, .10) 40%, rgba(10, 24, 17, .65)),
      image-set(url(../../img/sobre-cenario.webp) type("image/webp"), url(../../img/sobre-cenario.jpg) type("image/jpeg"));
  }
  .sobre .scene-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 85% 80% at 50% 45%, transparent 40%, rgba(6, 16, 11, .8) 100%); }

  .sobre .bigname {
    position: absolute; left: 0; right: 0; top: var(--name-top, 31%); z-index: -2;
    display: block; height: 1em; white-space: nowrap; pointer-events: none;
    font-family: var(--ff-condensed); font-weight: 400; line-height: .82; letter-spacing: .005em;
    font-size: min(19.5vw, 300px); color: #efe9da;
    text-shadow: 0 0 38px rgba(241, 234, 216, .28), 0 0 90px rgba(241, 234, 216, .12);
  }
  .sobre .bigname .w { position: absolute; top: 0; display: inline-flex; }
  .sobre .bigname .ch { display: inline-block; }

  .sobre .model {
    position: absolute; left: 50%; bottom: 0; z-index: -1;
    height: 94%; width: auto; max-width: none;
    transform: translateX(-50%);
    /* o esfumado da base (72% → 99%) está no alpha da imagem, não em mask-image:
       no Safari/iOS, mask-image + filter no mesmo elemento escurece a caixa inteira sobre o nome */
    filter: drop-shadow(0 0 40px rgba(0, 0, 0, .55)) drop-shadow(8px -4px 22px rgba(255, 196, 120, .10));
  }

  .sobre .side {
    position: absolute; top: calc(var(--name-top, 31%) + min(19.5vw, 300px) * .86 + 18px); white-space: nowrap;
    font-family: var(--ff-small); font-size: clamp(10px, .85vw, 12px); letter-spacing: .24em; text-transform: uppercase;
    color: var(--c-cream-warm);
    padding: .55em 1.1em .5em 1.34em;
    border: 1px solid rgba(241, 234, 216, .42); background: rgba(8, 20, 14, .55);
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
  }
  .sobre .side.l { left: max(16px, 6vw); }
  .sobre .side.r { right: max(16px, 6vw); }

  .sobre .scene-fade { position: absolute; left: 0; right: 0; bottom: 0; z-index: 0; height: 22%; background: linear-gradient(180deg, transparent, var(--c-green-deep)); }
  .sobre .scroll-cue {
    position: absolute; left: 50%; bottom: 22px; translate: -50% 0; z-index: 2;
    width: 44px; height: 44px; display: grid; place-items: center;
    color: var(--c-cream-warm); animation: sobre-cue 2.2s ease-in-out infinite;
  }
  .sobre .scroll-cue svg { width: 22px; height: 30px; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .5)); }
  .sobre .scroll-cue:hover { color: var(--c-white); }
  .sobre .scroll-cue:focus-visible { outline: 1px solid var(--c-sage-light); outline-offset: 4px; }
  @keyframes sobre-cue { 0%, 100% { transform: translateY(0); opacity: .75; } 50% { transform: translateY(8px); opacity: 1; } }

  /* subtítulo em sobreposição: "SOBRE MIM" em degradê dourado + "O PROFISSIONAL" por cima */
  .sobre .overtitle { position: relative; display: grid; place-items: center; text-align: center; width: min(1080px, 100%); margin: 0 auto clamp(40px, 7vh, 80px); }
  .sobre .overtitle .back {
    grid-area: 1 / 1; white-space: nowrap;
    font-family: var(--ff-garamond); font-weight: 500; text-transform: uppercase; line-height: .9; letter-spacing: .01em;
    font-size: clamp(44px, 13.5vw, 190px);
    background: var(--grad-gold-fade); -webkit-background-clip: text; background-clip: text; color: transparent;
  }
  .sobre .overtitle .front {
    grid-area: 1 / 1; align-self: end; margin-bottom: -.15em;
    font-family: var(--ff-garamond); font-weight: 400; text-transform: uppercase; letter-spacing: .06em;
    font-size: clamp(20px, 3.4vw, 50px); color: var(--c-white); text-shadow: 0 2px 18px rgba(0, 0, 0, .6);
  }
  @media (max-width: 600px) {
    .sobre .overtitle .back {
      white-space: normal; font-size: 27vw; line-height: .82;
      background: linear-gradient(180deg, #d9b36a 0%, #c29a55 45%, #b08a4a 70%, rgba(176, 138, 74, .35) 100%);
      -webkit-background-clip: text; background-clip: text;
    }
    .sobre .overtitle .back .l2 { display: block; }
    .sobre .overtitle .front { font-size: 7vw; margin-bottom: -.3em; }
  }

  /* bio */
  .sobre .about {
    padding-inline: 16px; padding-block: clamp(56px, 9vh, 110px) clamp(72px, 12vh, 140px);
    background: linear-gradient(180deg, var(--c-green-deep), var(--c-green-night));
    /* ritmo do data-reveal nesta seção (igual ao aprovado: sobe 24px, 0,9s, 110ms entre itens) */
    --dur-reveal: .9s; --reveal-distance: 24px; --stagger-step: 110ms; --ease-reveal: var(--ease-soft);
  }
  .sobre .about-inner { width: min(760px, 100%); margin-inline: auto; }
  .sobre .about-body { display: flex; flex-direction: column; gap: 22px; max-width: 66ch; margin-inline: auto; }
  .sobre .about-body p { font-size: clamp(19px, 1.6vw, 22px); line-height: 1.55; color: rgba(241, 234, 216, .88); }
  .sobre .about-body .lead { font-size: clamp(22px, 2.1vw, 28px); line-height: 1.45; color: var(--c-cream-warm); }
  .sobre .actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 18px 24px; margin-top: 18px; }
  .sobre .actions .cta { margin-inline: 12px 0; }
  .sobre .ghost {
    color: rgba(241, 234, 216, .75); padding: 10px 4px; line-height: normal;
    font-family: var(--ff-small); font-size: 12px; letter-spacing: .3em; text-transform: uppercase;
  }
  .sobre .ghost:hover { color: var(--c-cream-warm); }
  .sobre .ghost:focus-visible { outline: 2px solid var(--c-sage-light); outline-offset: 4px; }

  /* entrada da cena (dispara quando .revealed entra) */
  .sobre.revealed .scene-bg   { animation: sobre-bg-in 1.8s var(--ease-soft) both; }
  .sobre.revealed .bigname .ch { animation: sobre-char-in 1s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--c) * 45ms + 250ms); }
  .sobre.revealed .model      { animation: sobre-model-in 1.4s cubic-bezier(.2, .8, .2, 1) .55s both; }
  .sobre.revealed .side       { animation: sobre-rise .9s var(--ease-soft) 1.1s both; }
  @keyframes sobre-bg-in    { from { opacity: 0; transform: scale(1.08); } }
  @keyframes sobre-char-in  { from { opacity: 0; transform: translateY(40%) scaleY(1.2); filter: blur(8px); } }
  @keyframes sobre-model-in { from { opacity: 0; transform: translate(-50%, 70px); } }
  @keyframes sobre-rise     { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

  /* parallax por camadas com o mouse (JS escreve translate) */
  .sobre .pl { transition: translate .6s var(--ease-soft); }

  /* ---------- Mobile / tablet em pé ---------- */
  @media (max-width: 820px) {
    /* --scene-head: respiro acima do nome para não ficar sob o navbar (calculado no sobre.js) */
    .sobre .scene { height: calc(clamp(560px, 86svh, 820px) + var(--scene-head, 0px)); }
    .sobre .model { height: calc((100% - var(--scene-head, 0px)) * .74); }
    .sobre .side { top: auto !important; bottom: 9%; z-index: 1; font-size: 10.5px; letter-spacing: .22em; }
    .sobre .side.l, .sobre .side.r { left: 50% !important; right: auto !important; translate: -50% 0; }
    .sobre .side.l { bottom: 13.5%; }
    .sobre .side.r { bottom: 9.5%; }
  }
  /* celulares curtos (ex.: iPhone SE): selos acima da seta de rolagem */
  @media (max-width: 820px) and (max-height: 720px) {
    .sobre .side.l { bottom: 108px; }
    .sobre .side.r { bottom: 76px; }
  }

  /* ---------- Sem JavaScript: mostra a bio direto (a cena depende do JS para montar o nome) ---------- */
  html:not(.js) .sobre .stage,
  html:not(.js) .sobre .scene,
  html:not(.js) .sobre [data-action="replay"] { display: none; }
  html:not(.js) .sobre .content { display: block; }

  @media (prefers-reduced-motion: reduce) {
    .sobre *, .sobre *::before, .sobre *::after {
      animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important;
    }
  }
}
