/* Mobile-first layer: only applies below 900px, desktop untouched */
.pbn{display:none}
@media (max-width:899px){
  /* Public bottom navigation */
  .pbn{display:grid;grid-template-columns:repeat(4,1fr) auto;align-items:center;gap:2px;position:fixed;left:8px;right:8px;bottom:calc(8px + env(safe-area-inset-bottom));z-index:60;padding:6px;border-radius:22px;background:rgba(14,15,18,.86);backdrop-filter:saturate(170%) blur(20px);-webkit-backdrop-filter:saturate(170%) blur(20px);border:1px solid rgba(255,255,255,.1);box-shadow:0 18px 40px -18px rgba(0,0,0,.8)}
  .pbn a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:50px;border-radius:16px;font-size:11px;font-weight:600;color:#a1a1aa;transition:background .2s,color .2s,transform .15s}
  .pbn a:active{transform:scale(.94)}
  .pbn a[aria-current="page"]{color:#f5f5f7;background:rgba(255,255,255,.08)}
  .pbn a.pbn-buy{flex-direction:row;padding:0 14px;background:#fff;color:#0a0b0d;font-size:13px;white-space:nowrap}
  body.has-pbn main[data-page]{padding-bottom:calc(84px + env(safe-area-inset-bottom))}
  body.has-pbn footer{padding-bottom:calc(96px + env(safe-area-inset-bottom))!important}

  /* Compact section rhythm */
  .nx{padding:44px 16px}
  .nx-h2{font-size:clamp(26px,7.4vw,32px)!important;line-height:1.05}
  .nx-p{font-size:15px!important;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
  .nx-p.open{-webkit-line-clamp:unset}
  .nx-split{gap:20px!important}

  /* Hero shorter */
  .mh{min-height:auto}
  .mh-in{padding-top:calc(72px + 18px)!important;padding-bottom:18px!important}
  .mh-txt{gap:14px}
  .mh-h1{font-size:clamp(40px,11.5vw,52px)!important}
  .mh-sub{font-size:15px!important}
  .mh-ctas a{min-height:52px}

  /* "Lo que aprenderás": 2x3 compact, description on tap */
  .nx-grid2{grid-template-columns:1fr 1fr!important;gap:8px}
  .nx-card{padding:14px;gap:6px;border-radius:16px;cursor:pointer;transition:transform .15s,border-color .2s}
  .nx-card:active{transform:scale(.97)}
  .nx-card b{font-size:14px;line-height:1.25}
  .nx-card span:not(.nx-ic){max-height:0;opacity:0;overflow:hidden;transition:max-height .3s ease,opacity .25s}
  .nx-card.open span:not(.nx-ic){max-height:160px;opacity:1}
  .nx-card.open{border-color:rgba(79,140,255,.6)}
  .nx-photo{min-height:0;max-height:220px;aspect-ratio:16/10}
  .nx-img{max-height:200px}

  /* Horizontal carousels */
  .nx-steps,.nx-prog{display:flex!important;flex-direction:row!important;overflow-x:auto;scroll-snap-type:x mandatory;gap:10px;margin:0 -16px;padding:2px 16px 8px;scrollbar-width:none}
  .nx-steps::-webkit-scrollbar,.nx-prog::-webkit-scrollbar,.cg::-webkit-scrollbar{display:none}
  .nx-step{flex:0 0 72%;scroll-snap-align:start;flex-direction:column;align-items:flex-start;gap:10px}
  .nx-pc{flex:0 0 82%;scroll-snap-align:start}
  .nx-pc ul{font-size:13px}

  /* Andy card compact */
  .nx-andy{grid-template-columns:96px 1fr!important;gap:14px;padding:16px}
  .nx-andy img{border-radius:16px}
  .nx-andy>.nx-col{grid-column:1/-1}
  .nx-andy>img{grid-row:1}
  .nx-facts{display:grid;grid-template-columns:1fr 1fr;gap:10px;font-size:12px}
  .nx-facts b{font-size:13px}

  /* Courses: 2-column compact cards */
  .cg{grid-template-columns:1fr 1fr!important;gap:10px}
  .cc{border-radius:16px}
  .cc-bd{padding:12px;gap:6px}
  .cc-bd p{display:none}
  .cc-bd h3,.cc-bd b{font-size:14px!important;line-height:1.25}
  .cc-b{left:8px;top:8px;padding:4px 9px;font-size:11px}
  .cc-m{font-size:11px;padding-top:6px}
  .cc-btn{min-height:40px;font-size:13px;border-radius:10px}

  /* Blog list: 2-column grid, no excerpt */
  [data-resgrid]{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px}
  [data-resgrid]>a *{min-width:0;flex-wrap:wrap}
  [data-resgrid]>a h2,[data-resgrid]>a h3,[data-resgrid]>a b{font-size:15px!important;line-height:1.25!important;overflow-wrap:anywhere}
  .nx-grid2{align-items:start}
  [data-resgrid]>a{flex-direction:column!important;padding:12px!important;border:1px solid rgba(255,255,255,.08)!important;border-radius:16px;gap:8px!important}
  [data-resgrid]>a p{display:none}

  /* Lesson index bottom sheet */
  body.has-pbn .ma-sheet-btn{bottom:calc(84px + env(safe-area-inset-bottom))}
  .ma-sheet-btn{position:fixed;right:14px;bottom:calc(90px + env(safe-area-inset-bottom));z-index:61;display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 16px;border-radius:999px;background:#fff;color:#0a0b0d;font:600 13px 'Geist',sans-serif;border:0;box-shadow:0 12px 30px -10px rgba(0,0,0,.7)}
  .ma-sheet-bg{position:fixed;inset:0;z-index:120;background:rgba(0,0,0,.55);opacity:0;pointer-events:none;transition:opacity .25s}
  .ma-sheet{position:fixed;left:0;right:0;bottom:0;z-index:121;max-height:78dvh;overflow:auto;padding:10px 16px calc(20px + env(safe-area-inset-bottom));border-radius:24px 24px 0 0;background:#111216;border-top:1px solid rgba(255,255,255,.1);transform:translateY(100%);transition:transform .3s cubic-bezier(.2,.8,.2,1)}
  .ma-sheet.open{transform:none}
  .ma-sheet-bg.open{opacity:1;pointer-events:auto}
  .ma-sheet:before{content:"";display:block;width:40px;height:4px;border-radius:2px;background:rgba(255,255,255,.25);margin:0 auto 12px}
  .ma-sheet h3{font:700 17px 'Geist',sans-serif;margin:0 0 10px}
  .ma-sheet a{display:flex;align-items:center;gap:10px;min-height:46px;padding:0 6px;border-bottom:1px solid rgba(255,255,255,.06);color:#e4e4e7;font-size:14px}
}
@media (max-width:899px) and (prefers-reduced-motion:reduce){
  .ma-sheet,.ma-sheet-bg,.nx-card,.nx-card span{transition:none!important}
}
.sh-qa{display:none}
@media (max-width:899px){
  /* Student home as dashboard */
  .sh-hero{min-height:auto!important;padding:20px 16px 22px!important;border-radius:0 0 22px 22px!important}
  .sh-hero h1{font-size:clamp(30px,8.6vw,40px)!important}
  .sh-hero p{font-size:15px!important;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  .sh-hero>div:last-child{gap:16px!important}
  .sh-andy{padding:14px!important;border-radius:18px!important;gap:10px!important}
  .sh-andy>p{font-size:14px!important;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
  .sh-qa{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:16px 16px 0}
  .sh-qa a{display:flex;flex-direction:column;gap:2px;padding:14px;border-radius:16px;background:#121317;border:1px solid rgba(255,255,255,.08);font-weight:600;font-size:15px;color:#f5f5f7;transition:transform .15s}
  .sh-qa a:active{transform:scale(.97)}
  .sh-qa small{font-size:12px;font-weight:400;color:#9aa0a7}
  .sh-row{display:flex!important;overflow-x:auto;scroll-snap-type:x mandatory;gap:10px!important;padding:6px 16px 6px!important;scrollbar-width:none}
  .sh-row::-webkit-scrollbar{display:none}
  .sh-row>a{flex:0 0 74%;scroll-snap-align:start}
  .sh-row .lc-th span[style*="font-size:120px"]{font-size:84px!important}
  /* Lesson: side panel replaced by bottom sheet */
  .les-aside{position:static!important}
  /* Exercises: week selector */
  .ex-tabs{display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;margin:0 -16px;padding:0 16px;position:sticky;top:66px;z-index:5;background:linear-gradient(#060708 70%,transparent);padding-bottom:10px}
  .ex-tabs button{flex:0 0 auto;min-height:40px;padding:0 16px;border-radius:999px;border:1px solid rgba(255,255,255,.12);background:#121317;color:#c4c4cc;font:600 13px 'Geist',sans-serif}
  .ex-tabs button[aria-selected="true"]{background:#fff;color:#0a0b0d;border-color:#fff}
  [data-exw].ex-hide{display:none!important}
}
@media (max-width:899px){
  .hx{display:flex!important;overflow-x:auto;scroll-snap-type:x mandatory;gap:10px!important;margin:0 -16px;padding:4px 16px 8px;scrollbar-width:none;grid-template-columns:none!important;margin:0!important;padding:4px 0 8px!important}
  main section[style*="padding:clamp(70px"]{padding:44px 16px!important}
  .hx::-webkit-scrollbar{display:none}
  .hx>a{flex:0 0 72%;scroll-snap-align:start;min-width:0}
  .hx>a p{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  .post-toc{position:fixed!important;left:0!important;right:0!important;top:auto!important;bottom:0!important;z-index:121;max-height:70dvh;overflow:auto;border-radius:24px 24px 0 0!important;padding:16px 16px calc(20px + env(safe-area-inset-bottom))!important;transform:translateY(105%);transition:transform .3s cubic-bezier(.2,.8,.2,1)}
  .post-toc.open{transform:none}
}
@media (max-width:899px){.hd-cta{display:none!important}}

/* Home hero: header is not overlaid, so no header offset; center content vertically */
.mh{min-height:min(calc(100svh - 70px),800px);justify-content:center}
.mh-in{display:flex;align-items:center;padding-top:clamp(28px,4.5vh,48px)!important;padding-bottom:clamp(16px,2.5vh,28px)!important}
.mh-stats{margin-top:0!important;margin-bottom:clamp(16px,3vh,28px)!important}
@media(min-width:900px) and (max-height:800px){.mh-in{padding-top:20px!important;padding-bottom:16px!important}.mh-txt{gap:16px}}
@media(max-width:640px){.mh{min-height:auto}.mh-in{padding-top:24px!important;padding-bottom:16px!important}}
.ch-in{padding-top:clamp(24px,4vh,48px)!important}

/* Home snap mode (snap.js): each section fills one screen */
html.snap main[data-page]>section{min-height:calc(100dvh - 68px);display:flex;flex-direction:column;justify-content:center;padding-top:clamp(20px,4vh,56px)!important;padding-bottom:clamp(20px,4vh,56px)!important;box-sizing:border-box}
html.snap main[data-page]>section.mh{min-height:100dvh;padding-top:68px!important}
html.snap main[data-page]>section>*{width:100%}
html.snap main[data-page]>section h2{font-size:clamp(28px,min(4.2vw,6.2vh),58px)!important}
html.snap main[data-page]>section .hx>a:nth-child(n+5){display:none!important}
html.snap main[data-page]>section .hx>a .snap-hide,html.snap main[data-page]>section .hx p{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
html.snap main[data-page]>section [data-r]>div:nth-child(n+6){display:none}
html.snap .faq-more{display:inline-flex!important}
html.snap .nx-card p,html.snap .nx-card span{font-size:14px}
@media (max-height:940px) and (min-width:900px){
  html.snap .nx-grid2{gap:10px!important}
  html.snap .nx-card{padding:14px 16px!important}
  html.snap .nx-photo,html.snap .nx-img{max-height:62vh;width:auto;max-width:100%;object-fit:cover;justify-self:center}
  html.snap .nx-p{font-size:15px!important;margin-top:8px}
  html.snap .nx-step{padding:10px 0!important}
}
@media (max-width:899px){
  html.snap main[data-page]>section .hx>a:nth-child(n+3){display:none!important}
  html.snap .nx-photo,html.snap .nx-img{max-height:30vh;width:100%;object-fit:cover}
  html.snap .nx-grid2{grid-template-columns:1fr 1fr!important;gap:8px!important}
  html.snap .nx-card{padding:12px!important}
}
.snap-dots{position:fixed;right:18px;top:50%;transform:translateY(-50%);z-index:45;display:flex;flex-direction:column;gap:10px}
.snap-dots button{width:10px;height:10px;padding:0;border-radius:50%;border:1px solid rgba(255,255,255,.5);background:transparent;cursor:pointer;transition:background .2s,transform .2s}
.snap-dots button[aria-current="true"]{background:#4f8cff;border-color:#4f8cff;transform:scale(1.25)}
.snap-dots button:focus-visible{outline:2px solid #4f8cff;outline-offset:3px}
@media (max-width:899px){.snap-dots{display:none}}
html.snap .mh-h1{font-size:clamp(40px,min(8.2vw,12vh),112px)!important}
@media (max-height:940px) and (min-width:900px){
  html.snap .mh-sub{font-size:18px!important}
  html.snap .mh-txt{gap:14px!important}
  html.snap .nx-card{gap:4px!important}
  html.snap .nx-card p{line-height:1.4}
  html.snap .fit .nx-photo{max-height:56vh}
}
@media (max-width:899px){
  html.snap .fit .nx-photo{display:none}
  html.snap .mh-stats{display:none}
}
@media (max-height:940px) and (min-width:900px){
  html.snap .nx-card{padding:12px 14px!important}
  html.snap .nx-card p,html.snap .nx-card span:not(.nx-ic){font-size:13px!important}
  html.snap .nx-ic{width:32px!important;height:32px!important}
}
