/* Encargar. Page layer on top of home.css (the shared site base), newsletter.css (the «Intertítulo» frame, fondo 09)
   and note.css (the Noticia window). Every colour is a --moft-* token; solid fills, hard shadows, kit radii.
   1 · En cuatro actos: four intertitle panels that iris open as they arrive
   2 · El horno: the call to action inside a 1930s enamel oven that heats up on hover (each condition sits on its act as a pill)
   3 · La galería: the frames live in gallery.css (Home shows two of them); tapping one opens its news
   The Intertítulo fans sit in the corners of the act panels and the gallery frames */

.enc-head{display:grid;justify-items:center;gap:var(--moft-space-2);margin-bottom:var(--moft-space-6);text-align:center}
.enc-head__lead{max-width:46ch;margin-top:var(--moft-space-1);text-wrap:balance;font-family:var(--font-display);font-style:italic;font-weight:600;font-variation-settings:"SOFT" 100,"WONK" 1;font-size:18px;line-height:1.45;color:var(--moft-text-brand-on-light)}

/* flat drawing paint (no outlines) */
.c-salty{fill:var(--moft-salty-caramel)}
.c-crema{fill:var(--moft-crema)}
.c-caramelo{fill:var(--moft-caramelo)}
.c-galleta{fill:var(--moft-galleta)}
.c-choc{fill:var(--moft-chocolate)}
.c-choc-l{fill:var(--moft-chocolate-light)}
.c-cacao{fill:var(--moft-cacao)}

/* ---------- 1 · En cuatro actos ---------- */
.acts{display:grid;gap:var(--moft-space-5);margin:0;padding:0;list-style:none}
.act{display:flex;flex-direction:column;gap:var(--moft-space-4)}
.act__body{display:grid;gap:var(--moft-space-2)}
.act__t{text-wrap:balance}
.act__body p{font-size:var(--moft-size-body);line-height:1.55;color:var(--moft-text-on-light)}
/* the condition that belongs to the step: the Noticia tag build */
.act__body .act__pill{justify-self:start;display:inline-flex;align-items:center;min-height:30px;margin-top:var(--moft-space-1);padding:0 var(--moft-space-3);border:2px solid var(--moft-chocolate);border-radius:var(--moft-radius-pill);font-size:var(--moft-size-small);font-weight:var(--moft-weight-black);letter-spacing:.03em;line-height:1.2;color:var(--moft-chocolate)}

/* the panel: a small intertitle, the newsletter frame scaled down: its two rules, crests and corner fans (newsletter.js draws them) */
.act__panel{--frame:6px;--fan:30px;--crest:76px;--nl-ring:var(--moft-salty-caramel);position:relative;isolation:isolate;overflow:hidden;display:grid;justify-items:center;align-content:center;gap:var(--moft-space-1);aspect-ratio:16/10;padding:26px 36px 16px;background:var(--moft-cacao);border-radius:14px;clip-path:circle(75% at 50% 50%);transition:clip-path .8s var(--moft-ease-out)}
.act__panel .nl-frame::before{border-radius:10px}
.act__panel .nl-frame::after{inset:6px;border-radius:6px}
.act__panel .nl-fan--tl{top:6px;left:6px}.act__panel .nl-fan--tr{top:6px;right:6px}
.act__panel .nl-fan--bl{bottom:6px;left:6px}.act__panel .nl-fan--br{bottom:6px;right:6px}
.act__panel>*:not(.nl-frame){position:relative;z-index:2}
.act__n{font-family:var(--font-display);font-style:italic;font-weight:600;font-variation-settings:"SOFT" 100,"WONK" 1;font-size:18px;line-height:1;color:var(--moft-salty-caramel)}
.act__art{display:block;width:100%;max-width:240px;height:auto}
/* iris: closed until the act arrives (encargar.js adds .is-ready to the list, then .is-on to each act once) */
.acts.is-ready .act:not(.is-on) .act__panel{clip-path:circle(0% at 50% 50%)}

@media (min-width:640px){.acts{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (min-width:1024px){.acts{grid-template-columns:repeat(4,minmax(0,1fr))}}

/* drawings: each plays once, after its iris has opened */
.a1__q{transform-origin:44px 80px}.a1__a{transform-origin:170px 94px}
.is-ready .a1__q,.is-ready .a1__a{transform:scale(0)}
.is-on .a1__q{animation:enc-pop .45s var(--moft-ease-out) .55s forwards}
.is-on .a1__dot{animation:enc-hop 1.1s ease-in-out 1s infinite}
.is-on .a1__dot:nth-of-type(3){animation-delay:1.15s}
.is-on .a1__dot:nth-of-type(4){animation-delay:1.3s}
.is-on .a1__a{animation:enc-pop .45s var(--moft-ease-out) 1.7s forwards}

.is-ready .a2__t1,.is-ready .a2__t2,.is-ready .a2__c{transform:translateY(-130px)}
.is-on .a2__t1{animation:enc-drop .6s var(--moft-ease-out) .5s forwards}
.is-on .a2__t2{animation:enc-drop .6s var(--moft-ease-out) .8s forwards}
.is-on .a2__c{animation:enc-drop .6s var(--moft-ease-out) 1.05s forwards}
.a2__fl{transform-origin:100px 21px}
.is-on .a2__fl{animation:enc-flame .6s steps(2) 1.6s infinite}
.a2__sw{transform-box:fill-box;transform-origin:center}
.is-ready .a2__sw{transform:scale(0)}
.is-on .a2__sw{animation:enc-pop .35s var(--moft-ease-out) 1.4s forwards}
.is-on .a2__sw:nth-of-type(2){animation-delay:1.5s}
.is-on .a2__sw:nth-of-type(3){animation-delay:1.6s}
.a2__gl,.a4__gl{visibility:hidden}
.is-on .a2__gl,.is-on .a4__gl{animation:enc-twinkle 1.4s steps(1) 1.6s infinite}

.a3__ring{fill:none;stroke:var(--moft-salty-caramel);stroke-width:3;stroke-linecap:round;stroke-dasharray:1;stroke-dashoffset:0}
.is-ready .a3__ring{stroke-dashoffset:1}
.is-on .a3__ring{animation:enc-draw .7s ease-in-out .6s forwards}
.a3__pct{font-family:var(--font-display);font-weight:900;font-size:17px;fill:var(--moft-cacao)}
.a3__coin{transform-box:fill-box;transform-origin:center}
.is-ready .a3__coin{transform:translateX(90px) rotate(200deg)}
.is-on .a3__coin{animation:enc-roll .8s var(--moft-ease-out) 1.2s forwards}

.is-ready .a4__box{transform:translateX(150px)}
.is-on .a4__box{animation:enc-slide .8s var(--moft-ease-out) .5s forwards}

@keyframes enc-pop{0%{transform:scale(0)}70%{transform:scale(1.08)}100%{transform:scale(1)}}
@keyframes enc-hop{0%,60%,100%{transform:translateY(0)}30%{transform:translateY(-5px)}}
@keyframes enc-drop{0%{transform:translateY(-130px)}75%{transform:translateY(3px)}100%{transform:translateY(0)}}
@keyframes enc-flame{50%{transform:scale(.85,1.12)}}
@keyframes enc-twinkle{0%{visibility:visible}50%{visibility:hidden}}
@keyframes enc-draw{to{stroke-dashoffset:0}}
@keyframes enc-roll{to{transform:none}}
@keyframes enc-slide{0%{transform:translateX(150px)}75%{transform:translateX(-6px)}100%{transform:translateX(0)}}

/* ---------- 2 · El horno ----------
   A 1930s enamel range, built like the Home TV: galleta enamel, cacao outlines, the kit's hard shadow, no lettering.
   · crest: two stepped chocolate tiers (the Deco step of the Intertítulo crest) carrying the round timer
   · panel: a chocolate band with four porcelain knobs, the pilot jewel in the middle and streamline rules at the ends
   · door: lighter enamel, salty caramel handle on two standoffs, the window with a sunburst inside (the Cacao and
     Chocolate sunburst of the fondos), two heating elements, a glass glint in the corner
   · drawer and two legs
   Pre-heat (.is-hot, added once when the oven comes into view, on every device), in order: the pilot clicks on, two
   knobs turn, the timer hand sweeps over a caramelo arc, the elements glow, the sunburst warms from cacao to chocolate
   and caramelo deep, then the timer gives a little "ready" jump. Solid colours only; the sunburst colours are registered
   properties so the warm-up is a smooth swap between kit colours. After that it never goes still: the needle
   keeps moving and the light inside slowly goes off and on. */
@property --ray-a{syntax:"<color>";inherits:true;initial-value:#3A1700}
@property --ray-b{syntax:"<color>";inherits:true;initial-value:#3F220D}
.oven{--t:.7s;--ray-a:var(--moft-cacao);--ray-b:var(--moft-element-cacao-texture);position:relative;max-width:580px;margin-inline:auto}
@media (min-width:1024px){.oven{max-width:740px}}
.oven.is-hot{--ray-a:var(--moft-chocolate);--ray-b:var(--moft-caramelo-deep)}

.oven__crest{position:relative;display:grid;justify-items:center;height:74px}
.oven__tier{position:absolute;bottom:-3px;background:var(--moft-chocolate);border:3px solid var(--moft-cacao);border-bottom:0}
.oven__tier--1{width:64%;height:30px;border-radius:16px 16px 0 0}
.oven__tier--2{bottom:24px;width:36%;height:26px;border-radius:14px 14px 0 0}
.oven__dial{position:absolute;z-index:1;top:0;width:62px;height:62px;overflow:visible;filter:drop-shadow(2px 3px 0 var(--moft-chocolate-deep))}
.oven__dial-face{fill:var(--moft-crema);stroke:var(--moft-cacao);stroke-width:3}
.oven__dial-arc{fill:none;stroke:var(--moft-caramelo);stroke-width:5;stroke-linecap:round;stroke-dasharray:1;stroke-dashoffset:1;transition:stroke-dashoffset var(--t) var(--moft-ease-out)}
.oven__dial-ticks path,.oven__dial-hand path{fill:none;stroke:var(--moft-cacao);stroke-width:3;stroke-linecap:round}
.oven__dial-hand{transform-origin:32px 32px;transform:rotate(0deg);transition:transform var(--t) var(--moft-ease-out)}
.oven__dial-hub{fill:var(--moft-cacao)}
.oven.is-hot .oven__dial-arc{stroke-dashoffset:.25}
.oven.is-hot .oven__dial-hand{transform:rotate(270deg)}

.oven__body{position:relative;display:grid;grid-template-columns:minmax(0,1fr);gap:12px;padding:12px;background:var(--moft-galleta);border:3px solid var(--moft-cacao);border-radius:26px;box-shadow:var(--sh-panel) var(--moft-chocolate-deep)}
/* the knobs close up on narrow screens (never closer than their caramel rings allow) so the panel always fits the oven */
.oven__panel{position:relative;display:flex;align-items:center;justify-content:center;gap:clamp(16px,5vw,28px);padding:16px clamp(36px,10vw,56px);background:var(--moft-chocolate);border:3px solid var(--moft-cacao);border-radius:16px}
.oven__panel::before,.oven__panel::after{content:"";position:absolute;top:calc(50% - 8px);width:30px;height:16px;background:repeating-linear-gradient(to bottom,var(--moft-salty-caramel) 0 2px,var(--moft-chocolate) 2px 7px)}
.oven__panel::before{left:14px}.oven__panel::after{right:14px}
.oven__knob{position:relative;flex:none;width:24px;height:24px;border-radius:50%;background:var(--moft-crema);box-shadow:0 0 0 3px var(--moft-cacao),0 0 0 6px var(--moft-salty-caramel),0 0 0 8px var(--moft-cacao);transition:transform var(--t) var(--moft-ease-out)}
.oven__knob::after{content:"";position:absolute;left:calc(50% - 2px);top:2px;width:4px;height:9px;border-radius:2px;background:var(--moft-cacao)}
.oven.is-hot .oven__knob:nth-child(2),.oven.is-hot .oven__knob:nth-child(4){transform:rotate(135deg)}
.oven__pilot{position:relative;flex:none;width:16px;height:16px;border-radius:50%;background:var(--moft-galleta-deep);border:3px solid var(--moft-cacao);transition:background var(--t)}
.oven__pilot::after{content:"";position:absolute;top:2px;left:2px;width:4px;height:4px;border-radius:50%;background:var(--moft-galleta-light)}
.oven.is-hot .oven__pilot{background:var(--moft-caramelo)}

.oven__door{position:relative;padding:30px 12px 12px;background:var(--moft-galleta-light);border:3px solid var(--moft-cacao);border-radius:20px}
.oven__handle{position:absolute;top:8px;left:20%;right:20%;height:12px;border-radius:var(--moft-radius-pill);background:var(--moft-salty-caramel);border:3px solid var(--moft-cacao)}
.oven__handle::before,.oven__handle::after{content:"";position:absolute;top:calc(50% - 3px);width:6px;height:6px;border-radius:50%;background:var(--moft-cacao)}
.oven__handle::before{left:6px}.oven__handle::after{right:6px}
.oven__window{position:relative;overflow:hidden;isolation:isolate;display:grid;grid-template-columns:minmax(0,1fr);justify-items:center;gap:var(--moft-space-3);padding:var(--moft-space-3) var(--moft-space-4) var(--moft-space-3);border:3px solid var(--moft-cacao);border-radius:14px;box-shadow:inset 0 0 0 4px var(--moft-chocolate);background:repeating-conic-gradient(from -90deg at 50% 118%,var(--ray-a) 0 6deg,var(--ray-b) 6deg 12deg);transition:--ray-a var(--t) var(--moft-ease-out),--ray-b var(--t) var(--moft-ease-out);text-align:center}
/* glass glint: two short diagonal strokes in the top left corner */
.oven__window::before,.oven__window::after{content:"";position:absolute;z-index:-1;top:-10px;height:70px;background:var(--moft-chocolate);transform:rotate(35deg);transform-origin:top left}
.oven__window::before{left:28px;width:10px}.oven__window::after{left:46px;width:4px}
.oven.is-hot .oven__window::before,.oven.is-hot .oven__window::after{background:var(--moft-caramelo)}
.oven__coil{display:block;width:calc(100% + 8px);height:16px;margin-inline:-4px}
.oven__coil path{fill:none;stroke:var(--moft-chocolate);stroke-width:4;stroke-linejoin:round;stroke-linecap:round;transition:stroke var(--t)}
.oven.is-hot .oven__coil path{stroke:var(--moft-salty-caramel);animation:oven-glow 1.2s steps(1) var(--t) infinite}
@keyframes oven-glow{50%{stroke:var(--moft-caramelo-light)}}

/* pre-heat order: these timings only apply on the way up */
.oven.is-hot .oven__pilot{transition:background .1s;animation:oven-click .35s var(--moft-ease-out)}
.oven.is-hot .oven__knob:nth-child(2){transition:transform .5s var(--moft-ease-out) .3s}
.oven.is-hot .oven__knob:nth-child(4){transition:transform .5s var(--moft-ease-out) .5s}
.oven.is-hot .oven__dial-hand{transition:transform 1.2s var(--moft-ease-in-out) .8s}
.oven.is-hot .oven__dial-arc{transition:stroke-dashoffset 1.2s var(--moft-ease-in-out) .8s}
.oven.is-hot .oven__coil path{transition:stroke .4s 1.3s;animation-delay:1.9s}
.oven.is-hot .oven__window{transition:--ray-a 1s var(--moft-ease-out) 1.5s,--ray-b 1s var(--moft-ease-out) 1.5s}
.oven.is-hot .oven__window::before,.oven.is-hot .oven__window::after{transition:background .3s 1.7s}
.oven.is-hot .oven.is-hot .oven__dial{animation:oven-ready .6s var(--moft-ease-out) 2.3s}
/* once hot, it stays alive: the timer needle and its arc keep wandering round the bake mark, and the light inside
   slowly goes off and on again: long soft fades between the dark sunburst and the lit one, with a pause at each end */
.oven.is-hot .oven__dial-hand{animation:oven-needle 3.4s ease-in-out 2.9s infinite}
.oven.is-hot .oven__dial-arc{animation:oven-arc 3.4s ease-in-out 2.9s infinite}
.oven.is-hot .oven__window{animation:oven-breathe 7s ease-in-out 3.5s infinite}
.oven.is-hot .oven__window::before,.oven.is-hot .oven__window::after{animation:oven-glint 7s ease-in-out 3.5s infinite}
@keyframes oven-needle{0%,100%{transform:rotate(270deg)}20%{transform:rotate(246deg)}45%{transform:rotate(292deg)}70%{transform:rotate(258deg)}85%{transform:rotate(284deg)}}
@keyframes oven-arc{0%,100%{stroke-dashoffset:.25}20%{stroke-dashoffset:.32}45%{stroke-dashoffset:.19}70%{stroke-dashoffset:.28}85%{stroke-dashoffset:.21}}
@keyframes oven-breathe{0%,30%,100%{--ray-a:var(--moft-chocolate);--ray-b:var(--moft-caramelo-deep)}50%,80%{--ray-a:var(--moft-cacao);--ray-b:var(--moft-element-cacao-texture)}}
@keyframes oven-glint{0%,30%,100%{background:var(--moft-caramelo)}50%,80%{background:var(--moft-chocolate)}}
@keyframes oven-click{0%{transform:scale(1)}40%{transform:scale(1.35)}100%{transform:scale(1)}}
@keyframes oven-ready{0%,100%{transform:none}30%{transform:translateY(-7px) rotate(-8deg)}65%{transform:translateY(0) rotate(5deg)}}
.oven.is-hot .oven__t{color:var(--moft-crema);text-wrap:balance}
.oven__lead{font-weight:var(--moft-weight-medium);color:var(--moft-crema)}
.oven__btns{display:flex;flex-wrap:wrap;justify-content:center;gap:var(--moft-space-3);width:100%;margin-top:var(--moft-space-1)}
.oven__btns .moft-btn{justify-content:center;width:272px;max-width:100%;min-height:48px;padding-inline:16px;white-space:nowrap}
.oven .btn-generic{border-color:var(--moft-salty-caramel);color:var(--moft-crema)}
@media (hover:hover){.oven .btn-generic:hover{background:var(--moft-salty-caramel);color:var(--moft-tiramisu)}}

.oven__drawer{position:relative;height:34px;background:var(--moft-galleta-light);border:3px solid var(--moft-cacao);border-radius:12px}
.oven__drawer::after{content:"";position:absolute;top:calc(50% - 5px);left:38%;right:38%;height:10px;border-radius:var(--moft-radius-pill);background:var(--moft-salty-caramel);border:2px solid var(--moft-cacao)}
.oven__legs{display:flex;justify-content:space-between;padding:0 34px}
.oven__legs i{display:block;width:30px;height:18px;margin-top:-3px;background:var(--moft-chocolate);border:3px solid var(--moft-cacao);border-top:0;border-radius:0 0 12px 12px}

@media (max-width:479px){
  .oven__body{padding:10px;border-radius:22px}
  .oven__panel::before,.oven__panel::after{width:20px}
  .oven__panel::before{left:10px}.oven__panel::after{right:10px}
  .oven__door{padding:28px 8px 8px}
  .oven__window{padding-inline:12px}
  /* the two buttons take the window's width and may wrap onto two lines rather than push the oven wider */
  .oven__btns{display:grid;grid-auto-rows:1fr}
  .oven__btns .moft-btn{width:100%;white-space:normal;text-align:center;line-height:1.2;padding-block:10px}
}
@media (min-width:640px){.oven__window{padding:var(--moft-space-4) var(--moft-space-6)}.oven__door{padding:32px 18px 18px}}

/* ---------- 3 · La galería: gallery.css (shared with Home) ---------- */
.enc-note__foot{display:flex;flex-wrap:wrap;gap:var(--moft-space-3)}

@media (prefers-reduced-motion:reduce){
  .act__panel{transition:none}
  .acts.is-ready .act:not(.is-on) .act__panel{clip-path:none}
  .is-ready :is(.a1__q,.a1__a,.a2__t1,.a2__t2,.a2__c,.a2__sw,.a3__coin,.a4__box){animation:none !important;transform:none !important}
  .is-ready :is(.a1__dot,.a2__fl,.a2__gl,.a4__gl){animation:none !important;visibility:visible}
  .is-ready .a3__ring{stroke-dashoffset:0}
  .oven,.oven *{animation:none !important;transition:none !important}
}
