/* p4-light-v2.css — Phase 4 home v2 "richness pass" (Wick 09:12). Loaded AFTER p4-light.css (v1 kept as is).
   EVERY rule is under html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])): dark untouched. Decoration only (pseudo-elements, backgrounds, borders
   drawn outside text boxes, pointer-events:none). No green changed. Language: veins, woven rope, pointed arches with ONE upright mullion. */
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])){--p4-vellum:#fffaf0;--p4-iron:#2b261f;--p4-gold:#b8893c;--p4-amber:#a8681c;--p4-ink2:#7a4a12}

/* item 2 — ground: 1280 vein tile + 977 co-prime cloud layer, offset (same as release-bundle/) */
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) body{background-color:#f7f2e6;background-image:url(chrome/veined-paper-1280.svg),url(chrome/paper-clouds-977.svg);background-size:1280px 1280px,977px 977px;background-position:0 0,311px 173px;background-repeat:repeat}
@media (max-width:600px){html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) body{background-size:900px 900px,977px 977px}}


/* item 4 — thinner rope on wide desktop; wide 7-arch divider (~880px) on desktop */
@media (min-width:1200px){html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) .bar::after{height:9px;bottom:-4.5px;background-size:8px 9.33px}}
@media (min-width:900px){html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) main.home2 .band::before{top:-24px;width:min(880px,94%);height:44px;background-image:url(chrome/divider-arcade-wide.svg)}}

/* 6a — veined engraved borders on cards and media frames (drawn just outside/at the edge, never over text) */
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) main .card,
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) main .demo-card{position:relative}
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) main .card::before{background:none}             /* v1 corner brackets -> replaced by the frame */
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) main .card::after,
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) main .demo-card::after{content:"";position:absolute;inset:-5px;border:18px solid transparent;border-image:url(chrome/engraved-frame.svg) 24 round;pointer-events:none}
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) main.home2 .bj-door{position:relative;overflow:visible}
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) main.home2 .bj-door::after{content:"";position:absolute;inset:-12px;border:18px solid transparent;border-image:url(chrome/engraved-frame.svg) 24 round;pointer-events:none;z-index:2}
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) main.home2 .hero2-clip .clip-stage::after{content:"";position:absolute;inset:-11px;border:18px solid transparent;border-image:url(chrome/engraved-frame.svg) 24 round;pointer-events:none;z-index:2}
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) main.home2 .film2-player{position:relative;container-type:inline-size}
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) main.home2 .film2-player::before{content:"";position:absolute;left:-11px;right:-11px;top:-11px;height:calc(100cqw * 9 / 16 + 22px);border:18px solid transparent;border-image:url(chrome/engraved-frame.svg) 24 round;pointer-events:none;z-index:2}
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) main.home2 .cs-figure{position:relative}

/* 6b — woven trim on the section rail and the buttons */
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) .zx-guide.is-side{background:rgba(255,250,240,.97)}
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) .zx-guide.is-side::before{content:"";position:absolute;inset:-6px;border:10px solid transparent;border-image:url(chrome/rope-frame.svg) 14 round;border-radius:0;pointer-events:none}
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) main.home2 .door-primary,
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) main.home2 .door-quiet{position:relative;box-shadow:0 0 0 2px #f7f2e6,0 0 0 3.5px var(--p4-iron)}
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"],[data-theme="dark"],[data-theme="eclipse"])) main.home2 :is(.door-primary,.door-quiet){background:#c6ff3d!important;color:#0b0d12!important;border-color:#252420!important;box-shadow:inset 0 0 0 1px #252420!important;text-shadow:none}
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"],[data-theme="dark"],[data-theme="eclipse"])) main.home2 :is(.door-primary,.door-quiet):is(:hover,:focus-visible){background:#d8ff7a!important}
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"],[data-theme="dark"],[data-theme="eclipse"])) main.home2 :is(.door-primary,.door-quiet):focus-visible{outline:3px solid #252420!important;outline-offset:3px!important;box-shadow:inset 0 0 0 1px #252420,0 0 0 3px #fffaf0!important}
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"],[data-theme="dark"],[data-theme="eclipse"])) main.home2 :is(.door-primary,.door-quiet):active{background:#a7e524!important}
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) main.home2 .door-primary::after,
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) main.home2 .door-quiet::after,
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) .cartoons::after{content:"";position:absolute;left:8px;right:8px;bottom:-10px;height:6px;background:url(../p4/chrome/woven-rule.svg) repeat-x 0 0/6px 7px;pointer-events:none}
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) .cartoons{position:relative;border-color:var(--p4-iron);border-style:solid}

/* 6c — fine gothic vein work in the left margin, densest at each section head and thinning downward */
@media (min-width:1200px){
 html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) main.home2 .band::after{content:"";position:absolute;top:8px;left:-64px;width:54px;height:min(570px,100%);background:url(chrome/margin-veins.svg) top left/54px auto no-repeat;pointer-events:none}
}

/* 6d — the herald engraved: vellum with a hatched engraved vignette, a woven rope top/bottom, the engraved frame, and an arcade crown */
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) main .herald{position:relative;padding:26px 24px;margin-top:34px;background:radial-gradient(ellipse 70% 62% at 50% 50%,#fffaf0 60%,rgba(255,250,240,.0) 100%),url(chrome/hatch.svg),linear-gradient(#f6eedb,#efe2c4)}
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) main .herald::after{content:"";position:absolute;inset:-4px;border:18px solid transparent;border-image:url(chrome/engraved-frame.svg) 24 round;pointer-events:none}
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) main .herald::before{content:"";position:absolute;left:50%;top:-30px;transform:translateX(-50%);width:min(560px,90%);height:30px;background:url(chrome/divider-arcade-wide.svg) center bottom/contain no-repeat;pointer-events:none}

/* P1 + P3 wired in (staging only): the footer band and the space band become light engraved art */
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) .foot-way{background:#fbf5e8}
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) .foot-way .foot-band{content:url(pics/p1-foot-band-light-423.webp)}
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) .foot-way .foot-qr{top:31%}
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) .space-band{background:#f7f2e6;color:var(--p4-iron)}
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) .space-art img{content:url(pics/p3-earth-mars-chart-light-1280.webp);max-height:460px}
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) .space-cap{color:var(--p4-iron)}
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) .space-cap b,
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) .space-cap a{color:var(--p4-ink2)}

/* 6a (more) — the goal panel, the pack tiles, the SAV Borjghali ship figure, the Salabimo aside, the footer QR fallback */
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) main.home2 .goal2,
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) main.home2 .film2-packs li,
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) main.home2 .cs-figure,
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) main.home2 .r8h-sal,
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) .foot-art-right{position:relative}
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) main.home2 .goal2{background-color:var(--p4-vellum)}
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) main.home2 .goal2::after,
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) main.home2 .film2-packs li::after,
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) main.home2 .r8h-sal::after,
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) .foot-art-right::after{content:"";position:absolute;inset:-5px;border:18px solid transparent;border-image:url(chrome/engraved-frame.svg) 24 round;pointer-events:none}
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) main.home2 .cs-figure::after{content:"";position:absolute;inset:-12px;border:22px solid transparent;border-image:url(chrome/engraved-frame.svg) 24 round;pointer-events:none}
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) .foot-art-right::after{inset:-8px}
/* the 1px rule above the ship section becomes the wide arcade */
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) main.home2>section.cs-ship{border-top:0}
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) main.home2>section.cs-ship::before{content:"";position:absolute;top:-22px;left:50%;transform:translateX(-50%);width:min(880px,94%);height:44px;background:url(chrome/divider-arcade-wide.svg) center/contain no-repeat;pointer-events:none}
/* hero frame: keep 6px clear of the Sound/Replay buttons */
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) main.home2 .hero2-clip .clip-stage::after{inset:-11px -11px -5px}
/* P1 footer: the starry QR turns to iron dots on vellum (dark-on-light reads and scans better on paper) */
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) .foot-way .foot-qr{filter:none;mix-blend-mode:normal}
/* the live "build" reveal (.alive .card::after → fades to 0) would hide the frame: keep the reveal wipe, end at full opacity */
html.alive:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) main .card::after,
html.alive:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) main .card.built::after{opacity:1;border-radius:0;border-color:transparent}

/* ===== Wick 09:27 fixes ===== */
/* fix 1 — P2 slot: the porthole emblem is staged and ready. The live eye keeps showing UNTIL the flag is set.
   To swap: add data-p4-p2="porthole" to <html> (or ship this rule without the attribute once Levi rules). */
/* Levi yes 21 Nov 10:02 via Wick: porthole ON in LIGHT (no flag). Dark keeps the eye. */
/* fix 4 — frames only on light: hide the live hand-drawn card borders (svg.ink) under the engraved frames; dark keeps them */
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) main .card>svg.ink{display:none}
/* fix 5 — hero frame: >=12px clear of the Sound/Replay buttons (frame 8px out, buttons moved 22px down → 14px air) */
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) main.home2 .hero2-clip .clip-stage::after{inset:-11px -11px -8px}
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) main.home2 .hero2-clip-ctl{margin-top:22px}
/* heralds: text always sits on clean vellum (content box); the hatched engraving lives only in the padding mat */
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) main .herald,
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) main .tm-head,
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) main .seal,
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) main.bj-page .bj-intro{background:linear-gradient(#fffaf0,#fffaf0) content-box,radial-gradient(ellipse 72% 66% at 50% 50%,#fffaf0 60%,rgba(255,250,240,0) 100%) padding-box,url(chrome/hatch.svg) padding-box,linear-gradient(#f6eedb,#efe2c4) padding-box}
/* bug fix (found by the 09:27 WCAG sweep): v1 put the presentation's dark demo cards on vellum, making their light text unreadable
   while the presentation plays. Restore the live night colours and drop the frame on these small overlay cards. */
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) main .demo-card{background-color:#102737;border-color:#385565;box-shadow:none}
html:not(:is([data-zx-theme="dark"],[data-zx-theme="eclipse"])) main .demo-card::after{content:none}
/* Wick 09:56 — P2 porthole also in DARK when the flag is on (Levi's pick applies to both themes). Night-palette twin on the live
   dark panel (#070c14). Flag off (the mocks) = no change in dark. */
/* Lantern ruling 21 Nov 10:20 via Wick (no-religious-marks rule): porthole in BOTH themes. Dark uses the night twin on the live dark panel (#070c14). */

/* R2 consent chevron rules moved to staging/text-changes/r2-consent-chevron/ (Wick 10:20) */

/* 0.8.12c merge (Ikarus 21.11): the three R3 porthole rules were taken out of this file; they live in /v3/style.css (both themes). */
