/* ALBA · luz, circuitos y movimiento de las cabeceras */
:root { --wm-light: #65eee1; --wm-secondary: #e6bb72; }
body:has(.tm-page) { --wm-light: #fbd281; --wm-secondary: #57dcd4; }
body.ps-page { --wm-light: #64f2d9; --wm-secondary: #72acff; }
body:has(.report-intro) { --wm-light: #82caff; --wm-secondary: #9d9fff; }
:is(.games-hero,.intro,.oca-top,.vf-head) { --wm-light: #baaeff; --wm-secondary: #65dde2; }
:is(.alba-v5-hero,.ps-banner,.seo-hero,.tm-hero,.tm-reader-head,.hero,.op-hero,.pg-hero,.req-hero,.report-intro,.intro,.alba-tests-heading,.alba-history-hero,.alba-consistent-hero,.games-hero,.themes-hero,.result-hero,.mobile-screen-heading,.landing-hero,.oca-top,.vf-head) {
  position: relative;
  isolation: isolate;
  box-shadow: inset 0 1px color-mix(in srgb,var(--wm-light) 68%,transparent), 0 10px 28px #071e3024 !important;
}
:is(.alba-v5-hero,.ps-banner,.seo-hero,.tm-hero,.tm-reader-head,.hero,.op-hero,.pg-hero,.req-hero,.report-intro,.intro,.alba-tests-heading,.alba-history-hero,.alba-consistent-hero,.games-hero,.themes-hero,.result-hero,.mobile-screen-heading,.landing-hero,.oca-top,.vf-head)::after {
  content: "";
  display: block;
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  border-radius: inherit;
  opacity: .85;
  background:
    radial-gradient(circle, var(--wm-light) 0 .85px, transparent 1.3px) right top / 17px 17px,
    repeating-linear-gradient(135deg,transparent 0 34px, color-mix(in srgb,var(--wm-light) 18%,transparent) 35px, transparent 36px 68px);
  mask-image: linear-gradient(92deg,transparent 24%,#0002 52%,#0009);
}
:is(main, .screen) :is(h1,[data-alba-view-title])::after, .alba-tests-heading h2::after {
  content: "";
  display: block;
  width: min(9rem,55%);
  height: 4px;
  margin-block-start: .26em;
  border-radius: 4px;
  background:
    linear-gradient(110deg,transparent 20%,white 46%,transparent 70%) -55px 0 / 50px 100% no-repeat,
    linear-gradient(90deg,var(--wm-light) 0 58%,transparent 58% 62%,var(--wm-secondary) 62% 79%,transparent 79% 84%,var(--wm-light) 84% 92%,transparent 92% 96%,var(--wm-secondary) 96%);
  filter: drop-shadow(0 1px 3px #17354755);
}
:is(.ps-menu-card,.tm-card,.req-card,.report-card,.apk-step-card,.op-info-card,.alba-home-download-card,.mobile-tile):is(:hover,:focus-within) {
  outline: 2px solid color-mix(in srgb,var(--wm-light) 55%,#12697a);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: no-preference) {
  :is(main,.screen) :is(h1,[data-alba-view-title])::after,.alba-tests-heading h2::after { animation: wm-signal 2.8s ease-in-out 2; }
  :is(.ps-banner,.seo-hero,.tm-hero,.tm-reader-head,.hero,.op-hero,.pg-hero,.req-hero,.report-intro,.intro,.alba-tests-heading,.alba-history-hero,.alba-consistent-hero,.games-hero,.themes-hero,.landing-hero,.mobile-screen-heading) :is(:is(h1,[data-alba-view-title]),h2) {
    animation: wm-title-in .72s cubic-bezier(.2,.8,.2,1) both;
  }
  :is(.alba-v5-hero,.ps-banner,.seo-hero,.tm-hero,.tm-reader-head,.hero,.op-hero,.pg-hero,.req-hero,.report-intro,.intro,.alba-tests-heading,.alba-history-hero,.alba-consistent-hero,.games-hero,.themes-hero)::after {
    animation: wm-panel-in 1.8s ease-out both;
  }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  :is(.ps-menu-card,.tm-card,.req-card,.report-card,.apk-step-card,.op-info-card,.alba-home-download-card,.mobile-tile) { transition: translate .22s ease-out, box-shadow .22s ease-out; }
  :is(.ps-menu-card,.tm-card,.req-card,.report-card,.apk-step-card,.op-info-card,.alba-home-download-card,.mobile-tile):hover { translate: 0 -3px; }
}
@keyframes wm-title-in { from { opacity: .4; translate: 0 .23em; } }
@keyframes wm-panel-in { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }
@keyframes wm-signal { 0% { background-position: -55px 0,0 0; } 75%,100% { background-position: 190px 0,0 0; } }

/* Acciones de la cabecera de inicio */
#home .alba-v5-hero-actions > :is(.alba-v5-cta,.alba-v5-outline) {
  --rail: #925512;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  box-sizing: border-box;
  min-height: 52px;
  padding: 12px 19px;
  font: inherit;
  font-size: .94rem;
  font-weight: 750;
  line-height: 1.25;
  text-align: center;
  border-radius: 13px 5px;
  background: linear-gradient(120deg,#fff0bc 0%,#f8d18b 53%,#edb85e 100%);
  border: 1px solid #ffdd91;
  box-shadow: inset 0 1px 0 #fff8, 0 3px 15px #ebbb602e;
}
#home .alba-v5-hero-actions > .alba-v5-outline {
  --rail: #76d7ff;
  background: linear-gradient(120deg,#1c394e,#0f233a 75%);
  border-color: #58839b;
  box-shadow: inset 0 1px 0 #9ddfff30, 0 3px 15px #327da829;
}
#home .alba-v5-hero-actions > :is(a,button)::after {
  content: "";
  position: absolute;
  inset: auto 14px 4px;
  height: 2px;
  pointer-events: none;
  background: linear-gradient(90deg,transparent,var(--rail) 24%,var(--rail) 76%,transparent);
  opacity: .8;
}
#home .alba-v5-hero-actions > :is(a,button):focus-visible {
  outline: 3px solid #a7e4ff;
  outline-offset: 3px;
}
@media (prefers-reduced-motion: no-preference) {
  #home .alba-v5-hero-actions > :is(a,button)::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 -38%;
    width: 32%;
    pointer-events: none;
    background: linear-gradient(100deg,transparent,#fff8,transparent);
    animation: alba-action-sweep 1s ease-out .2s both;
  }
  #home .alba-v5-hero-actions > :nth-child(2)::before { animation-delay: .45s; }
  #home .alba-v5-hero-actions > :nth-child(3)::before { animation-delay: .7s; }
  #home .alba-v5-hero-actions > :is(a,button) { transition: translate .18s ease, filter .18s ease; }
  #home .alba-v5-hero-actions > :is(a,button):focus-visible { translate: 0 -2px; }
}
@media (hover:hover) and (prefers-reduced-motion:no-preference) {
  #home .alba-v5-hero-actions > :is(a,button):hover { translate: 0 -2px; filter: brightness(1.09); }
  #home .alba-v5-hero-actions > :is(a,button):hover::after { animation: alba-action-rail .4s ease-out; }
}
@keyframes alba-action-sweep {
  from { transform: translateX(0) skewX(-18deg); }
  to { transform: translateX(470%) skewX(-18deg); }
}
@keyframes alba-action-rail { from { transform: scaleX(.25); } to { transform: scaleX(1); } }
@media (max-width: 600px) {
  #home .alba-v5-hero-actions { display: grid; grid-template-columns: minmax(0,1fr); }
}
@media (prefers-reduced-motion: reduce) {
  #home .alba-v5-hero-actions > :is(a,button) { transition: none; transform: none; }
}


/* Tarjetas de recursos de la portada */
#home #mobileTiles > .mobile-tile {
  --luz: #76ecdd;
}
#home #mobileTiles > .mobile-tile:nth-child(even) {
  --luz: #ffd578;
}
#home #mobileTiles .alba-tile-media {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
#home #mobileTiles .alba-tile-media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(var(--luz),var(--luz)) left 7px top 7px / 18px 2px,
    linear-gradient(var(--luz),var(--luz)) left 7px top 7px / 2px 10px,
    linear-gradient(var(--luz),var(--luz)) right 7px bottom 7px / 18px 2px,
    linear-gradient(var(--luz),var(--luz)) right 7px bottom 7px / 2px 10px;
  background-repeat: no-repeat;
}
#home #mobileTiles > .mobile-tile:is(:focus-visible,:active) {
  outline: 2px solid var(--luz);
  outline-offset: 2px;
}
@media (hover:hover) {
  #home #mobileTiles > .mobile-tile:hover {
    border-color: var(--luz);
    box-shadow: inset 0 -2px var(--luz), 0 4px 18px color-mix(in srgb,var(--luz) 25%,transparent);
  }
}
@media (prefers-reduced-motion:no-preference) {
  #home #mobileTiles .alba-tile-media img { transition: scale .36s ease-out; }
  #home #mobileTiles .mobile-tile:is(:focus-visible,:active) .alba-tile-media img { scale: 1.045; }
  #home #mobileTiles .mobile-tile:is(:focus-visible,:active) .alba-tile-media::after {
    animation: alba-resource-frame .48s ease-out;
  }
}
@media (hover:hover) and (prefers-reduced-motion:no-preference) {
  #home #mobileTiles .mobile-tile:hover .alba-tile-media img { scale: 1.045; }
  #home #mobileTiles .mobile-tile:hover .alba-tile-media::after { animation: alba-resource-frame .48s ease-out; }
}
@keyframes alba-resource-frame {
  from { inset: 6px; opacity: .35; }
  to { inset: 0; opacity: 1; }
}
@media (prefers-reduced-motion:reduce) {
  #home #mobileTiles > .mobile-tile:is(:hover,:focus-visible,:active),
  #home #mobileTiles .mobile-tile:is(:hover,:focus-visible,:active) .alba-tile-media img {
    translate: none; transform: none; scale: none; transition: none;
  }
}

/* Acabado común para las páginas, incluidos los controles creados por JavaScript. */
@media screen {
  :is(header, .ps-banner, .intro, .report-intro, .landing-hero, .alba-tests-heading,
      .mobile-screen-heading, .result-hero, .oca-top, .vf-head) :is(:is(h1,[data-alba-view-title]),h2) {
    text-shadow: 0 2px 1px #05172844, 0 0 22px color-mix(in srgb,var(--wm-light) 22%,transparent);
  }
  :is(.seo-chapter,.ps-study-card,.ps-example-card,.ps-question-card,.report-card,
      .apk-step-card,.req-card,.tm-card,.ps-menu-card,.op-info-card,.op-form-card,
      .alba-stage-card,.alba-history-info-card,.alba-home-download-card,.ent-question-card,
      .question-card,.memory-story-card,.pg-panel,.panel,.map-panel,.pro-resource,
      .game-option,.alba-v5-route,.topic-panel,.apk-download-panel,.apk-security-panel) {
    border-top-color: color-mix(in srgb,var(--wm-light) 58%,#294561);
    box-shadow: inset 0 1px 0 #efffff26, inset 0 -2px 0 #102f5438, 0 7px 17px #03132026;
  }
  :is(button,[role="button"],input[type="submit"],summary,a:is(.back,.primary,.secondary,
      .outline,.solid,.pro-secondary,.alba-v5-cta,.alba-v5-outline,.alba-v5-route,
      .lab-nav-link,.alba-return,.apk-download-link,.tm-practice,.seo-primary,.seo-return,
      [class$="-btn"],[class$="-back"],[class$="-button"],[class$="-link"],[class$="-primary"],
      [class$="-secondary"]),.req-jump a):not(:disabled,[aria-disabled="true"]) {
    --wm-rim: color-mix(in srgb,var(--wm-light) 55%,transparent);
    box-shadow: inset 0 1px 0 #ffffff47, inset 0 -2px var(--wm-rim), 0 3px 9px #00142a26;
  }
  :is(button,[role="button"],input[type="submit"],summary,a[href]):focus-visible {
    outline: 3px solid var(--wm-light);
    outline-offset: 3px;
  }
  :is(button,[role="button"],summary,.lab-nav-link,.tm-card,.ps-menu-card,.game-option):active:not(:disabled) {
    filter: brightness(1.12);
  }
}
@media (hover:hover) and (pointer:fine) {
  :is(button,[role="button"],input[type="submit"],summary,.lab-nav-link,.req-jump a,
      a[class$="-btn"],a[class$="-button"],a[class$="-primary"],a[class$="-secondary"],
      .tm-card,.ps-menu-card,.game-option,.alba-home-download-card,.alba-v5-route,.pro-resource):hover:not(:disabled,[aria-disabled="true"]) {
    box-shadow: inset 0 1px 0 #ffffff68, inset 0 -2px var(--wm-light), 0 3px 14px color-mix(in srgb,var(--wm-light) 32%,transparent);
  }
}
@media (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference) {
  :is(.tm-card,.ps-menu-card,.alba-home-download-card,.alba-v5-route,.pro-resource,.game-option) {
    transition: transform .22s ease-out, box-shadow .22s ease-out;
  }
  :is(.tm-card,.ps-menu-card,.alba-home-download-card,.alba-v5-route,.pro-resource,.game-option):hover {
    transform: perspective(850px) rotateX(2deg) rotateY(-1deg);
  }
  :is(button,[role="button"],summary,.lab-nav-link,.req-jump a):hover:not(:disabled,[aria-disabled="true"]) {
    animation: alba-control-light .38s ease-out;
  }
}
@keyframes alba-control-light { from { filter: brightness(1.16); } to { filter: brightness(1); } }
@media (prefers-reduced-motion:no-preference) {
  :is(.alba-v5-hero,.ps-banner,.seo-hero,.tm-hero,.tm-reader-head,.hero,.op-hero,.pg-hero,
      .req-hero,.report-intro,.intro,.alba-tests-heading,.alba-history-hero,.alba-consistent-hero,
      .games-hero,.themes-hero,.landing-hero,.result-hero,.mobile-screen-heading,.oca-top,.vf-head)::after {
    animation: wm-panel-in .85s ease-out both, alba-header-light 3.4s ease-out 1;
  }
}
@keyframes alba-header-light {
  from { background-position: right -34px top, 0 0; opacity: .2; }
  55% { opacity: 1; }
  to { background-position: right top, 0 0; opacity: .85; }
}
