:root {
    --sol-copper: #b9643f;
    --sol-gold: #d9b56d;
    --sol-ink: #080607;
    --sol-shadow-x: 72%;
    --sol-shadow-y: 42%;
    --sol-chapter-glow: rgba(185, 100, 63, 0.2);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.codex-sol-edition {
    background:
        radial-gradient(circle at var(--sol-shadow-x) var(--sol-shadow-y), var(--sol-chapter-glow), transparent 30%),
        linear-gradient(180deg, #130c0d 0%, #070506 54%, #030303 100%);
}

.sol-shadow-field {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(circle at var(--sol-shadow-x) var(--sol-shadow-y), transparent 0 7%, rgba(0, 0, 0, 0.08) 18%, rgba(0, 0, 0, 0.42) 68%),
        conic-gradient(from 205deg at var(--sol-shadow-x) var(--sol-shadow-y), transparent, rgba(211, 172, 99, 0.05), transparent 38%);
    mix-blend-mode: multiply;
    transition: background 0.8s ease;
}

.sol-grain {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    opacity: 0.1;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.32) 0 0.45px, transparent 0.7px),
        radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.2) 0 0.4px, transparent 0.7px);
    background-size: 7px 7px, 11px 11px;
}

.sol-signature {
    position: fixed;
    right: 30px;
    bottom: 76px;
    z-index: 26;
    display: flex;
    align-items: center;
    gap: 9px;
    font-family: "Cinzel", serif;
    font-size: 0.58rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: rgba(217, 181, 109, 0.48);
}

.sol-sigil,
.perspective-icon {
    position: relative;
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 1px solid currentColor;
    border-radius: 50%;
}

.sol-sigil::before,
.perspective-icon::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 12px currentColor;
}

.sol-sigil::after,
.perspective-icon::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -5px;
    left: -5px;
    height: 1px;
    background: currentColor;
    transform: rotate(-28deg);
}

.experience-panel {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.privacy-consent[hidden] {
    display: none;
}

.privacy-consent {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(3, 2, 2, 0.76);
    backdrop-filter: blur(12px);
}

.privacy-consent-card {
    width: min(560px, 100%);
    padding: clamp(28px, 5vw, 48px);
    border: 1px solid rgba(217, 181, 109, 0.26);
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(24, 16, 15, 0.98), rgba(7, 5, 5, 0.99));
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.68);
}

.privacy-kicker {
    margin-bottom: 12px;
    font-family: "Cinzel", serif;
    font-size: 0.62rem;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--sol-gold);
}

.privacy-consent h2 {
    margin-bottom: 18px;
    font-family: "Cinzel", serif;
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-weight: 500;
    line-height: 1.2;
}

.privacy-consent p {
    font-size: 1.08rem;
    line-height: 1.65;
    color: var(--muted);
}

.privacy-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
}

.privacy-button {
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    cursor: pointer;
    font-family: "Cinzel", serif;
    font-size: 0.66rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.privacy-button.primary {
    border-color: rgba(217, 181, 109, 0.46);
    background: linear-gradient(90deg, rgba(185, 100, 63, 0.3), rgba(217, 181, 109, 0.13));
}

.perspective-button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(14, 10, 10, 0.62);
    color: var(--muted);
    cursor: pointer;
    backdrop-filter: blur(12px);
    font-family: "Cinzel", serif;
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    transition: color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.perspective-button:hover,
.perspective-button:focus-visible,
.perspective-button[aria-pressed="true"] {
    outline: none;
    color: var(--sol-gold);
    border-color: rgba(217, 181, 109, 0.45);
}

.perspective-button[aria-pressed="true"] {
    box-shadow: 0 0 24px rgba(185, 100, 63, 0.24);
}

.perspective-icon {
    width: 15px;
    height: 15px;
}

.index-whisper {
    margin-top: 14px;
    font-size: 0.78rem;
    font-style: italic;
    line-height: 1.45;
    color: var(--muted-strong);
}

.margin-voice {
    position: fixed;
    top: 50%;
    right: 30px;
    z-index: 55;
    width: min(250px, 24vw);
    padding: 22px 20px 20px 26px;
    border: 1px solid rgba(217, 181, 109, 0.16);
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(18, 12, 12, 0.94), rgba(6, 5, 5, 0.9));
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.48);
    backdrop-filter: blur(18px);
    opacity: 0;
    pointer-events: none;
    transform: translate(22px, -44%);
    transition: opacity 0.42s ease, transform 0.42s ease;
}

.margin-visible .margin-voice {
    opacity: 1;
    pointer-events: auto;
    transform: translate(0, -50%);
}

.margin-preview .margin-voice {
    opacity: 0.24;
    pointer-events: none;
    transform: translate(8px, -48%);
}

.perspective-button.margin-invite {
    color: var(--sol-gold);
    border-color: rgba(217, 181, 109, 0.52);
    animation: margin-invite-pulse 1.8s ease-in-out infinite;
}

@keyframes margin-invite-pulse {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(217, 181, 109, 0);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(217, 181, 109, 0.08), 0 0 24px rgba(185, 100, 63, 0.3);
        transform: scale(1.035);
    }
}

.margin-line {
    position: absolute;
    top: 20px;
    bottom: 20px;
    left: 12px;
    width: 1px;
    background: linear-gradient(transparent, var(--sol-copper), transparent);
}

.margin-kicker {
    margin-bottom: 12px;
    font-family: "Cinzel", serif;
    font-size: 0.56rem;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--sol-gold);
}

.margin-voice blockquote {
    font-size: 1.03rem;
    font-style: italic;
    line-height: 1.55;
    color: #e8dcc9;
}

.margin-context {
    margin-top: 13px;
    font-family: "Cinzel", serif;
    font-size: 0.56rem;
    letter-spacing: 0.12em;
    line-height: 1.5;
    text-transform: uppercase;
    color: var(--muted-strong);
}

.codex-sol-edition .page-content {
    isolation: isolate;
}

.codex-sol-edition .page-content::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(circle at 82% 12%, var(--sol-chapter-glow), transparent 30%);
    opacity: 0.7;
    transition: background 0.8s ease;
}

.codex-sol-edition .section-divider {
    position: relative;
    min-height: 74px;
}

.codex-sol-edition .divider-icon {
    position: relative;
    width: 32px;
    height: 32px;
    overflow: hidden;
    color: transparent;
    border: 1px solid rgba(217, 181, 109, 0.56);
    border-radius: 50% 50% 46% 54%;
    transform: rotate(45deg);
}

.codex-sol-edition .divider-icon::before,
.codex-sol-edition .divider-icon::after {
    content: "";
    position: absolute;
    background: var(--sol-gold);
}

.codex-sol-edition .divider-icon::before {
    width: 1px;
    height: 42px;
    transform: translate(15px, -6px);
}

.codex-sol-edition .divider-icon::after {
    width: 42px;
    height: 1px;
    transform: translate(-6px, 15px);
}

.page-cover .title-page::after {
    content: "Toda luz projeta uma sombra — mas somente a sombra conhece o que a luz decidiu não iluminar.";
    position: absolute;
    right: clamp(28px, 5vw, 68px);
    bottom: clamp(42px, 8vh, 86px);
    width: min(34ch, 34%);
    font-size: clamp(0.88rem, 1.4vw, 1.08rem);
    font-style: italic;
    line-height: 1.55;
    text-align: right;
    color: rgba(241, 231, 214, 0.72);
    text-shadow: 0 2px 18px #000;
}

.tone-creation { --sol-chapter-glow: rgba(217, 181, 109, 0.24); }
.tone-fall { --sol-chapter-glow: rgba(144, 38, 24, 0.25); }
.tone-blood { --sol-chapter-glow: rgba(126, 24, 17, 0.24); }
.tone-water { --sol-chapter-glow: rgba(47, 82, 104, 0.23); }
.tone-desert { --sol-chapter-glow: rgba(166, 111, 54, 0.23); }
.tone-land { --sol-chapter-glow: rgba(94, 86, 44, 0.24); }
.tone-silence { --sol-chapter-glow: rgba(91, 78, 110, 0.2); }

@media (max-width: 1380px) {
    .margin-voice {
        right: 22px;
        width: 220px;
    }

    .margin-visible .page-content {
        transform: translateX(-90px);
    }
}

@media (max-width: 1080px) {
    .experience-panel {
        justify-self: end;
    }

    .margin-voice {
        right: 18px;
        bottom: 86px;
        top: auto;
        width: min(420px, calc(100vw - 36px));
        transform: translateY(18px);
    }

    .margin-visible .margin-voice {
        transform: translateY(0);
    }

    .margin-preview .margin-voice {
        transform: translateY(10px);
    }

    .margin-visible .page-content {
        transform: none;
    }
}

@media (max-width: 640px) {
    .experience-panel {
        position: fixed;
        top: 20px;
        right: 16px;
    }

    .experience-panel .audio-panel {
        position: static;
    }

    .perspective-button {
        width: 40px;
        min-height: 40px;
        justify-content: center;
        padding: 0;
    }

    .perspective-label,
    .sol-signature {
        display: none;
    }

    .page-cover .title-page::after {
        right: 22px;
        bottom: 86px;
        width: min(28ch, calc(100% - 44px));
        font-size: 0.78rem;
    }

    .margin-voice {
        bottom: 78px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sol-shadow-field {
        display: none;
    }

    .perspective-button.margin-invite {
        animation: none;
        box-shadow: 0 0 20px rgba(185, 100, 63, 0.3);
    }
}
