/* ============================================================
   Sesión de Diagnóstico — Luis Morales
   Dictamen clínico: editorial, sobrio, plano. Anti-glow.
   ============================================================ */

:root{
  /* Tonal arc */
  --black:        #0A0A0B;
  --black-alt:    #0E0D11;   /* dolor: más desaturado */
  --white:        #F5F4F1;   /* claro alt */
  --white-pure:   #FFFFFF;

  /* Text */
  --on-dark:      #F4F3F1;
  --on-dark-mut:  #9A9994;
  --on-dark-faint:#5C5B58;
  --on-light:     #15120F;
  --on-light-mut: #6E6D68;

  /* Okiro — bisturí, no brocha */
  --violet:       #8518DC;
  --violet-light: #A855F7;
  --violet-deep:  #5B0FA0;

  /* Hairlines */
  --line-dark:    rgba(255,255,255,.12);
  --line-light:   rgba(20,18,15,.14);

  /* Geometry */
  --col:          1280px;    /* content column */
  --gutter:       64px;      /* left gutter holding the spine */
  --pad-r:        24px;

  --ease:         cubic-bezier(.22,.61,.36,1);

  /* Fonts */
  --display: "Switzer", "Helvetica Neue", Arial, sans-serif;
  --serif:   "Instrument Serif", Georgia, serif;
  --mono:    "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;
}

*{ box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; }
html, body{ margin:0; }
body{
  font-family:var(--display);
  background:var(--black);
  color:var(--on-dark);
  font-weight:400;
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
  overflow-x:hidden;
}

/* Subtle grain — permitido */
body::before{
  content:"";
  position:fixed; inset:0;
  pointer-events:none; z-index:9000;
  opacity:.035;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode:overlay;
}

/* ---- The spine (fixed pulse overlay) ---- */
#spine{
  position:fixed; top:0; left:0;
  width:100vw; height:100vh;
  pointer-events:none; z-index:40;
}

/* ---- Layout primitives ---- */
.wrap{
  max-width:calc(var(--col) + var(--gutter) + var(--pad-r));
  margin:0 auto;
  padding:0 var(--pad-r) 0 var(--gutter);
}
section{ position:relative; }

/* Tonal sections */
.s-dark{ background:var(--black);     color:var(--on-dark);  }
.s-dim { background:var(--black-alt); color:var(--on-dark);  }
.s-light{ background:var(--white);    color:var(--on-light); }

.pad{ padding-top:clamp(88px,16vh,168px); padding-bottom:clamp(88px,16vh,168px); }

/* Seam: thin hairline between adjacent tones */
.seam-d{ border-top:1px solid var(--line-dark); }
.seam-l{ border-top:1px solid var(--line-light); }

/* ---- Type ---- */
h1,h2,h3{ font-weight:600; margin:0; }
.kicker{
  font-family:var(--mono);
  font-size:11.5px; letter-spacing:.18em; text-transform:uppercase;
  color:var(--on-dark-mut); font-weight:500;
}
.s-light .kicker{ color:var(--on-light-mut); }

.h-hero{
  font-size:clamp(34px,7.4vw,62px);
  line-height:1.04; letter-spacing:-.022em; font-weight:600;
  text-wrap:balance;
}
.h-sec{
  font-size:clamp(28px,5.4vw,46px);
  line-height:1.08; letter-spacing:-.018em; font-weight:600;
  text-wrap:balance;
}
.acc{
  font-family:var(--serif);
  font-style:italic; font-weight:400;
  color:var(--violet);
  letter-spacing:0;
}
.s-light .acc{ color:var(--violet-deep); }

.lede{
  font-size:clamp(17px,2.5vw,21px);
  line-height:1.62; color:var(--on-dark-mut); font-weight:400;
  max-width:54ch;
}
.s-light .lede{ color:var(--on-light-mut); }

.body{
  font-size:clamp(16.5px,2.3vw,19px);
  line-height:1.7; max-width:58ch;
}
.body p{ margin:0 0 1.15em; }
.body p:last-child{ margin-bottom:0; }

.measure-narrow{ max-width:40ch; }

/* ---- Buttons ---- */
.btn{
  -webkit-appearance:none; appearance:none;
  display:inline-flex; align-items:center; gap:14px;
  font-family:var(--display); font-weight:600;
  font-size:16px; letter-spacing:-.01em;
  color:var(--white-pure); background:var(--violet);
  border:none; border-radius:2px;
  padding:18px 26px; min-height:56px;
  cursor:pointer; text-decoration:none;
  transition:background .25s var(--ease), transform .25s var(--ease);
}
.btn:hover{ background:var(--violet-deep); transform:translateY(-1px); }
.btn .arr{
  font-family:var(--mono); font-weight:400; font-size:15px;
  opacity:.85; transition:transform .25s var(--ease);
}
.btn:hover .arr{ transform:translateX(4px); }
.s-light .btn{ color:var(--white-pure); }

/* ---- Header ---- */
header{
  position:sticky; top:0; z-index:100;
  background:#000000;
  border-bottom:1px solid var(--line-dark);
}
.head-in{
  max-width:calc(var(--col) + var(--gutter) + var(--pad-r)); margin:0 auto;
  padding:14px var(--pad-r) 14px var(--gutter);
  display:flex; align-items:center; justify-content:space-between; gap:16px;
}
.brand{ display:flex; align-items:center; gap:12px; min-width:0; text-decoration:none; }
.brand-logo{ height:38px; width:auto; display:block; }
.mono-mark{
  width:34px; height:34px; flex:none;
  display:grid; place-items:center;
  border:1px solid var(--violet);
  color:var(--violet-light);
  font-family:var(--mono); font-weight:600; font-size:13px;
  letter-spacing:.04em; border-radius:2px;
}
.brand-name{
  font-weight:600; font-size:15.5px; letter-spacing:-.01em;
  color:var(--on-dark); white-space:nowrap;
}
.head-cta{ font-size:14.5px; padding:12px 18px; min-height:44px; }
.head-cta .full{ display:inline; }
.head-cta .short{ display:none; }

/* ---- Hero ---- */
.hero-grid{ display:flex; flex-direction:column; gap:clamp(30px,5vw,40px); }
.hero-text{ display:flex; flex-direction:column; gap:clamp(26px,4vw,32px); align-items:flex-start; }
.hero-actions{ display:flex; flex-direction:column; gap:28px; align-items:flex-start; }
.hero-portrait{
  display:block; width:100%; max-width:360px; height:auto;
  /* dissolve the base into the section (header-black) so it reads as
     part of the page, not a cropped image */
  -webkit-mask-image:linear-gradient(to bottom, #000 74%, transparent 98%);
  mask-image:linear-gradient(to bottom, #000 74%, transparent 98%);
}
.trust{
  font-family:var(--mono); font-size:13px; line-height:1.7;
  color:var(--on-dark-mut); letter-spacing:.01em; max-width:46ch;
  padding-top:6px; border-top:1px solid var(--line-dark);
}
.trust b{ color:var(--on-dark); font-weight:500; }

/* media frames */
.frame{
  position:relative; width:100%;
  border:1px solid var(--line-dark);
  background:#111014;
  border-radius:3px; overflow:hidden;
}
.s-light .frame{ border-color:var(--line-light); background:#e9e7e2; }
.frame image-slot, .frame .portrait{ display:block; width:100%; height:100%; }
.portrait{ object-fit:cover; object-position:center top; }

/* Frameless portraits — the transparent PNG integrates straight onto
   the section background instead of sitting inside a bordered card. */
.portrait-frame{
  position:relative;
  border:none; background:transparent; border-radius:0; overflow:visible;
}
.s-dark .portrait-frame,
.s-light .portrait-frame{ background:transparent; border:none; }
.portrait-frame .portrait{ object-fit:contain; object-position:center bottom; }

/* dissolve the bottom edge of the portrait into the page so it reads as
   part of the section, not a cropped image */
.who-media .portrait{
  -webkit-mask-image:linear-gradient(to bottom, #000 48%, rgba(0,0,0,0.55) 74%, transparent 90%);
  mask-image:linear-gradient(to bottom, #000 48%, rgba(0,0,0,0.55) 74%, transparent 90%);
}

/* ---- Dolor ---- */
.dolor-inner{ display:flex; flex-direction:column; gap:clamp(32px,5vw,52px); }
.dolor .h-sec{ max-width:none; }
.dolor .body{ color:#D9D8D4; max-width:none; }

/* ---- Reframe mechanism diagram ---- */
.flow{
  display:flex; align-items:stretch; gap:0;
  border:1px solid var(--line-light);
  border-radius:3px; overflow:hidden; background:var(--white-pure);
}
.flow-node{
  flex:1; padding:22px 18px;
  display:flex; flex-direction:column; gap:10px;
  border-right:1px solid var(--line-light);
  position:relative;
  transition:background .45s var(--ease);
}
.flow-node .n-lb{ transition:color .45s var(--ease); }
.flow-node .dot{ transition:background .45s var(--ease); }
.flow-node:last-child{ border-right:none; }
.flow-node .n-ix{
  font-family:var(--mono); font-size:11px; letter-spacing:.14em;
  color:var(--on-light-mut);
}
.flow-node .n-lb{
  font-weight:600; font-size:clamp(15px,2.2vw,18px); letter-spacing:-.01em;
  color:var(--on-light);
}
.flow-node .arrow{
  position:absolute; right:-7px; top:50%; transform:translateY(-50%);
  z-index:2; font-family:var(--mono); font-size:13px; color:var(--on-light-mut);
  background:var(--white-pure); padding:2px 0;
}
.flow-node:last-child .arrow{ display:none; }
.flow-node.on{ background:#fbf6ff; }
.flow-node.on .n-lb{ color:var(--violet-deep); }
.flow-node.on .n-ix{ color:var(--violet); }
.flow-node .dot{
  width:7px; height:7px; border-radius:50%;
  background:var(--line-light); margin-top:2px;
}
.flow-node.on .dot{ background:var(--violet); }

/* ---- Quién ---- */
.namemark{
  font-weight:700; letter-spacing:-.035em; line-height:.92;
  font-size:clamp(56px,15vw,128px);
  color:var(--on-light);
}
.namemark .v{ color:var(--violet-deep); }
.who-grid{ display:flex; flex-direction:column; gap:clamp(34px,6vw,56px); }

.metrics{
  display:grid; grid-template-columns:repeat(2,1fr);
  border-top:1px solid var(--line-light);
  border-left:1px solid var(--line-light);
  margin-top:8px;
}
.metric{
  padding:22px 20px;
  border-right:1px solid var(--line-light);
  border-bottom:1px solid var(--line-light);
  display:flex; flex-direction:column; gap:7px;
}
.metric .m-val{
  font-family:var(--mono); font-weight:600;
  font-size:clamp(22px,4.5vw,30px); letter-spacing:-.01em;
  color:var(--violet-deep);
}
.metric .m-lb{
  font-family:var(--mono); font-size:11.5px; letter-spacing:.06em;
  text-transform:uppercase; color:var(--on-light-mut);
}

/* ---- Prueba ---- */
.proof-head{ display:flex; flex-direction:column; gap:14px; margin-bottom:clamp(20px,3vw,32px); }
.cards{ display:flex; flex-direction:column; gap:22px; }
.card{
  border:1px solid var(--line-light);
  border-radius:4px; background:var(--white-pure);
  padding:clamp(20px,3vw,28px);
  display:flex; flex-direction:column; gap:22px;
}
.card-vid{
  width:100%; flex:none;
  border-radius:4px; overflow:hidden;
  background:#0c0b0f;
  align-self:center; max-width:300px;
}
.card-vid wistia-player{ display:block; width:100%; border-radius:4px; overflow:hidden; }
.card-body{ display:flex; flex-direction:column; gap:18px; min-width:0; }
.card-logo{
  height:60px; width:auto; max-width:280px;
  object-fit:contain; object-position:left center;
  align-self:flex-start; display:block;
}
.quote{
  font-size:clamp(17px,2.6vw,20px); line-height:1.55;
  letter-spacing:-.01em; color:var(--on-light);
  font-style:italic;
}
.author{
  font-family:var(--mono); font-size:13px; line-height:1.6;
  color:var(--on-light-mut);
}
.stats{
  display:flex; flex-wrap:wrap; gap:8px 10px;
  padding-top:20px; border-top:1px solid var(--line-light);
}
.stat{
  font-family:var(--mono); font-size:13.5px; letter-spacing:-.01em;
  color:var(--violet-deep); font-weight:500;
}
.stat .sep{ color:var(--on-light-mut); margin:0 2px; }

/* ---- Form ---- */
.form-head{ display:flex; flex-direction:column; gap:26px; align-items:flex-start; margin-bottom:clamp(44px,8vw,72px); }
.form-embed-wrap{
  width:100%; max-width:640px; margin:0 auto;
  background:var(--white-pure); border-radius:10px; overflow:hidden;
  box-shadow:0 1px 0 rgba(255,255,255,.06), 0 30px 80px -40px rgba(0,0,0,.8);
}
.form-embed-wrap iframe{ display:block; width:100%; min-height:560px; }
.embed{
  width:100%; max-width:600px; margin:0 auto;
  min-height:600px;
  border:1px solid var(--line-dark);
  border-radius:4px;
  background:linear-gradient(180deg,#121116,#0d0c10);
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:18px; padding:48px 28px; text-align:center;
}
.embed .glyph{
  width:46px; height:46px; border:1px solid var(--violet);
  border-radius:50%; display:grid; place-items:center;
}
.embed .glyph i{ width:10px; height:10px; border-radius:50%; background:var(--violet); display:block; }
.embed .e-t{ font-family:var(--mono); font-size:12.5px; letter-spacing:.16em; text-transform:uppercase; color:var(--on-dark-mut); }
.embed .e-d{ font-size:15px; line-height:1.6; color:var(--on-dark-faint); max-width:34ch; }
.embed .e-bar{
  width:200px; height:4px; border-radius:2px;
  background:var(--line-dark); overflow:hidden; margin-top:4px;
}
.embed .e-bar i{ display:block; width:34%; height:100%; background:var(--violet); }

/* ---- Footer ---- */
footer{ background:var(--black); border-top:1px solid var(--line-dark); }
.foot-in{
  max-width:calc(var(--col) + var(--gutter) + var(--pad-r)); margin:0 auto; padding:30px var(--pad-r) 40px var(--gutter);
  display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap;
}
.foot-in .fmono{ font-family:var(--mono); font-size:12px; color:var(--on-dark-faint); letter-spacing:.02em; }
.foot-in .foot-link{
  font-family:var(--mono); font-size:12px; letter-spacing:.02em;
  color:var(--on-dark-mut); text-decoration:none;
  border-bottom:1px solid var(--line-dark); padding-bottom:1px;
  transition:color .25s var(--ease), border-color .25s var(--ease);
}
.foot-in .foot-link:hover{ color:var(--on-dark); border-color:var(--on-dark-mut); }

/* ---- Reveal ---- */
.rv{ opacity:0; transform:translateY(22px); transition:opacity .9s var(--ease), transform .9s var(--ease); }
.rv.in{ opacity:1; transform:none; }
@media (scripting:none){ .rv{ opacity:1; transform:none; } }
.rv.d1{ transition-delay:.08s; }
.rv.d2{ transition-delay:.16s; }
.rv.d3{ transition-delay:.24s; }

/* Hero paints immediately — it's above the fold, so it must never show a
   blank/black first frame while the reveal logic warms up. The fade-up
   stays for every section below the fold. */
#hero .rv{ opacity:1; transform:none; transition:none; }

@media (prefers-reduced-motion:reduce){
  .rv{ opacity:1; transform:none; transition:none; }
  .btn,.btn .arr{ transition:none; }
  html{ scroll-behavior:auto; }
}

/* ---- Responsive ---- */
@media (min-width:760px){
  :root{ --gutter:84px; }
  /* true 2-column layout: text and portrait are separate flex columns
     with a real gap, so they can never overlap and the hero stays centered */
  .hero-grid{ display:flex; flex-direction:row; align-items:center; gap:clamp(32px,4.5vw,64px); }
  .hero-text{ flex:1 1 auto; min-width:0; max-width:none; }
  .hero-media{
    position:static; flex:0 0 560px; align-self:stretch; margin:0;
    display:flex; align-items:flex-start; justify-content:center;
  }
  .hero-portrait{
    position:static; width:100%; height:100%; max-width:none;
    object-fit:contain; object-position:center top;
  }
  .h-hero{ font-size:clamp(34px,3.6vw,48px); }
  /* trim the empty space between header and hero content */
  #hero.pad, #hero .pad{ padding-top:clamp(28px,5vh,56px); }
  .metrics{ grid-template-columns:repeat(3,1fr); }
  .cards{ gap:26px; }
  .card{ flex-direction:row; gap:30px; align-items:stretch; padding:26px; }
  .card-vid{ width:236px; max-width:236px; align-self:flex-start; margin:0; }
  .card-body{ flex:1; justify-content:flex-start; gap:20px; }
  .who-grid{ flex-direction:row; align-items:flex-start; gap:56px; }
  .who-media{ flex:none; width:440px; position:sticky; top:96px; }
  .who-copy{ flex:1; min-width:0; }
}

/* narrower desktops: scale the portrait down so Luis's body always
   clears the lede text (full-height span kicks in at ≥1080px) */
@media (min-width:760px) and (max-width:1024px){
  .hero-media{ flex-basis:440px; }
  .who-media{ width:320px; }
}

@media (max-width:759px){
  .head-cta .full{ display:none; }
  .head-cta .short{ display:inline; }
  .head-cta{ padding:11px 15px; }
  .brand-name{ font-size:14px; }
  .flow{ flex-direction:column; }
  .flow-node{ border-right:none; border-bottom:1px solid var(--line-light); flex-direction:row; align-items:center; justify-content:space-between; gap:14px; }
  .flow-node:last-child{ border-bottom:none; }
  /* connector arrows point DOWN between stacked nodes */
  .flow-node .arrow{
    display:block; right:auto; left:24px; top:auto; bottom:-8px;
    transform:translateY(0) rotate(90deg);
    background:var(--white-pure); padding:0 2px; line-height:1;
  }
  .flow-node:last-child .arrow{ display:none; }
}

/* ===== Dedicated mobile pass (≤480px) ===== */
@media (max-width:480px){
  :root{ --gutter:42px; --pad-r:18px; --seam-soft:clamp(30px,5vh,40px); }

  /* no element may exceed the viewport */
  .dolor-wrap, .wrap{ max-width:100%; }

  /* header: logo + short CTA, comfortable tap target */
  .head-in{ padding:12px 16px 12px 16px; gap:10px; }
  .mono-mark{ width:32px; height:32px; font-size:12px; }
  .brand-name{ font-size:13.5px; }
  .head-cta{ min-height:42px; padding:10px 14px; font-size:13.5px; gap:8px; }

  /* hero: keep stacked, shrink headline so it never overflows at 360px */
  .h-hero{ font-size:clamp(27px,8.4vw,33px); line-height:1.08; }
  .lede{ font-size:17px; }
  .trust{ font-size:12.5px; }

  /* section headings + body */
  .h-sec{ font-size:clamp(26px,8vw,32px); line-height:1.12; }
  .body{ font-size:16.5px; }
  .pad{ padding-top:clamp(64px,13vh,96px); padding-bottom:clamp(64px,13vh,96px); }

  /* mono labels: keep legible */
  .kicker{ font-size:12px; }
  .flow-node .n-ix{ font-size:12px; }
  .flow-node .n-lb{ font-size:16px; }
  .metric .m-lb{ font-size:12px; }
  .author{ font-size:13px; }
  .e-t{ font-size:12px; }

  /* cifras: single stacked column on phone, even rhythm */
  .metrics{ grid-template-columns:1fr; }
  .metric{ padding:20px 18px; }

  /* collapse dead space where SAME-TONE sections meet;
     keep the generous respiro at every dark↔light transition */
  #hero .pad{ padding-bottom:var(--seam-soft); }
  #dolor .pad{ padding-top:var(--seam-soft); }
  #reframe .pad{ padding-bottom:var(--seam-soft); }
  #quien .pad{ padding-top:var(--seam-soft); padding-bottom:var(--seam-soft); }
  #prueba .pad{ padding-top:var(--seam-soft); }

  /* proof cards: single column, vertical video clips centered */
  .cards{ gap:18px; }
  .card{ padding:20px 18px; gap:18px; }
  .card-vid{ max-width:240px; }
  /* stats wrap on phone too */
  .stat{ font-size:13.5px; }
  .stats{ gap:6px 8px; }

  /* button comfortable for thumbs */
  .btn{ min-height:50px; padding:16px 22px; }

  /* GHL embed: near-full width, comfortable height (not a little box) */
  .embed{ min-height:520px; padding:40px 22px; border-radius:4px; }
  .embed .e-d{ font-size:14.5px; }

  /* footer wraps cleanly */
  .foot-in{ padding:26px 16px 34px 16px; gap:14px; }
  .foot-in .fmono{ font-size:11.5px; }
}
