/* Home (9 Oct 2026, task "portada"): the forest video band, the Durin door behind the title,
   the question in English and Quenya, and four floating cards, one per menu part.
   Behaviour (videos, card effects, opening the guide) lives in js/15.js. */

body.guide-home #guide-library.home{max-width:none;margin:0;padding:0;min-height:0}

/* ---------- Forest band ---------- */
.home-band{position:relative;height:clamp(320px,44vw,560px);overflow:hidden;-webkit-mask-image:linear-gradient(180deg,#000 62%,transparent 100%);mask-image:linear-gradient(180deg,#000 62%,transparent 100%)}
.home-poster,.home-forest{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.home-band::after{content:"";position:absolute;inset:0;background:linear-gradient(180deg,rgba(6,12,10,.05) 0%,rgba(6,12,10,.25) 50%,rgba(6,12,10,.6) 100%);pointer-events:none}
/* Durin's door: a black-background clip, so "screen" leaves only its lines. Secondary: small and faint. */
.home-door,.home-door-still{position:absolute;z-index:1;top:-2%;left:50%;height:100%;width:auto;aspect-ratio:16/9;max-width:none;object-fit:contain;transform:translateX(-50%);mix-blend-mode:screen;filter:contrast(1.3) brightness(1.1);opacity:.5;pointer-events:none}
.home-door-still{display:none}
/* Pause button for the band's videos (js/15.js); hidden when motion is off, since the band is then still. */
.home-pause{all:unset;box-sizing:border-box;position:absolute;z-index:3;top:14px;right:14px;width:36px;height:36px;display:grid;place-items:center;border-radius:50%;cursor:pointer;
 background:rgba(6,12,10,.45);border:1px solid rgba(185,200,212,.28);color:#d6e4dc;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);transition:border-color .2s,color .2s}
.home-pause svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
.home-pause .i-play{display:none;fill:currentColor;stroke-width:1.5}
.home.is-paused .home-pause .i-pause{display:none}.home.is-paused .home-pause .i-play{display:inline}
@media (hover:hover) and (pointer:fine){.home-pause:hover{border-color:rgba(162,221,192,.7);color:var(--text)}}
.home-pause:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
.home.no-motion .home-pause{display:none}
.home.is-still .home-door{display:none}
.home.is-still .home-door-still{display:block}
/* The title sits inside the door, between its star (~49 % of the frame) and the letter on its lower third (~62 %):
   the frame starts at -2 % of the band, so their midpoint is ~53.5 % of the band height. --h1 is the title size. */
.home-head{--h1:clamp(44px,7vw,84px);position:absolute;z-index:2;left:16px;right:16px;top:calc(53.5% - var(--h1)*.48);display:grid;gap:12px;justify-items:center;text-align:center}
#guide-library .home-head h1{margin:0;font-size:var(--h1);font-weight:900;letter-spacing:-.03em;line-height:.95;color:var(--text);text-shadow:0 4px 30px rgba(0,0,0,.65)}
.home-eyebrow{margin:0;font-size:11px;font-weight:700;letter-spacing:.16em;text-transform:uppercase;color:var(--accent);text-shadow:0 1px 3px #000,0 0 14px rgba(0,0,0,.95)}
.home-eyebrow b{color:var(--text);letter-spacing:0;text-transform:none}

/* ---------- Question and cards (they rise over the end of the band) ---------- */
.home-body{position:relative;z-index:2;margin-top:clamp(-150px,-11vw,-80px);padding:0 clamp(16px,4vw,48px) clamp(40px,5vw,64px)}
.home-q{margin:0;text-align:center;font-size:clamp(20px,2.4vw,30px);font-weight:700;color:var(--text);text-shadow:0 2px 14px rgba(0,0,0,.7)}
/* The question in Quenya, written in Tengwar (Alcarin Tengwar, OFL, self-hosted; Free Tengwar mapping in the
   private use area), in gold: the warm complement of the guide's mint. Screen readers get the Latin form. */
@font-face{font-family:"Alcarin Tengwar";src:url(../assets/fonts/AlcarinTengwar-Bold.woff2) format("woff2");font-weight:700;font-display:block;unicode-range:U+E000-E0FF}
.home-elv{margin:8px 0 clamp(22px,3vw,34px);text-align:center;font:700 clamp(24px,2.6vw,34px)/1.3 "Alcarin Tengwar",serif;letter-spacing:.03em;color:var(--gn-gold);text-shadow:0 0 18px rgba(240,215,122,.35),0 2px 10px rgba(0,0,0,.8)}
.home-cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:clamp(14px,1.8vw,24px);max-width:1180px;margin:0 auto}

/* The hovered card rises above its neighbours, so its 5 % zoom is never covered. */
.home-float{position:relative;z-index:1}
.home-float:hover,.home-float:focus-within{z-index:3}
.home-card{all:unset;box-sizing:border-box;cursor:pointer;display:grid;grid-template-rows:auto 1fr;width:100%;height:100%;border-radius:18px;background:#13212a;border:1px solid #2f4855;box-shadow:0 18px 40px rgba(0,0,0,.45);transition:transform .35s cubic-bezier(.2,.8,.2,1),box-shadow .35s ease,border-color .35s ease}
.home-art{position:relative;display:block;height:clamp(120px,11vw,160px);border-radius:18px 18px 0 0;filter:saturate(.92) brightness(.85);transition:filter .35s ease}
/* Illustration only (Scryfall art crop), framed by its focal point; it fades into the card with a mask, no seam. */
.home-art-clip{position:absolute;inset:0;overflow:hidden;border-radius:inherit;-webkit-mask-image:linear-gradient(180deg,#000 38%,rgba(0,0,0,.55) 68%,transparent 100%);mask-image:linear-gradient(180deg,#000 38%,rgba(0,0,0,.55) 68%,transparent 100%)}
.home-art-img{position:absolute;inset:-7%;background:var(--img) var(--pos,50% 30%)/cover no-repeat;transform-origin:var(--focus,50% 50%);transform:perspective(700px) translate3d(var(--px,0px),var(--py,0px),0) rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg)) scale(var(--s,1));transition:transform .5s cubic-bezier(.2,.8,.2,1)}
.home-ic{position:absolute;z-index:1;left:16px;bottom:-14px;width:40px;height:40px;border-radius:12px;display:grid;place-items:center;background:#0d1a20;border:1px solid #2f4855;color:var(--accent);transition:color .35s,border-color .35s}
.home-ic svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.home-txt{display:grid;align-content:start;gap:8px;padding:24px 18px 20px}
.home-part{font-size:11px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:var(--accent)}
.home-title{font-size:21px;font-weight:800;letter-spacing:-.01em;line-height:1.15;color:var(--text)}
.home-desc{font-size:14px;line-height:1.5;color:#b7c8cf}
.home-secs{margin-top:2px;font-size:12.5px;line-height:1.55;color:#8fa6ae}
/* Hover and keyboard focus: 5 % larger, lifted, gold edge and a gold halo with a touch of mint. */
.home-card:hover,.home-card:focus-visible{transform:translateY(-6px) scale(1.05);border-color:var(--gn-gold);box-shadow:0 0 0 1px rgba(240,215,122,.55),0 0 34px 6px rgba(240,215,122,.38),-10px 0 40px 2px rgba(120,222,153,.22),0 24px 50px rgba(0,0,0,.5)}
.home-card:hover .home-art,.home-card:focus-visible .home-art{filter:saturate(1.05) brightness(1)}
.home-card:hover .home-ic,.home-card:focus-visible .home-ic{color:var(--gn-gold);border-color:var(--gn-gold)}

/* ---------- Tablets: two by two ---------- */
@media (max-width:980px){.home-cards{grid-template-columns:repeat(2,minmax(0,1fr))}}
/* ---------- Phones: horizontal cards, the art in a strip on the left ---------- */
@media (max-width:600px){
  .home-band{height:300px}
  .home-body{margin-top:-62px}
  .home-cards{grid-template-columns:1fr;gap:12px}
  .home-card{grid-template-columns:104px minmax(0,1fr);grid-template-rows:none;border-radius:16px}
  .home-art{height:auto;min-height:100%;border-radius:16px 0 0 16px}
  .home-art-img{background-position:var(--mpos,50% 50%)}
  .home-art-clip{-webkit-mask-image:linear-gradient(90deg,#000 45%,rgba(0,0,0,.5) 75%,transparent 100%);mask-image:linear-gradient(90deg,#000 45%,rgba(0,0,0,.5) 75%,transparent 100%)}
  .home-ic{left:auto;right:-14px;bottom:auto;top:12px;width:32px;height:32px;border-radius:10px}
  .home-ic svg{width:18px;height:18px}
  .home-txt{padding:14px 14px 14px 22px;gap:5px}
  .home-part{font-size:11px}
  .home-title{font-size:17px}
  .home-desc{font-size:13px;line-height:1.45}
  .home-secs{font-size:12px;line-height:1.45}
}

/* ---------- Still: reduced motion (unless the visitor switched animations on) or animations off ---------- */
@media (prefers-reduced-motion:reduce){
  :root:not(.motion-on) .home-card,:root:not(.motion-on) .home-art-img{transition:none}
  :root:not(.motion-on) .home-card:hover,:root:not(.motion-on) .home-card:focus-visible{transform:none}
}
:root.motion-off .home-card,:root.motion-off .home-art-img{transition:none}
:root.motion-off .home-card:hover,:root.motion-off .home-card:focus-visible{transform:none}

/* Search entry (runkor, 11 Oct 2026): under the question and the Tengwar line, above the cards; it opens the guide's
   search (js/18.js). Glassy, so it sits in the scene rather than reading as a form field; same corner radius as the
   cards below it (18 px, 16 px on phones). */
.home-search{all:unset;box-sizing:border-box;cursor:pointer;display:flex;align-items:center;gap:10px;width:min(520px,100%);margin:-6px auto clamp(22px,3vw,30px);
 padding:12px 14px 12px 16px;border-radius:18px;background:rgba(10,18,24,.72);border:1px solid rgba(162,221,192,.32);color:#9fb3c1;font-size:15px;
 -webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);box-shadow:0 0 0 1px rgba(0,0,0,.3),0 10px 30px rgba(0,0,0,.35);transition:border-color .2s ease,color .2s ease}
.home-search svg{width:18px;height:18px;flex:none;fill:none;stroke:var(--accent);stroke-width:2;stroke-linecap:round}
.home-search span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.home-search kbd{font:600 11px/1 inherit;padding:3px 6px;border-radius:5px;border:1px solid rgba(185,200,212,.25);color:#8fa3b2}
.home-search:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
@media (hover:hover) and (pointer:fine){.home-search:hover{border-color:rgba(162,221,192,.6);color:var(--text)}}
.home-search:active{transform:scale(.99)}
@media (max-width:600px){.home-search{font-size:14px;padding:11px 14px;border-radius:16px}.home-search kbd{display:none}}

/* Short screens (audit, 11 Oct 2026): on a 1366×768 laptop the 560 px band pushed the cards below the fold.
   Below 860 px of height the band leaves about 380 px for the question and the cards. Phones keep their layout. */
@media (min-width:601px) and (max-height:860px){.home-band{height:clamp(320px,min(44vw,calc(100svh - 380px)),560px)}
 .home-body{margin-top:-44px}.home-elv{margin-bottom:18px}.home-search{margin-bottom:18px}}
