/* KS3 home (/ks3): ported from the prototype's index.html, scoped under .pg-home */
.pg-home {
    /* ---------- hero ---------- */
    .hero { padding-block: 18px 70px; }
    .hero .top { display: grid; grid-template-columns: 1.1fr .9fr; gap: 20px 40px; align-items: end; }
    .hero h1 { font-size: clamp(2.6rem, 7.4vw, 5.4rem); margin: 14px 0 0; }
    .hero .lede { margin: 0; font-size: 1.15rem; }
    .hero .lede b { font-weight: 600; }
    .hero .lede a { color: inherit; font-weight: 600; text-decoration-thickness: 2px; text-underline-offset: 3px; }
    .keyart { position: relative; margin-top: 34px; }
    .keyart .paper { background: var(--label); padding: 10px; box-shadow: 0 12px 26px rgba(40,25,5,.35); transform: rotate(-.8deg); }
    .keyart .paper img { width: 100%; aspect-ratio: 16 / 8.2; object-fit: cover; object-position: 50% 60%; }
    .keyart .tape.a { top: -12px; left: 8%; transform: rotate(-8deg); }
    .keyart .tape.b { top: -10px; right: 10%; transform: rotate(6deg); }
    .keyart .stk { position: absolute; width: clamp(56px, 8vw, 92px); filter: drop-shadow(0 4px 4px rgba(0,0,0,.25)); }
    .keyart .note { position: absolute; left: 3%; bottom: -26px; --torn-bg: #fff8e8; font: 700 1.4rem/1 var(--f-hand); transform: rotate(-3deg); }
    .ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 50px; }

    /* ---------- trailer ---------- */
    .trailer { padding-block: 70px 80px; }
    .trailer .wrap { display: grid; grid-template-columns: .9fr 1.1fr; gap: 40px; align-items: center; }
    .trailer .kicker { font-size: .85rem; --torn-bg: var(--mustard); }
    .trailer h2 { margin: 16px 0 12px; color: var(--label); }
    .trailer p { color: #dfe4f4; margin: 0 0 18px; max-width: 46ch; }
    .trailer .frame.soon .stamp { font-size: 1.1rem; }

    /* ---------- where the trail goes ---------- */
    .route { padding-block: 70px 60px; }
    /* unit highlight: one unit in the spotlight, with its trailer */
    .highlight { padding-block: 60px 44px; }
    .highlight .kicker { font-size: .9rem; --torn-bg: var(--hach-yellow); }
    .highlight .hl { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 36px; align-items: center; margin-top: 18px;
      background: #fffdf6; padding: 26px 28px; box-shadow: 0 10px 24px rgba(40,25,5,.22); border-top: 10px solid var(--c); }
    .highlight .when { font: 400 .8rem/1 var(--f-label); letter-spacing: .08em; color: var(--c); filter: brightness(.8); }
    .highlight h2 { font: 400 clamp(1.6rem, 3.4vw, 2.4rem)/1.05 var(--f-slab); margin: 8px 0 14px; }
    .highlight h3 { font: 400 .8rem/1 var(--f-label); letter-spacing: .08em; color: #8a6f4c; margin: 0 0 6px; }
    .highlight ul { margin: 0 0 14px; padding-left: 1.1em; display: grid; gap: 4px; }
    .highlight .terms { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
    .highlight .terms span { font-size: .85rem; background: #efe3cb; padding: 3px 9px; }
    .highlight .acts { display: flex; flex-wrap: wrap; gap: 10px; }
    .highlight .film { position: relative; }
    .highlight .film .stk { position: absolute; z-index: 2; width: 92px; left: -26px; top: -34px; transform: rotate(-9deg); filter: drop-shadow(0 4px 4px rgba(0,0,0,.3)); }
    .highlight .film .cap { font: 700 1.2rem/1.2 var(--f-hand); color: #5b3a1a; margin: 10px 0 0; text-align: center; }
    @media (max-width: 860px) { .highlight .hl { grid-template-columns: 1fr; padding: 22px 18px; } .highlight .film .stk { left: -8px; } }
    .route .row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 26px; }
    .leg { position: relative; padding: 18px 16px 16px; color: #fff; text-decoration: none; display: grid; gap: 8px; min-height: 200px; box-shadow: 0 6px 14px rgba(0,0,0,.18); transition: transform .15s; }
    .leg:hover { transform: translateY(-4px) rotate(-.5deg); }
    .leg.gs { background: #c29c6e url(/img/tile_kraft.webp) 0 0/1200px auto repeat; color: var(--ink); }
    .leg .torn { justify-self: start; font-size: .82rem; }
    .leg h3 { font: 400 1.3rem/1.1 var(--f-slab); text-shadow: 0 2px 0 rgba(0,0,0,.2); }
    .leg.gs h3 { text-shadow: none; }
    .leg .stks { display: flex; gap: 4px; margin-top: auto; align-items: flex-end; }
    .leg .stks img { width: 31%; max-width: 72px; height: 64px; object-fit: contain; filter: drop-shadow(0 3px 3px rgba(0,0,0,.25)); }   /* keep each sticker's own shape */
    .leg .stks img:nth-child(2) { transform: rotate(6deg) translateY(-6px); } .leg .stks img:nth-child(3) { transform: rotate(-5deg); }
    .leg .flag { width: 4px; height: 56px; background: var(--ink); position: relative; margin: auto 0 0 20px; }
    .leg .flag::after { content: "GCSE"; position: absolute; left: 4px; top: 0; background: var(--coral); color: #fff; font: 400 .9rem/1 var(--f-label); padding: 8px 14px 6px 8px; clip-path: polygon(0 0, 100% 0, 86% 50%, 100% 100%, 0 100%); }

    /* ---------- guides ---------- */
    .guides { padding-block: 36px 70px; }   /* the highlight above is kraft too, so no torn edge between them */
    .guides .head { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: end; }
    .guides .head p { margin: 10px 0 0; max-width: 58ch; }
    .people { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 150px; align-items: start; }
    .pass { position: relative; background: #fffdf6; box-shadow: 0 8px 20px rgba(40,25,5,.18); padding: 0 0 22px; }
    .pass:nth-child(1) { transform: rotate(-.6deg); } .pass:nth-child(2) { transform: rotate(.6deg); margin-top: 34px; }
    .pass .band { height: 150px; position: relative; }
    .pass.ada .band { background: var(--coral) url(/img/tile_pink.webp) 0 0/1200px auto repeat; background-blend-mode: multiply; }
    .pass.rory .band { background: var(--teal) url(/img/tile_teal.webp) 0 0/1200px auto repeat; }
    .pass .portrait { position: absolute; right: 14px; bottom: -40px; width: auto; height: 300px; max-width: 52%; object-fit: contain; object-position: bottom; filter: drop-shadow(0 6px 6px rgba(0,0,0,.25)); }
    .pass .tape { top: -12px; left: 24px; transform: rotate(-5deg); }
    .pass .id { position: absolute; left: 22px; bottom: 18px; }
    .pass .id .role { font-size: .8rem; }
    .pass h3 { font: 400 clamp(2rem, 4vw, 2.8rem)/1 var(--f-slab); color: #fff; margin-top: 8px; text-shadow: 0 3px 0 rgba(0,0,0,.2); }
    .pass .motto { font: 700 2.3rem/1 var(--f-hand); color: var(--mc); padding: 22px 22px 0; max-width: 54%; min-height: 84px; transform: rotate(-2deg); transform-origin: left center; }
    .pass.ada { --mc: var(--coral); } .pass.rory { --mc: var(--teal); }
    .pass .intro { padding: 10px 22px 0; margin: 0; }
    .pass dl { margin: 14px 22px 0; display: grid; gap: 12px; }
    .pass dt { font: 400 .78rem/1 var(--f-label); letter-spacing: .08em; color: #8a6f4c; }
    .pass dd { margin: 4px 0 0; font-size: .96rem; }
    .fav { display: flex; gap: 12px; align-items: center; text-decoration: none; }
    .fav img { width: 58px; height: 58px; object-fit: contain; transform: rotate(-6deg); filter: drop-shadow(0 3px 3px rgba(0,0,0,.2)); }
    .fav span { text-decoration: underline; text-decoration-color: rgba(29,36,72,.3); text-underline-offset: 3px; }
    .fetch { display: grid; grid-template-columns: auto 1fr; gap: 26px; align-items: center; margin-top: 44px; background: #fffdf6; padding: 20px 26px; box-shadow: 0 8px 20px rgba(40,25,5,.16); position: relative; transform: rotate(-.3deg); }
    .fetch img { width: 150px; }
    .fetch h3 { font: 400 1.9rem/1 var(--f-slab); }
    .fetch h3 small { font: 400 .8rem/1 var(--f-label); letter-spacing: .06em; color: #8a6f4c; margin-left: 10px; vertical-align: middle; }
    .fetch p { margin: 8px 0 0; }
    .together { margin-top: 44px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
    .together > div { background: rgba(255,255,255,.55); padding: 14px 16px; display: grid; gap: 6px; }
    .together .who { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
    .together b { font: 400 .82rem/1.2 var(--f-label); letter-spacing: .04em; }
    .together .ada b { color: var(--coral); } .together .rory b { color: var(--teal); }
    .together .and { font: 700 1.1rem/1 var(--f-hand); color: #8a6f4c; }
    /* character trait badge in its house colour, with the house animal */
    .tb { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 2px 3px; border-radius: 999px; background: var(--hc); color: #fff;
          font: 400 .68rem/1 var(--f-label); letter-spacing: .06em; white-space: nowrap; box-shadow: 0 2px 0 rgba(0,0,0,.15); }
    .tb img { width: 20px; height: 20px; object-fit: contain; background: rgba(255,255,255,.25); border-radius: 50%; padding: 1px; }
    /* character traits, highlighted in their house colour */
    .trait { transition: background-color .3s, box-shadow .3s; border-radius: 2px; }
    .trait[data-t="Responsibility"] { --tc: var(--h-fides); } .trait[data-t="Confidence"] { --tc: var(--h-potens); } .trait[data-t="Zest"] { --tc: var(--h-zelus); }
    .trait[data-t="Grit"] { --tc: var(--h-constantia); } .trait[data-t="Kindness"] { --tc: var(--h-bonitas); }
    .show-traits .trait, [data-show="Responsibility"] .trait[data-t="Responsibility"], [data-show="Confidence"] .trait[data-t="Confidence"], [data-show="Zest"] .trait[data-t="Zest"],
    [data-show="Grit"] .trait[data-t="Grit"], [data-show="Kindness"] .trait[data-t="Kindness"] { background: color-mix(in srgb, var(--tc) 28%, transparent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--tc) 28%, transparent); }
    .show-traits .trait::after, [data-show="Responsibility"] .trait[data-t="Responsibility"]::after, [data-show="Confidence"] .trait[data-t="Confidence"]::after, [data-show="Zest"] .trait[data-t="Zest"]::after,
    [data-show="Grit"] .trait[data-t="Grit"]::after, [data-show="Kindness"] .trait[data-t="Kindness"]::after { content: attr(data-t); font: 400 .66rem/1 var(--f-label); letter-spacing: .06em; color: #fff; background: var(--tc); padding: 3px 5px 2px; margin-left: 5px; vertical-align: 2px; white-space: nowrap; }
    .trait.flash { animation: home-tflash 1.6s ease-out; }

    /* the HACH Circle: five houses round the belonging logo */
    .guides { --h-fides: #3a8a4e; --h-potens: #7b4fa0; --h-zelus: #c9403a; --h-constantia: #3c78a8; --h-bonitas: #e2ac22; }
    .hcircle { margin-top: 60px; background: rgba(255,253,246,.9); box-shadow: 0 10px 26px rgba(40,25,5,.18); padding: 28px clamp(18px, 3vw, 34px) 30px; position: relative; }
    .hcircle > .tape { top: -12px; left: 46%; transform: rotate(-3deg); }
    .hc-intro { display: grid; grid-template-columns: 1fr auto; gap: 10px 30px; align-items: end; }
    .hc-intro .torn { justify-self: start; }
    .hc-intro h3 { font: 400 clamp(1.8rem, 4vw, 2.7rem)/1.05 var(--f-slab); margin-top: 10px; }
    .hc-intro p { margin: 8px 0 0; max-width: 60ch; }
    .hc-body { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); gap: 30px; align-items: center; margin-top: 18px; }
    .ring { position: relative; width: 100%; max-width: 520px; aspect-ratio: 1; margin: 0 auto; }
    .ring .belong { position: absolute; left: 50%; top: 50%; width: 44%; transform: translate(-50%, -50%); filter: drop-shadow(0 6px 10px rgba(0,0,0,.25)); }
    .ring::before { content: ""; position: absolute; inset: 13%; border: 3px dashed rgba(29,36,72,.25); border-radius: 50%; }
    /* each shield gets its own layer, and its blend stays inside it: without this Chrome can flash black tiles while a shield scales */
    .shield { position: absolute; width: 24%; transform: translate(-50%, -50%); border: 0; padding: 0; background: none; cursor: pointer; display: grid; justify-items: center; gap: 4px; transition: transform .2s; font: inherit; color: inherit; will-change: transform; backface-visibility: hidden; }
    .shield .sh { width: 100%; aspect-ratio: .86; background: var(--hc) url(/img/bg_cream.webp) center/300px; background-blend-mode: multiply; display: grid; place-items: center;
                  clip-path: polygon(0 0, 100% 0, 100% 60%, 50% 100%, 0 60%); position: relative; isolation: isolate; transform: translateZ(0); }
    .shield .sh::after { content: ""; position: absolute; inset: 5px; clip-path: polygon(0 0, 100% 0, 100% 60%, 50% 100%, 0 60%); border: 3px solid rgba(255,255,255,.55); }
    .shield .sh img { width: 70%; margin-top: -14%; filter: drop-shadow(0 3px 3px rgba(0,0,0,.3)); }
    .shield .torn { font-size: .8rem; }
    .shield:hover, .shield:focus-visible { transform: translate(-50%, -50%) scale(1.07) rotate(-2deg); outline: none; }
    .shield:focus-visible .torn { outline: 3px dashed var(--coral); }
    .shield[aria-pressed="true"] { transform: translate(-50%, -50%) scale(1.14); z-index: 2; }
    .shield[aria-pressed="true"] .sh { filter: drop-shadow(0 0 0 #fff) drop-shadow(0 6px 8px rgba(0,0,0,.3)); }
    .hc-card { border-top: 12px solid var(--hc); background: #fffdf6; box-shadow: 0 6px 16px rgba(40,25,5,.14); padding: 18px 22px 20px; display: grid; gap: 12px; }
    .hc-card .top { display: grid; grid-template-columns: 76px 1fr; gap: 14px; align-items: center; }
    .hc-card .top .sh { width: 76px; aspect-ratio: .86; background: var(--hc) url(/img/bg_cream.webp) center/300px; background-blend-mode: multiply; display: grid; place-items: center; clip-path: polygon(0 0, 100% 0, 100% 60%, 50% 100%, 0 60%); }
    .hc-card .top .sh img { width: 72%; margin-top: -14%; }
    .hc-card h4 { font: 400 2rem/1 var(--f-slab); margin: 0; }
    .hc-card .trt { font: 400 1.3rem/1 var(--f-label); letter-spacing: .04em; color: var(--hc); margin-top: 4px; display: block; }
    .hc-card dl { margin: 0; display: grid; gap: 10px; }
    .hc-card dt { font: 400 .74rem/1 var(--f-label); letter-spacing: .08em; color: #8a6f4c; }
    .hc-card dd { margin: 3px 0 0; font-size: .96rem; }
    .hc-card .findit { cursor: pointer; border: 0; text-align: left; font: inherit; background: color-mix(in srgb, var(--hc) 14%, #fffdf6); border-left: 6px solid var(--hc); padding: 10px 12px; display: grid; grid-template-columns: 48px 1fr; gap: 10px; align-items: center; }
    .hc-card .findit img { width: 48px; height: 48px; object-fit: cover; object-position: 50% 8%; border-radius: 50%; background: #fff; }
    .hc-card .findit b { display: block; font: 400 .78rem/1.2 var(--f-label); letter-spacing: .04em; color: var(--hc); }
    .hc-card .findit q { font: 700 1.2rem/1.15 var(--f-hand); }
    .hc-card .findit:hover { filter: brightness(.97); }
    .hc-hint { font: 700 1.2rem/1 var(--f-hand); color: #8a6f4c; text-align: center; margin: 8px 0 0; }

    /* ---------- get ready ---------- */
    .ready { padding-block: 80px 80px; }
    .ready .head p { margin: 10px 0 0; max-width: 60ch; }
    .packing { display: grid; grid-template-columns: 1.05fr .95fr; gap: 30px; margin-top: 30px; align-items: start; }
    .floor { background: rgba(255,250,238,.72); padding: 18px; box-shadow: inset 0 0 0 2px rgba(255,255,255,.4); }
    .floor .lbl { font: 700 1.3rem/1 var(--f-hand); margin: 0 0 10px; }
    .items { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .item { cursor: pointer; border: 0; background: none; padding: 8px 4px 6px; display: grid; justify-items: center; gap: 6px; font: inherit; color: inherit; position: relative; transition: transform .15s, opacity .3s; }
    .item img { height: 78px; width: auto; max-width: 100%; object-fit: contain; filter: drop-shadow(0 4px 4px rgba(0,0,0,.22)); }
    .item .torn { font-size: .72rem; text-align: center; }
    .item:hover { transform: translateY(-3px) rotate(-2deg); }
    .item.packed { opacity: .35; cursor: default; transform: none; }
    .item.packed::after { content: "✓"; position: absolute; top: 4px; right: 12px; font: 700 2rem/1 var(--f-hand); color: var(--teal); }
    .bagside { display: grid; gap: 16px; justify-items: center; }
    .talk { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: end; width: 100%; min-height: 128px; }
    .talk .face { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; object-position: 50% 8%; background: #fffdf6; outline: 3px solid #fff; box-shadow: 0 3px 6px rgba(0,0,0,.2); }
    .talk .bubble { border-bottom-left-radius: 4px; }
    .talk .bubble::after { left: -10px; bottom: 10px; border-width: 10px 12px 0 0; border-color: transparent #fffdf6 transparent transparent; }
    .bag { position: relative; width: min(280px, 70vw); }
    .bag img.b { width: 100%; filter: drop-shadow(0 10px 10px rgba(0,0,0,.25)); }
    .bag .count { position: absolute; left: -12px; top: 14px; transform: rotate(-8deg); font-size: .95rem; --torn-bg: var(--label); }
    .bag .dog { position: absolute; right: -40%; bottom: -4%; width: 48%; opacity: 0; transform: translateX(60px); transition: opacity .4s, transform .6s cubic-bezier(.3,1.4,.6,1); }
    .bag.done .dog { opacity: 1; transform: none; }
    @media (max-width: 700px) { .bag .dog { right: -6%; width: 40%; transform: translateY(30px); } }   /* keep Fetch inside the page on phones */
    .list { width: 100%; list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 20px; font-size: .9rem; }
    .list li { break-inside: avoid; padding: 3px 0 3px 28px; position: relative; }
    .list li::before { content: ""; position: absolute; left: 0; top: 5px; width: 16px; height: 16px; border: 2px solid var(--ink); border-radius: 3px; background: #fffdf6; }
    .list li.on::after { content: "✓"; position: absolute; left: 2px; top: -6px; font: 700 1.7rem/1 var(--f-hand); color: var(--coral); }
    .list li.on { text-decoration: line-through; text-decoration-color: rgba(29,36,72,.35); }
    .donebar { display: none; margin-top: 26px; padding: 18px 22px; background: var(--navy); color: var(--label); align-items: center; gap: 18px; flex-wrap: wrap; }
    .donebar.show { display: flex; }
    .donebar img { width: 150px; }
    .donebar h3 { font: 400 1.7rem/1.1 var(--f-slab); }
    .donebar p { margin: 4px 0 0; color: #dfe4f4; }
    .donebar .btns { display: flex; gap: 10px; flex-wrap: wrap; margin-left: auto; }
    .tools { display: flex; gap: 16px; justify-content: space-between; margin-top: 12px; }
    .linkbtn { cursor: pointer; border: 0; background: none; font: 700 1.2rem/1 var(--f-hand); color: var(--ink); text-decoration: underline; text-underline-offset: 3px; padding: 4px 0; }

    /* ---------- where next ---------- */
    .next { padding-block: 70px 70px; }
    .cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 24px; }
    .card { display: grid; gap: 10px; text-decoration: none; color: inherit; background: #fffdf6; padding: 14px 14px 18px; box-shadow: 0 6px 14px rgba(40,25,5,.16); transition: transform .15s; }
    .card:nth-child(1) { transform: rotate(-1deg); } .card:nth-child(3) { transform: rotate(1deg); }
    .card:hover { transform: translateY(-4px); }
    .card .pic { height: 170px; display: grid; place-items: center; overflow: hidden; }
    .card .pic img { max-height: 100%; width: auto; object-fit: contain; }
    .card h3 { font: 400 1.35rem/1.1 var(--f-slab); }
    .card p { margin: 0; font-size: .95rem; }

    @media (max-width: 900px) {
      .hero .top, .trailer .wrap, .packing, .guides .head { grid-template-columns: 1fr; }
      .route .row { grid-template-columns: 1fr 1fr; }
      .people { grid-template-columns: 1fr; row-gap: 150px; } .pass:nth-child(2) { margin-top: 0; }
      .together, .cards { grid-template-columns: 1fr; }
      .hc-intro, .hc-body { grid-template-columns: 1fr; }
    }
    @media (max-width: 520px) {
      .fetch { grid-template-columns: 1fr; } .fetch img { width: 110px; }
      .pass .motto { max-width: 50%; font-size: 1.8rem; min-height: 70px; }
      .items { grid-template-columns: repeat(3, 1fr); } .item img { height: 60px; }
      .list { columns: 1; }
    }
}

@keyframes home-tflash { 0%, 40% { box-shadow: 0 0 0 6px var(--tc); } }
