/* =================================================================
   «EL PLANIFICADOR» (solo portada: lista de page.php en head.php)
   Réplica de material/mockup-planificador.html. Las reglas sin
   .pn--armado son el ESTADO FINAL (sin JS o con movimiento reducido);
   assets/js/plan-portada.js pone .pn--armado (estado inicial) y va
   añadiendo .is-in / .is-ok / .is-hoy con los tiempos de la maqueta.
   Negro #0D1411; verde vivo #1E9E5A solo en texto grande y detalles;
   en texto pequeño, verde oscuro #1A6B40. El gris de la maqueta
   (#7A8A85) se oscurece a #66766F para que el texto pequeño se lea
   (4,8:1 sobre blanco).
   ================================================================= */

.pn {
    --pn-negro: #0D1411;
    --pn-tinta: #3F4F4A;
    --pn-gris: #66766F;
    --pn-verde: #1E9E5A;
    --pn-verde-osc: #1A6B40;
    --pn-naranja: #E8833A;
    --pn-curva: cubic-bezier(0.2, 0.7, 0.2, 1);
    background: #fff;
    color: var(--pn-negro);
    overflow-x: clip;
}

.pn__wrap {
    width: min(1120px, calc(100% - 48px));
    margin-inline: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
    gap: 56px;
    align-items: center;
}

/* ---------- Texto ---------- */

.pn-eye {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--pn-verde-osc);
}
.pn-eye i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--pn-verde);
    box-shadow: 0 0 0 4px rgba(30, 158, 90, 0.15);
}

.pn-h {
    margin: 16px 0 0;
    font-family: var(--opogc-font-title);
    font-size: clamp(36px, 4.4vw, 54px);
    font-weight: 800;
    line-height: 1.03;
    letter-spacing: -0.035em;
    color: var(--pn-negro);
}
.pn-g {
    position: relative;
    display: inline-block;
    color: var(--pn-verde);
}
/* Subrayado que se dibuja de izquierda a derecha. */
.pn-g::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 5px;
    border-radius: 5px;
    background: var(--pn-verde);
    transform-origin: left;
}

.pn-lead {
    margin: 20px 0 0;
    max-width: 470px;
    font-size: 17px;
    line-height: 1.6;
    color: var(--pn-tinta);
}

.pn-list {
    list-style: none;
    margin: 26px 0 0;
    padding: 0;
    display: grid;
    gap: 12px;
}
.pn-list li {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0;
    font-size: 15.5px;
    font-weight: 600;
    color: var(--pn-negro);
}
.pn-list__s {
    font-weight: 500;
    color: var(--pn-gris);
}
.pn-list__ic {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: #F1F6F3;
    color: var(--pn-verde-osc);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
}
.pn-list svg {
    width: 19px;
    height: 19px;
}

.pn-cta {
    display: inline-block;
    margin-top: 28px;
    padding-bottom: 3px;
    color: var(--pn-verde-osc);
    font-size: 15.5px;
    font-weight: 700;
    text-decoration: none;
    border-bottom: 2px solid rgba(26, 107, 64, 0.3);
}
.pn-cta:hover,
.pn-cta:focus-visible {
    color: var(--pn-verde-osc);
    border-color: var(--pn-verde-osc);
}

/* ---------- Composición ---------- */

.pn-stage {
    position: relative;
    height: 640px;
    max-width: 560px;
    width: 100%;
    margin-left: auto;
    perspective: 1300px;
}
.pn-layer {
    position: absolute;
    transition: transform 0.35s var(--pn-curva);
}
.pn-layer--main { left: 0; top: 104px; z-index: 3; }
.pn-layer--week { right: 0; top: 0; z-index: 5; }
.pn-layer--prep { right: 0; top: 460px; z-index: 5; }
.pn-layer--rep { left: 24px; top: 552px; z-index: 6; }

/* Trama de puntitos, difuminada, solo detrás de la composición. */
.pn-dot {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(13, 20, 17, 0.09) 1px, transparent 1.2px);
    background-size: 18px 18px;
    -webkit-mask-image: radial-gradient(closest-side, #000 55%, transparent);
    mask-image: radial-gradient(closest-side, #000 55%, transparent);
    pointer-events: none;
}

/* Tarjeta de cristal. */
.pn-card {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(13, 20, 17, 0.07);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    backdrop-filter: blur(18px) saturate(140%);
    border-radius: 22px;
    box-shadow: 0 24px 50px -18px rgba(13, 40, 25, 0.18), 0 6px 14px rgba(13, 20, 17, 0.04), inset 0 1px 0 #fff;
}

.pn-lbl {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--pn-gris);
}

/* Tu plan de hoy */
.pn-main {
    position: relative;
    width: 400px;
    padding: 24px 22px 20px;
}
.pn-big {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 8px;
}
.pn-big b {
    font-family: var(--opogc-font-title);
    font-size: 56px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
}
.pn-big span {
    font-size: 16px;
    font-weight: 600;
    color: var(--pn-gris);
}
.pn-ring {
    position: absolute;
    right: 20px;
    top: 20px;
}
.pn-ring svg { display: block; }
.pn-ring__t {
    font-family: var(--opogc-font-title);
    font-size: 15px;
    font-weight: 800;
    fill: var(--pn-negro);
}
.pn-ring__fg { transition: stroke-dashoffset 1s var(--pn-curva); }
.pn-bar {
    height: 6px;
    margin: 14px 0 4px;
    border-radius: 6px;
    background: rgba(13, 20, 17, 0.07);
    overflow: hidden;
}
.pn-bar i {
    display: block;
    height: 100%;
    border-radius: 6px;
    background: var(--pn-verde);
    transition: width 0.8s var(--pn-curva);
}
.pn-task {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 9px;
    padding: 11px 12px;
    border-radius: 15px;
    background: #fff;
    border: 1px solid rgba(13, 20, 17, 0.06);
    transition: transform 0.4s;
}
.pn-task__ic {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    background: #EEF4F1;
    color: var(--pn-verde-osc);
    transition: background 0.4s, color 0.4s;
}
.pn-task__ic svg {
    width: 19px;
    height: 19px;
}
.pn-task__t {
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1.35;
}
.pn-task__s {
    margin-top: 2px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
    color: var(--pn-gris);
}
.pn-task__ck {
    margin-left: auto;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #CFD8D4;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    color: #fff;
    transition: all 0.35s var(--pn-curva);
}
.pn-task__ck svg {
    width: 14px;
    height: 14px;
    opacity: 0;
    transform: scale(0.4);
    transition: all 0.35s;
}
.pn-task.is-ok { transform: translateX(3px); }
.pn-task.is-ok .pn-task__ck {
    background: var(--pn-verde);
    border-color: var(--pn-verde);
}
.pn-task.is-ok .pn-task__ck svg {
    opacity: 1;
    transform: none;
}
.pn-task.is-ok .pn-task__ic {
    background: var(--pn-verde);
    color: #fff;
}

/* Tu semana */
.pn-week {
    width: 270px;
    padding: 15px 16px 13px;
}
.pn-days {
    position: relative;
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
}
.pn-days::before {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    top: 12px;
    height: 2px;
    background: rgba(13, 20, 17, 0.08);
}
.pn-days__fill {
    position: absolute;
    left: 12px;
    top: 12px;
    height: 2px;
    background: var(--pn-verde);
    transition: width 1.3s var(--pn-curva);
}
.pn-d {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--pn-gris);
}
.pn-d i {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #D5DED9;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s;
}
.pn-d i svg {
    width: 12px;
    height: 12px;
    color: #fff;
    opacity: 0;
    transition: opacity 0.3s;
}
.pn-d.is-ok i {
    background: var(--pn-verde-osc);
    border-color: var(--pn-verde-osc);
}
.pn-d.is-ok i svg { opacity: 1; }
.pn-d.is-hoy { color: var(--pn-verde-osc); }
.pn-d.is-hoy i {
    border-color: var(--pn-verde);
    box-shadow: 0 0 0 4px rgba(30, 158, 90, 0.15);
}

/* Preparación */
.pn-prep {
    width: 240px;
    padding: 15px 16px 12px;
}
.pn-score {
    display: flex;
    align-items: baseline;
    gap: 5px;
    margin-top: 4px;
}
.pn-score b {
    font-family: var(--opogc-font-title);
    font-size: 38px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--pn-verde-osc);
    font-variant-numeric: tabular-nums;
}
.pn-score span {
    font-size: 13px;
    font-weight: 600;
    color: var(--pn-gris);
}
.pn-chart {
    display: block;
    margin-top: 6px;
}
.pn-chart__yo { stroke-dasharray: 400; stroke-dashoffset: 0; }
.pn-legend {
    display: flex;
    gap: 12px;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--pn-gris);
}
.pn-legend i {
    display: inline-block;
    width: 12px;
    height: 3px;
    margin-right: 4px;
    border-radius: 3px;
    background: var(--pn-verde);
    vertical-align: middle;
}
.pn-legend i.pn-legend__ideal {
    height: 0;
    background: none;
    border-top: 2px dashed #A9B6B1;
}

/* Lo que fallas, vuelve */
.pn-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
}
.pn-chip__ic {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    background: rgba(232, 131, 58, 0.14);
    color: var(--pn-naranja);
}
.pn-chip__ic svg {
    width: 17px;
    height: 17px;
}
.pn-chip small {
    display: block;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--pn-gris);
}

/* =================================================================
   ESTADO INICIAL (.pn--armado, lo pone plan-portada.js) Y ANIMACIÓN
   El texto se anima con .pn__txt.is-in y la composición con
   .pn-stage.is-in (en escritorio, a la vez).
   ================================================================= */

/* Mientras se arma: sin transiciones, para no ver el «rebobinado». */
.pn--quieto *,
.pn--quieto *::before,
.pn--quieto *::after {
    transition: none !important;
}

.pn--armado .pn-g::after {
    transform: scaleX(0);
    transition: transform 0.9s var(--pn-curva) 0.5s;
}
.pn--armado .pn__txt.is-in .pn-g::after { transform: scaleX(1); }

.pn--armado .pn-list li {
    opacity: 0;
    transform: translateX(-14px);
    transition: opacity 0.6s, transform 0.6s var(--pn-curva);
    transition-delay: var(--d, 0s);
}
.pn--armado .pn__txt.is-in .pn-list li {
    opacity: 1;
    transform: none;
}

/* Entrada desenfocada que se enfoca, y flotación. */
.pn--armado .pn-enter {
    opacity: 0;
    filter: blur(12px);
    transform: translateY(30px) scale(0.97);
    transition: opacity 0.8s, filter 0.8s, transform 0.9s var(--pn-curva);
    transition-delay: var(--d, 0s);
    animation: pn-flota 7s ease-in-out infinite;
    animation-delay: var(--fd, 0s);
}
.pn--armado .pn-stage.is-in .pn-enter {
    opacity: 1;
    filter: none;
    transform: none;
}
@keyframes pn-flota {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -8px; }
}

/* La gráfica se dibuja. */
.pn--armado .pn-chart__yo {
    stroke-dashoffset: 400;
    transition: stroke-dashoffset 1.8s var(--pn-curva) 0.4s;
}
.pn--armado .pn-stage.is-in .pn-chart__yo { stroke-dashoffset: 0; }

/* ---------- Tableta y móvil: texto arriba, tarjetas apiladas ---------- */

@media (max-width: 980px) {
    .pn__wrap {
        grid-template-columns: minmax(0, 1fr);
        gap: 36px;
    }
    .pn-stage {
        height: auto;
        perspective: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 14px;
    }
    .pn-layer {
        position: relative;
        left: auto;
        right: auto;
        top: auto;
        width: 100%;
        max-width: 400px;
        transform: none !important;
    }
    .pn-main,
    .pn-week,
    .pn-prep {
        width: 100%;
    }
    .pn-dot { display: none; }
}

/* ---------- Sin movimiento: el estado final, quieto ---------- */

@media (prefers-reduced-motion: reduce) {
    .pn *,
    .pn *::before,
    .pn *::after {
        animation: none !important;
        transition: none !important;
    }
    .pn-layer { transform: none !important; }
}
