:root[data-wipe-phase] {
    --bg:#100c0c;
    --panel:#1d1413;
    --panel-soft:#2b1c19;
    --text:#fff1e6;
    --muted:#cbb1a5;
    --line:rgba(255,179,135,.26);
    --accent-rgb:255,173,118;
    --accent:rgb(var(--accent-rgb));
    --accent-dark:#27120c;
    --chapter-bg:rgba(28,17,15,.94);
    --hero-shade:16,12,12;
    --world-card:rgba(39,23,21,.75);
    --world-gradient:linear-gradient(180deg,#100c0c,#1b1112 49%,#241514 74%,#100c0c);
    --sky-gradient:linear-gradient(135deg,#150e10,#41211d 75%,#261511);
    --wipe-glow:rgba(220,94,52,.27);
    --signal-head:rgba(26,15,15,.97);
}

:root[data-wipe-phase][data-theme="light"] {
    --bg:#f5ebe3;
    --panel:#fff5ed;
    --panel-soft:#f3dfd2;
    --text:#2b1914;
    --muted:#6b483c;
    --line:rgba(112,52,33,.27);
    --accent-rgb:148,46,20;
    --accent-dark:#fff4e7;
    --chapter-bg:rgba(255,243,233,.97);
    --hero-shade:245,235,227;
    --world-card:rgba(255,245,237,.8);
    --world-gradient:linear-gradient(180deg,#f5ebe3,#f4e3d7 56%,#ecd7cb 76%,#f5ebe3);
    --sky-gradient:linear-gradient(135deg,#f5ebe3,#ebb998);
    --wipe-glow:rgba(210,91,47,.22);
    --signal-head:rgba(255,243,233,.96);
}

:root[data-wipe-phase="critical"][data-theme="dark"] { --accent-rgb:255,160,127; }
:root[data-wipe-phase="critical"][data-theme="light"] { --accent-rgb:161,41,25; }

:root:not([data-wipe-phase]) .signal-only,
[data-wipe-phase] .signal-normal,
:root:not([data-wipe-phase="critical"]) .signal-critical,
[data-wipe-phase="critical"] .signal-before-critical { display:none; }

[data-wipe-phase] .site-shell { background:var(--bg); }
:root[data-wipe-phase] .topbar,:root[data-wipe-phase] .topbar.scrolled { background:var(--signal-head); border-color:var(--line); }
[data-wipe-phase] .chapter-rail { background:var(--chapter-bg); border:1px solid var(--line); padding:7px 4px; }
:root[data-wipe-phase] .terra-world { background:var(--world-gradient); filter:none; }
[data-wipe-phase] .section-number { color:color-mix(in srgb,var(--accent) 10%,transparent); }
:root[data-wipe-phase] .hero-scene { --sky-gradient:inherit; }
[data-wipe-phase] .hero-sky { background:var(--sky-gradient); }
[data-wipe-phase] .signal-landscape {
    background:url('/static/icons/ultimo-sinal.webp') 53% 46% / cover no-repeat;
    inset:0 0 0 27%;
    mask-image:linear-gradient(90deg,transparent 1%,#000 43%);
    opacity:.94;
    position:absolute;
    transform:translate3d(var(--mouse-shift-x,0px),var(--scroll-shift,0px),0);
}
[data-wipe-phase] .hero-scene::after {
    background:
        linear-gradient(0deg,var(--bg),transparent 24%),
        linear-gradient(90deg,rgba(var(--hero-shade),.98) 4%,rgba(var(--hero-shade),.88) 29%,rgba(var(--hero-shade),.22) 61%,transparent 86%);
}
[data-wipe-phase] .hero-fog {
    background:url('/static/icons/ultimo-sinal-fumaca.webp') center / 100% 100% no-repeat;
    filter:none;
    inset:29% -15% 1% 22%;
    mix-blend-mode:normal;
    opacity:.84;
    transform:translate3d(-2%,var(--scroll-shift,0px),0);
}
[data-wipe-phase] .hero-fog-two {
    inset:38% -29% -14% 29%;
    opacity:.65;
    scale:-1 1;
}
[data-wipe-phase][data-theme="light"] .hero-fog { filter:brightness(.67); }

@media (prefers-reduced-motion:no-preference) {
    [data-wipe-phase] .hero-fog-one { animation:signal-smoke-drift 21s -4s ease-in-out infinite alternate; }
    [data-wipe-phase] .hero-fog-two { animation:signal-smoke-drift 28s -14s ease-in-out infinite alternate-reverse; }
}
@keyframes signal-smoke-drift {
    from { translate:-7% 12%; }
    to { translate:7% -16%; }
}

[data-wipe-phase] .ambient-canvas { filter:sepia(1) saturate(4); }
[data-wipe-phase] .cursor-light { background:radial-gradient(circle 360px at var(--mouse-x,50%) var(--mouse-y,40%),rgba(255,161,104,.09),transparent 68%); }
[data-wipe-phase] .hero h1 { font-size:clamp(64px,8.4vw,136px); line-height:.78; }
[data-wipe-phase] .hero h1::after { content:none; }
[data-wipe-phase] .hero h1 em { display:block; }
[data-wipe-phase] .hero-copy { color:var(--text); font-size:clamp(16px,2vw,21px); margin-bottom:18px; }
.signal-kicker { align-items:center; display:flex; flex-wrap:wrap; gap:4px 8px; }
.signal-kicker span { color:inherit; }
.signal-kicker::before {
    background:currentColor;
    box-shadow:0 0 14px var(--accent);
    content:"";
    flex:none;
    height:7px;
    transform:rotate(45deg);
    width:7px;
}
.signal-progress {
    align-items:center;
    background:color-mix(in srgb,var(--panel) 82%,transparent);
    border:1px solid var(--line);
    border-left:2px solid var(--accent);
    color:var(--muted);
    column-gap:16px;
    display:grid;
    grid-template-columns:1fr auto;
    max-width:320px;
    padding:10px 14px 13px;
    row-gap:8px;
    width:100%;
}
.signal-progress:hover { border-color:var(--accent); }
.signal-progress > span { font-size:10px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; }
.signal-progress strong { color:var(--accent); font:700 31px/.85 'Barlow Condensed',sans-serif; }
.signal-progress i {
    background:linear-gradient(90deg,var(--accent) var(--signal-percent),var(--line) var(--signal-percent));
    grid-column:1/-1;
    height:4px;
    mask-image:repeating-linear-gradient(90deg,#000 0 calc(5% - 2px),transparent calc(5% - 2px) 5%);
}
[data-wipe-phase] .hero-marker small,[data-wipe-phase] .chapter-mark {
    background:var(--signal-head);
    padding:3px 6px;
}
[data-wipe-phase] .jukebox-light-top { --lamp-color:255,117,52; }
[data-wipe-phase] .jukebox-light-left,[data-wipe-phase] .jukebox-light-right { --lamp-color:255,65,28; }
[data-wipe-phase] .jukebox[data-radio-state="idle"] .jukebox-light { opacity:.44; }
[data-wipe-phase] .jukebox::before { background:radial-gradient(ellipse closest-side,rgba(196,75,39,.22),transparent); }

@media (max-width:820px) {
    [data-wipe-phase] .signal-landscape {
        background-position:52% 38%;
        inset:0 0 auto;
        height:clamp(255px,46svh,405px);
        mask-image:linear-gradient(#000 30%,transparent 100%);
    }
    [data-wipe-phase] .hero-scene::after {
        background:linear-gradient(0deg,var(--bg),transparent 30%),linear-gradient(90deg,rgba(var(--hero-shade),.36),transparent);
    }
    [data-wipe-phase] .hero-fog { inset:74px -35% auto -10%; height:clamp(190px,35svh,320px); }
    [data-wipe-phase] .hero-fog-two { inset:132px -22% auto -40%; }
    [data-wipe-phase] .hero-content { padding-top:clamp(150px,26svh,220px); }
    [data-wipe-phase] .hero h1 { font-size:clamp(55px,13vw,100px); }
}

@media (prefers-reduced-motion:reduce) {
    [data-wipe-phase] .signal-landscape { transform:none; }
}
