/* Fonts — paths relative to css/ folder (one level up = project root) */
/* Body face: Fraunces (variable) is loaded via Google Fonts <link> in HTML head. */
@font-face {
    font-family: 'Cravelo';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../Cravelo-Regular.woff2') format('woff2'), url('../Cravelo-Regular.woff') format('woff'), url('../Cravelo-Regular.otf') format('opentype');
}
@font-face {
    font-family: 'Outline';
    font-style: normal;
    font-weight: 400;
    /* 'block' keeps the text invisible for a short period while the font loads, rather than
       painting a filled fallback glyph that flashes to the outlined Cravelo-Outline afterwards.
       The Outline font is *visually* an outline — no fallback makes sense. */
    font-display: block;
    src: url('../Cravelo-Outline.woff2') format('woff2'), url('../Cravelo-Outline.woff') format('woff'), url('../Cravelo-Outline.otf') format('opentype');
}

/* --- Home background --- */
#home-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 18% 26%, rgba(124, 84, 220, 0.26) 0%, rgba(124, 84, 220, 0) 46%),
        radial-gradient(circle at 82% 72%, rgba(92, 58, 186, 0.24) 0%, rgba(92, 58, 186, 0) 48%),
        linear-gradient(135deg, #170d2b 0%, #22123d 16%, #301954 34%, #251347 50%, #3c2166 68%, #21113d 84%, #150a29 100%);
    background-size: 170% 170%, 190% 190%, 300% 300%;
    background-repeat: no-repeat;
    /* Dark vignette — layered: tight corner + soft broad falloff.
       Using two modest blurs instead of a 520px monster is visually near-identical
       and dramatically cheaper to rasterize. */
    box-shadow:
        inset 0 0 70px 0 rgba(0, 0, 0, 0.78),
        inset 0 0 200px 0 rgba(0, 0, 0, 0.5);
    animation: homeBgShift 16s ease-in-out infinite;
    will-change: background-position, transform;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    contain: strict;
}
/* Pools of deeper purple/black drifting through the field — many, overlapping */
#home-bg::before {
    content: '';
    position: absolute;
    inset: -18%;
    background:
        radial-gradient(ellipse 65% 55% at 18% 30%, rgba(2, 0, 6, 0.97) 0%, rgba(2, 0, 6, 0) 65%),
        radial-gradient(ellipse 62% 68% at 82% 72%, rgba(8, 2, 18, 0.95) 0%, rgba(8, 2, 18, 0) 66%),
        radial-gradient(ellipse 82% 64% at 50% 100%, rgba(0, 0, 4, 0.93) 0%, rgba(0, 0, 4, 0) 72%),
        radial-gradient(ellipse 52% 46% at 94% 16%, rgba(4, 1, 14, 0.92) 0%, rgba(4, 1, 14, 0) 68%);
    mix-blend-mode: multiply;
    opacity: 0.7;
    animation: homeDeepen 11s ease-in-out infinite;
    pointer-events: none;
    will-change: opacity, transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}
/* Patches of brighter atmosphere drifting through — continuous, local, not strobed */
#home-bg::after {
    content: '';
    position: absolute;
    inset: -18%;
    background:
        radial-gradient(ellipse 46% 36% at 42% 40%, rgba(225, 195, 255, 0.44) 0%, rgba(225, 195, 255, 0) 62%),
        radial-gradient(ellipse 38% 44% at 72% 62%, rgba(180, 150, 255, 0.4) 0%, rgba(180, 150, 255, 0) 64%),
        radial-gradient(ellipse 34% 38% at 16% 18%, rgba(240, 210, 255, 0.38) 0%, rgba(240, 210, 255, 0) 58%);
    background-size: 230% 230%, 260% 260%, 210% 210%;
    background-position: 0% 0%, 100% 100%, 40% 80%;
    background-repeat: no-repeat;
    mix-blend-mode: screen;
    opacity: 0.85;
    animation: homePatches 11s ease-in-out infinite, homeFlashDrift 17s ease-in-out infinite;
    pointer-events: none;
    will-change: opacity, background-position;
    transform: translateZ(0);
    backface-visibility: hidden;
}
@keyframes homeBgShift {
    0%, 100% { background-position: 0% 40%, 100% 60%, 0% 50%; }
    30% { background-position: 45% 20%, 70% 90%, 100% 30%; }
    65% { background-position: 90% 80%, 30% 15%, 55% 100%; }
}
@keyframes homeDeepen {
    0%, 100% { opacity: 0.45; transform: translate(0, 0)        scale(1); }
    11%      { opacity: 1;    transform: translate(-4%, 3%)     scale(1.16); }
    24%      { opacity: 0.5;  transform: translate(3.5%, -2.5%) scale(0.92); }
    37%      { opacity: 0.08; transform: translate(-1%, 4%)     scale(1.06); }
    52%      { opacity: 1;    transform: translate(-4.5%, -3%)  scale(1.2); }
    66%      { opacity: 0.22; transform: translate(4%, 1.5%)    scale(0.94); }
    79%      { opacity: 0.92; transform: translate(-1.5%, 4%)   scale(1.12); }
    91%      { opacity: 0.4;  transform: translate(2.5%, -1%)   scale(1.04); }
}
/* Bigger swing — light patches surge bright, then nearly disappear */
@keyframes homePatches {
    0%, 100% { opacity: 0.45; transform: scale(1); }
    19%      { opacity: 1;    transform: scale(1.08); }
    34%      { opacity: 0.2;  transform: scale(0.94); }
    51%      { opacity: 0.95; transform: scale(1.12); }
    68%      { opacity: 0.3;  transform: scale(0.96); }
    84%      { opacity: 0.85; transform: scale(1.06); }
}
/* Drift of light origins — wider travel so patches sweep across the field */
@keyframes homeFlashDrift {
    0%, 100% { background-position: 0% 0%,    100% 100%, 40% 80%; }
    25%      { background-position: 80% 20%,  10% 90%,   100% 30%; }
    50%      { background-position: 20% 100%, 90% 0%,    20% 40%; }
    75%      { background-position: 100% 60%, 30% 40%,   70% 100%; }
}
@media (prefers-reduced-motion: reduce) {
    #home-bg,
    #home-bg::before,
    #home-bg::after { animation: none; }
    #home-bg::after { opacity: 0; }
    #home-bg::before { opacity: 0.38; }
}

/* Pause expensive atmosphere animations when nothing's looking at them:
   any dialog is open, a reading is active, or the tab is hidden. Huge GPU win. */
body.manifesto-open #home-bg,
body.manifesto-open #home-bg::before,
body.manifesto-open #home-bg::after,
body.contact-open #home-bg,
body.contact-open #home-bg::before,
body.contact-open #home-bg::after,
body.waitlist-open #home-bg,
body.waitlist-open #home-bg::before,
body.waitlist-open #home-bg::after,
body.reading-active #home-bg,
body.reading-active #home-bg::before,
body.reading-active #home-bg::after,
body.page-hidden #home-bg,
body.page-hidden #home-bg::before,
body.page-hidden #home-bg::after,
body.page-hidden .logo-link {
    animation-play-state: paused;
}

/* --- Gradient canvas (promote layer for smooth animation) --- */
#shader-wrap {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.6s cubic-bezier(0.22, 0.8, 0.2, 1);
    contain: strict;
    will-change: opacity;
}
#shader-wrap.active {
    opacity: 1;
}
#shader-canvas {
    width: 100%;
    height: 100%;
    display: block;
    background: transparent;
}

::selection { background: #000; color: #fff; }
::-moz-selection { background: #000; color: #fff; }

:root {
    --edge-margin: 28px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --copy-font: 'Cormorant', 'Cormorant Garamond', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
    --motion-fast: 180ms;
    --motion-base: 420ms;
    --motion-slow: 760ms;
    --ease-soft: cubic-bezier(0.22, 0.8, 0.2, 1);
}

body {
    margin: 0;
    padding: 0;
    background-color: #050508;
    color: #fff;
    font-family: 'Cormorant', 'Cormorant Garamond', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
    font-weight: 500;
    font-feature-settings: 'kern' 1, 'liga' 1, 'onum' 1, 'dlig' 1;
    font-size: 17.5px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    opacity: 1;
    transition: opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    animation: pageFadeIn 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    opacity: 0.3;
    background: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.07) 0%, rgba(0, 0, 0, 0.18) 70%, rgba(0, 0, 0, 0.34) 100%);
    transition: opacity var(--motion-base) var(--ease-soft);
}

body.page-out {
    animation: none;
    opacity: 0.18;
}

@keyframes pageFadeIn {
    from { opacity: 0.18; }
    to { opacity: 1; }
}
header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: calc(var(--edge-margin) + var(--safe-top)) var(--edge-margin) var(--edge-margin);
    padding-left: calc(var(--edge-margin) + var(--safe-left));
    padding-right: calc(var(--edge-margin) + var(--safe-right));
    box-sizing: border-box;
    z-index: 32;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-link {
    font-family: 'Cravelo', serif;
    font-size: 2.25rem;
    font-weight: 400;
    text-transform: uppercase;
    color: #fff;
    text-decoration: none;
    opacity: 0.95;
    padding: 6px 14px;
    font-feature-settings: 'kern' 1;
    font-variant-ligatures: none;
    transition: color 0.3s, opacity 0.22s ease;
    animation: logoPulse 11s ease-in-out infinite;
}
.logo-link:hover { color: #fff; opacity: 1; }
/* Occasional pulse — most of the cycle is still, then a soft breath, then rest again.
   Two pulses per 11s cycle at uneven offsets so it never feels metronomic. */
@keyframes logoPulse {
    0%, 18% {
        text-shadow: 0 0 0 rgba(255, 255, 255, 0);
        opacity: 0.95;
    }
    24% {
        text-shadow: 0 0 16px rgba(255, 255, 255, 0.32), 0 0 38px rgba(205, 175, 255, 0.18);
        opacity: 1;
    }
    30% {
        text-shadow: 0 0 8px rgba(255, 255, 255, 0.14);
        opacity: 0.97;
    }
    36%, 72% {
        text-shadow: 0 0 0 rgba(255, 255, 255, 0);
        opacity: 0.95;
    }
    78% {
        text-shadow: 0 0 20px rgba(255, 255, 255, 0.38), 0 0 44px rgba(205, 175, 255, 0.22);
        opacity: 1;
    }
    86% {
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.16);
        opacity: 0.97;
    }
    92%, 100% {
        text-shadow: 0 0 0 rgba(255, 255, 255, 0);
        opacity: 0.95;
    }
}
body.reading-active .logo-link { animation: none; }
@media (prefers-reduced-motion: reduce) {
    .logo-link { animation: none; }
}
body.mobile-dialog-opening .logo-link {
    opacity: 0;
}
body.desktop-dialog-opening .logo-link {
    opacity: 0.86;
    filter: blur(0.8px);
}
body.manifesto-open .logo-link,
body.contact-open .logo-link,
body.waitlist-open .logo-link {
    color: rgba(255, 255, 255, 0.92) !important;
    opacity: 0.86;
    filter: blur(0.8px);
}
body.mobile-dialog-opening .mobile-menu-btn,
body.mobile-dialog-opening .mobile-menu-panel {
    opacity: 0;
    pointer-events: none;
}
body.manifesto-open .mobile-menu-btn,
body.contact-open .mobile-menu-btn,
body.waitlist-open .mobile-menu-btn,
body.manifesto-open .mobile-menu-panel,
body.contact-open .mobile-menu-panel,
body.waitlist-open .mobile-menu-panel {
    opacity: 0;
    pointer-events: none;
}

.nav-top-right {
    position: absolute;
    top: calc(var(--edge-margin) + var(--safe-top));
    right: calc(var(--edge-margin) + var(--safe-right));
}

.field-marker {
    position: absolute;
    top: calc(var(--edge-margin) + var(--safe-top));
    left: calc(var(--edge-margin) + var(--safe-left));
    font-family: var(--copy-font);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.5);
    padding: 8px 2px;
    z-index: 12;
    user-select: none;
}

.mobile-menu-btn {
    display: none;
    position: absolute;
    top: calc(var(--edge-margin) + var(--safe-top));
    right: calc(var(--edge-margin) + var(--safe-right));
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 8px 4px;
    z-index: 12;
    color: rgba(255, 255, 255, 0.92);
    font-family: var(--copy-font);
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: opacity 0.22s ease, color 0.2s ease, text-shadow 0.32s var(--ease-soft);
    text-shadow: 0 0 0 rgba(255, 255, 255, 0);
}
.mobile-menu-btn:hover,
.mobile-menu-btn:focus-visible {
    outline: none;
    color: #fff;
    text-shadow: 0 0 14px rgba(255, 255, 255, 0.32);
}

.mobile-menu-panel {
    position: fixed;
    top: calc(84px + var(--safe-top));
    left: 50%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 18px 20px;
    min-width: min(86vw, 280px);
    border: 0;
    border-radius: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    opacity: 0;
    transform: translateX(-50%) translateY(-8px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 18;
}
.mobile-menu-panel.open {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}
.mobile-menu-link {
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    font-family: var(--copy-font);
    font-size: 1.1rem;
    font-weight: 500;
    text-transform: uppercase;
    padding: 14px 6px;
    border: 0;
    border-radius: 0;
    background: transparent;
    text-align: center;
    transition: color 0.22s ease, text-shadow 0.32s var(--ease-soft);
    text-shadow: 0 0 0 rgba(255, 255, 255, 0);
}
.mobile-menu-link:hover,
.mobile-menu-link:focus-visible {
    color: #fff;
    text-shadow: 0 0 16px rgba(255, 255, 255, 0.3);
    outline: none;
}
body.reading-active .mobile-menu-btn,
body.reading-active .mobile-menu-panel {
    opacity: 0;
    pointer-events: none;
}

.site-link {
    font-family: 'Cormorant', 'Cormorant Garamond', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
    font-size: 1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    text-transform: uppercase;
    padding: 8px 2px;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    text-shadow: 0 0 0 rgba(255, 255, 255, 0);
    transition: color var(--motion-fast) ease, text-shadow 0.38s var(--ease-soft), opacity var(--motion-slow) var(--ease-soft) 0.18s;
}
.site-link:hover,
.site-link:focus-visible {
    color: #fff;
    text-shadow: 0 0 14px rgba(255, 255, 255, 0.3);
    outline: none;
}
body.reading-active .site-link {
    color: rgba(0, 0, 0, 0.74);
    background: transparent;
    text-shadow: 0 0 0 rgba(0, 0, 0, 0);
}
body.reading-active .site-link:hover {
    color: #000;
    background: transparent;
    text-shadow: 0 0 18px rgba(255, 255, 255, 0.55);
}
body.reading-active .logo-link { color: #000; }
body.reading-active .nav-top-right,
body.reading-active .nav-bottom-left,
body.reading-active .nav-bottom-right {
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--motion-base) var(--ease-soft);
}

.reading-light-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
}

body.reading-active #result-overlay {
    background: rgba(255, 255, 255, 0.28);
}
body.reading-active #result-title { color: #000; }
body.reading-active #result-text {
    color: rgba(0, 0, 0, 0.88);
    text-shadow: none;
}
body.reading-active .result-entry { color: rgba(0, 0, 0, 0.7); }
body.reading-active button.close-btn {
    color: rgba(0, 0, 0, 0.78);
    border: 0;
    background: transparent;
    text-shadow: 0 0 0 rgba(0, 0, 0, 0);
}
body.reading-active button.close-btn:hover {
    color: #000;
    background: transparent;
    text-shadow: 0 0 16px rgba(255, 255, 255, 0.55);
}

@media (max-width: 768px) {
    header { justify-content: center; }
    .intro-copy { margin-bottom: 24px; }
    #waitlist-content { width: 100vw; padding-left: 22px; padding-right: 22px; }
    #intro-section {
        width: min(94vw, 560px);
        top: 46%;
        transform: translate(-50%, -50%);
    }
    .intro-block { width: 100%; }
    button.primary-btn {
        width: auto;
        min-width: 0;
        white-space: nowrap;
        padding: 14px 6px;
        margin-top: 0;
    }
    .nav-top-right { display: none; }
    .field-marker { display: none; }
    .mobile-menu-btn {
        display: inline-flex;
        top: calc(var(--edge-margin) + var(--safe-top) + 4px);
        background: transparent;
        border: 0;
        color: rgba(255, 255, 255, 0.9);
        box-shadow: none;
    }
    .mobile-menu-panel {
        border: 0;
        background: transparent;
        box-shadow: none;
    }
    .mobile-menu-link {
        color: rgba(255, 255, 255, 0.88);
        border: 0;
        background: transparent;
    }
    .mobile-menu-link:hover,
    .mobile-menu-link:focus-visible {
        color: #fff;
        background: transparent;
        border: 0;
    }
    .nav-bottom-left,
    .nav-bottom-right { display: none; }
    .footer-legal { margin: 0 auto; }
    #contact-content .panel-card { text-align: center; }
    #contact-view .panel-body-rich { text-align: center; }
    #contact-content .form-actions { justify-content: center; }
    .panel-form { text-align: center; }
    #manifesto-view,
    #contact-view,
    #waitlist-view {
        padding-top: calc(88px + var(--safe-top));
        padding-bottom: calc(92px + var(--safe-bottom));
        box-sizing: border-box;
    }
    #manifesto-content,
    #contact-content,
    #waitlist-content {
        max-height: 100%;
    }
    #manifesto-content {
        padding-top: 64px;
    }
    #contact-content,
    #waitlist-content {
        padding-top: 48px;
    }
    #camera-container {
        --camera-y: -12vh;
    }
    #camera-container #canvas {
        /* Bump the blur a touch on mobile — smaller viewports render with more visible pixels per mm */
        filter: blur(22px) saturate(130%) contrast(112%);
        -webkit-filter: blur(22px) saturate(130%) contrast(112%);
    }

    /* Mobile: no container chrome — content sits directly over the atmosphere */
    #manifesto-content,
    #contact-content,
    #waitlist-content {
        border: 0;
        border-radius: 0;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-sizing: border-box;
    }
    /* Mobile dialog typography — atmospheric white on the home gradient */
    #manifesto-view .manifesto-body,
    #contact-view .panel-body,
    #waitlist-view .panel-body,
    #contact-view .panel-body-rich,
    .panel-form label {
        color: rgba(255, 255, 255, 0.9);
    }
    #contact-content .panel-card,
    #waitlist-content .panel-card {
        border: 0;
        background: transparent;
        box-shadow: none;
        padding: 0;
    }
    .panel-form input,
    .panel-form textarea,
    .panel-form select {
        color: rgba(255, 255, 255, 0.92);
        background: transparent;
        border: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    }
    .panel-form input:focus,
    .panel-form textarea:focus,
    .panel-form select:focus {
        border-bottom-color: rgba(255, 255, 255, 0.8);
        box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.8);
    }
    .panel-form input::placeholder,
    .panel-form textarea::placeholder {
        color: rgba(255, 255, 255, 0.48);
    }
    .panel-form select {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ddd' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    }
    .form-submit,
    .mobile-menu-btn,
    .primary-btn,
    .close-btn {
        color: rgba(255, 255, 255, 0.92);
        border: 0;
        background: transparent;
        box-shadow: none;
    }
    .form-submit:hover,
    .mobile-menu-btn:hover,
    .primary-btn:hover,
    .close-btn:hover {
        color: #fff;
        background: transparent;
        text-shadow: 0 0 18px rgba(255, 255, 255, 0.38);
    }
    body.manifesto-open .logo-link,
    body.contact-open .logo-link,
    body.waitlist-open .logo-link {
        color: #fff !important;
        opacity: 0 !important;
        text-shadow: none !important;
        filter: none !important;
    }
    body.contact-open #contact-view option,
    body.waitlist-open #waitlist-view option {
        color: #111 !important;
    }
    .form-actions {
        width: 100%;
        justify-content: center;
    }
    .form-submit {
        min-width: 0;
    }
}


main {
    flex-grow: 1;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 5;
}

footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 12px calc(var(--edge-margin) + var(--safe-right)) calc(var(--edge-margin) + var(--safe-bottom)) calc(var(--edge-margin) + var(--safe-left));
    box-sizing: border-box;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.45);
    z-index: 10;
    pointer-events: none;
}
footer .site-link { pointer-events: auto; }

.nav-bottom-left,
.nav-bottom-right {
    flex: 0 0 auto;
}

.footer-legal {
    flex: 0 0 auto;
    text-align: center;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.42);
    pointer-events: auto;
    transition: opacity 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.25s;
}
.footer-legal .legal-link {
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    transition: color 0.25s;
}
.footer-legal .legal-link:hover { color: rgba(255, 255, 255, 0.7); }
.footer-legal .legal-sep {
    margin: 0 6px;
    user-select: none;
}

/* Hide the field marker and legal links during a reading — keep the experience clean */
body.reading-active .field-marker,
body.reading-active .footer-legal {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s cubic-bezier(0.22, 0.8, 0.2, 1);
}

/* --- Standalone /waitlist page --- */
body.waitlist-page {
    overflow: auto;
    min-height: 100vh;
}
body.waitlist-page header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 20;
    pointer-events: none;
}
body.waitlist-page header .logo-link {
    pointer-events: auto;
}
.waitlist-main {
    min-height: 100dvh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(130px + var(--safe-top)) 24px calc(60px + var(--safe-bottom));
    box-sizing: border-box;
}
.waitlist-standalone {
    width: min(440px, 92vw);
    text-align: center;
    color: #fff;
}
.waitlist-standalone .panel-body {
    font-family: var(--copy-font);
    font-size: clamp(1.2rem, 1.8vw, 1.7rem);
    font-weight: 500;
    line-height: 1.25;
    font-variant-caps: all-small-caps;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 14px rgba(0, 0, 0, 0.35);
    margin: 0 0 28px 0;
}
.waitlist-standalone .panel-form { text-align: left; }
.waitlist-standalone .form-actions {
    justify-content: center;
    margin-top: 28px;
}
@media (max-width: 768px) {
    .waitlist-standalone { width: 100%; }
}

/* --- Legal pages --- */
body.legal-page {
    overflow: auto;
    min-height: 100vh;
}
body.legal-page #home-bg {
    animation: none;
}
@keyframes homeBgShiftLegal {
    0%, 100% { background-position: 0% 42%, 100% 58%, 0% 50%; }
    50% { background-position: 100% 58%, 0% 42%, 100% 50%; }
}
/* Keep nav + footer pinned like the main experience while long copy scrolls */
body.legal-page header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 20;
    pointer-events: none;
}
body.legal-page header .logo-link,
body.legal-page header .nav-top-right {
    pointer-events: auto;
}
body.legal-page .logo-link {
    transition: color 0.3s, opacity 0.35s ease, text-shadow 0.35s var(--ease-soft);
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
body.legal-page.scrolled .logo-link {
    background: transparent;
    border: 0;
    box-shadow: none;
    text-shadow: 0 0 22px rgba(0, 0, 0, 0.45);
}
body.legal-page footer .site-link,
body.legal-page footer .footer-legal {
    transition: color 0.3s ease, text-shadow 0.4s var(--ease-soft);
    border: 0;
    border-radius: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
}
body.legal-page footer .footer-legal {
    padding: 8px 0;
}
body.legal-page footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 20;
    background: transparent;
    padding-top: 0;
}
.legal-main {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(130px + var(--safe-top)) 24px calc(140px + var(--safe-bottom));
    box-sizing: border-box;
}
.legal-card {
    width: min(820px, 92vw);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    padding: 34px 34px 30px;
    box-sizing: border-box;
}
.legal-title {
    margin: 0 0 20px 0;
    font-family: 'Outline', sans-serif;
    font-size: clamp(2.4rem, 9vw, 4.8rem);
    font-weight: 100;
    text-transform: uppercase;
    color: #fff;
}
.legal-body {
    font-family: var(--copy-font);
    font-size: 1rem;
    line-height: 1.85;
    letter-spacing: 0.01em;
    color: rgba(255, 255, 255, 0.9);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: geometricPrecision;
}
.legal-body p {
    margin: 0 0 14px 0;
}
.legal-body p:last-child {
    margin-bottom: 0;
}
.legal-body a {
    color: rgba(255, 255, 255, 0.96);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.32);
}
.legal-body a:hover {
    border-bottom-color: rgba(255, 255, 255, 0.62);
}

/* --- Intro --- */
#intro-section {
    text-align: center;
    transition: opacity 1s cubic-bezier(0.22, 0.8, 0.2, 1), transform 1s cubic-bezier(0.22, 0.8, 0.2, 1);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    max-width: 90vw;
}
#intro-section.hidden {
    opacity: 0;
    transform: translate(-50%, calc(-50% - 24px)) scale(0.97);
    pointer-events: none;
}

.intro-block {
    padding: 0;
}

.intro-copy {
    font-family: var(--copy-font);
    font-weight: 500;
    font-size: clamp(1.35rem, 2vw, 1.85rem);
    line-height: 1.45;
    margin: 0 0 32px 0;
    padding: 0;
    letter-spacing: 0.015em;
    font-variant-caps: all-small-caps;
    color: rgba(255, 255, 255, 0.94);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.intro-copy + .primary-btn {
    margin: 0;
}

.intro-line {
    opacity: 0;
    transform: translateY(8px);
    animation: introLineFade 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
.intro-line:nth-child(2) { animation-delay: 0.35s; }
.intro-line:nth-child(3) { animation-delay: 0.7s; }

@keyframes introLineFade {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#intro-section.hidden .intro-line {
    opacity: 0;
    transform: translateY(-6px);
    animation: none;
}

.camera-error {
    display: none;
    margin-top: 20px;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
    padding: 20px 24px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.camera-error.show { display: block; }
.camera-error-title {
    font-size: 0.9rem;
    font-weight: 400;
    margin: 0 0 8px 0;
    color: rgba(255, 255, 255, 0.95);
}
.camera-error-steps {
    font-family: var(--copy-font);
    font-size: 0.8rem;
    font-weight: 300;
    line-height: 1.5;
    letter-spacing: 0.01em;
    margin: 0;
    color: rgba(255, 255, 255, 0.85);
}

button.primary-btn {
    font-family: 'Cravelo', serif;
    font-size: clamp(1.6rem, 3.2vw, 2.4rem);
    font-weight: 300;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.92);
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 18px 8px 16px;
    cursor: pointer;
    font-feature-settings: 'kern' 1;
    font-variant-ligatures: none;
    text-shadow: 0 0 0 rgba(255, 255, 255, 0);
    transition: color 0.4s var(--ease-soft), text-shadow 0.5s var(--ease-soft);
}
button.primary-btn:hover,
button.primary-btn:focus-visible {
    color: #fff;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.38), 0 0 22px rgba(255, 255, 255, 0.18);
    outline: none;
}
button.primary-btn:active {
    text-shadow: 0 0 16px rgba(255, 255, 255, 0.5), 0 0 30px rgba(255, 255, 255, 0.22);
}

/* --- Camera & Aura --- */
#camera-container {
    --camera-y: 0px;
    --camera-mask: radial-gradient(
        circle at 50% 50%,
        black 0%,
        black 12%,
        rgba(0,0,0,0.95) 25%,
        rgba(0,0,0,0.85) 38%,
        rgba(0,0,0,0.65) 50%,
        rgba(0,0,0,0.4) 60%,
        rgba(0,0,0,0.18) 68%,
        transparent 75%
    );
    position: relative;
    width: 420px;
    height: 420px;
    max-width: 72vw;
    max-height: 72vw;
    overflow: visible;
    opacity: 0;
    transform: translateY(var(--camera-y)) scale(0.8);
    transition: opacity 1s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 0 280px var(--camera-glow-soft, rgba(255,255,255,0.08));
    pointer-events: none;
    background: transparent;
    -webkit-mask-image: var(--camera-mask);
    mask-image: var(--camera-mask);
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}
#camera-container .camera-inner {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    -webkit-mask-image: var(--camera-mask);
    mask-image: var(--camera-mask);
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}
#camera-container.active {
    opacity: 1;
    transform: translateY(var(--camera-y)) scale(1);
    pointer-events: auto;
}

video { display: none; }
#camera-container #canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    /* Blur the painted video frames. Applied as CSS filter (rather than ctx.filter)
       so Safari and Chrome obscure the face to the same degree. */
    filter: blur(18px) saturate(125%) contrast(108%);
    -webkit-filter: blur(18px) saturate(125%) contrast(108%);
    transform: scale(1.06);
    transform-origin: center center;
}

/* --- Tension overlay (fully hidden when not visible so no text shows through) --- */
#reading-tension-overlay {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94), visibility 0s linear 1.2s;
}
#reading-tension-overlay.tension-visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94), visibility 0s;
}
.tension-line {
    font-family: 'Cormorant', 'Cormorant Garamond', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    font-weight: 500;
    text-transform: uppercase;
    color: rgba(0, 0, 0, 0.92);
    margin: 0;
    padding: 0;
    opacity: 0;
    transition: opacity 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
#reading-tension-overlay.tension-visible .tension-line.tension-show { opacity: 1; }

/* --- Result overlay --- */
#result-overlay {
    position: fixed;
    inset: 0;
    z-index: 15;
    /* No backdrop-filter — Safari has a rendering bug where text painted above a
       backdrop-filter element can get cached dark bounding boxes behind each glyph.
       A slightly stronger solid translucent wash reads almost identically without
       triggering the bug. */
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--motion-slow) var(--ease-soft), background var(--motion-base) var(--ease-soft);
    pointer-events: none;
    padding: 50px;
    box-sizing: border-box;
    text-align: center;
    isolation: isolate;
}
#result-overlay.show { opacity: 1; pointer-events: auto; }

.result-entry {
    font-family: 'Cormorant', 'Cormorant Garamond', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    color: rgba(0, 0, 0, 0.7);
    margin: 0 0 8px 0;
    padding: 0;
    -webkit-user-select: none;
    user-select: none;
}
#result-title {
    font-family: 'Outline', sans-serif;
    font-size: clamp(3.5rem, 14vw, 7rem);
    font-weight: 100;
    text-transform: uppercase;
    color: #000;
    margin-bottom: 24px;
    padding: 0;
    font-feature-settings: 'kern' 1;
    font-variant-ligatures: none;
    transition: color 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    -webkit-user-select: none;
    user-select: none;
}
#result-text {
    font-size: 1.125rem;
    line-height: 1.7;
    font-weight: 300;
    margin-bottom: 32px;
    max-width: 28em;
    padding: 0;
    white-space: pre-line;
    animation: floatText 4s ease-in-out infinite alternate;
    text-shadow: 0 1px 14px rgba(0, 0, 0, 0.14);
    transition: color var(--motion-slow) var(--ease-soft), text-shadow var(--motion-base) var(--ease-soft);
    -webkit-user-select: none;
    user-select: none;
}
@keyframes floatText {
    0% { transform: translateY(0); }
    100% { transform: translateY(-10px); }
}

button.close-btn {
    padding: 10px 4px;
    background: transparent;
    color: rgba(255, 255, 255, 0.88);
    border: 0;
    border-radius: 0;
    cursor: pointer;
    font-family: var(--copy-font);
    font-size: 1.1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.015em;
    font-variant-caps: all-small-caps;
    text-shadow: 0 0 0 rgba(255, 255, 255, 0);
    transition: color 0.32s var(--ease-soft), text-shadow 0.4s var(--ease-soft);
}
button.close-btn:hover,
button.close-btn:focus-visible {
    color: #fff;
    text-shadow: 0 0 14px rgba(255, 255, 255, 0.32);
    outline: none;
}

/* --- Manifesto --- */
#manifesto-view {
    position: fixed;
    inset: 0;
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.22, 0.8, 0.2, 1);
}
#manifesto-view.show { opacity: 1; pointer-events: auto; cursor: pointer; }
#manifesto-content {
    text-align: center;
    width: min(92vw, 62rem);
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    padding: 40px 16px 48px;
    border: 0;
    border-radius: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    -webkit-user-select: none;
    user-select: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.85s cubic-bezier(0.22, 0.8, 0.2, 1), transform 0.85s cubic-bezier(0.22, 0.8, 0.2, 1);
}
#manifesto-view.show #manifesto-content {
    opacity: 1;
    transform: none;
}
#manifesto-view .manifesto-body {
    font-family: var(--copy-font);
    font-size: clamp(1.4rem, 3.1vw, 2.4rem);
    font-weight: 500;
    line-height: 1.38;
    letter-spacing: 0.02em;
    font-variant-caps: all-small-caps;
    color: rgba(255, 255, 255, 0.94);
    text-shadow: 0 1px 14px rgba(0, 0, 0, 0.35);
    margin: 0 0 48px 0;
    white-space: pre-line;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.55s cubic-bezier(0.22, 0.8, 0.2, 1) 0.1s, transform 0.55s cubic-bezier(0.22, 0.8, 0.2, 1) 0.1s;
}
#manifesto-view.show .manifesto-body { opacity: 1; transform: translateY(0); }

body.manifesto-open #intro-section,
body.manifesto-open #camera-container,
body.manifesto-open #result-overlay,
body.contact-open #intro-section,
body.contact-open #camera-container,
body.contact-open #result-overlay,
body.waitlist-open #intro-section,
body.waitlist-open #camera-container,
body.waitlist-open #result-overlay {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* --- Contact & Waitlist --- */
#contact-view,
#waitlist-view {
    position: fixed;
    inset: 0;
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.22, 0.8, 0.2, 1);
}
#contact-view.show,
#waitlist-view.show { opacity: 1; pointer-events: auto; }
#contact-view.show { cursor: pointer; }
#contact-content,
#waitlist-content {
    text-align: center;
    width: min(94vw, 54rem);
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    max-width: none;
    padding: 32px 16px;
    -webkit-user-select: none;
    user-select: none;
    border: 0;
    border-radius: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.72s cubic-bezier(0.22, 0.8, 0.2, 1), transform 0.72s cubic-bezier(0.22, 0.8, 0.2, 1);
}
#contact-view.show #contact-content,
#waitlist-view.show #waitlist-content {
    opacity: 1;
    transform: none;
}

#contact-content {
    width: min(92vw, 42rem);
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    scrollbar-width: thin;
}
#waitlist-content {
    width: min(94vw, 28rem);
}
#contact-content .panel-card {
    text-align: left;
}
#contact-content .form-actions {
    margin-top: 18px;
    justify-content: center;
}
.panel-card {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    padding: 40px 36px 34px;
    background: rgba(255, 255, 255, 0.12);
    opacity: 0;
    transform: translateY(12px) scale(0.99);
    transition: opacity 0.72s cubic-bezier(0.22, 0.8, 0.2, 1), transform 0.72s cubic-bezier(0.22, 0.8, 0.2, 1);
}
#contact-content .panel-card,
#waitlist-content .panel-card {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
#contact-view.show .panel-card,
#waitlist-view.show .panel-card {
    opacity: 1;
    transform: translateY(0) scale(1);
}
#contact-view .panel-body,
#waitlist-view .panel-body {
    font-family: var(--copy-font);
    font-size: clamp(1.2rem, 1.8vw, 1.7rem);
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: 0.015em;
    font-variant-caps: all-small-caps;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 14px rgba(0, 0, 0, 0.35);
    margin: 0 0 20px 0;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s cubic-bezier(0.22, 0.8, 0.2, 1) 0.06s, transform 0.5s cubic-bezier(0.22, 0.8, 0.2, 1) 0.06s;
}
#waitlist-view .panel-body {
    line-height: 1.25;
}
#contact-view.show .panel-body,
#waitlist-view.show .panel-body { opacity: 1; transform: translateY(0); }

#contact-view .panel-body-rich {
    text-align: left;
    max-width: 44rem;
}
#contact-view .panel-body-rich p {
    margin: 0 0 14px 0;
}
#contact-view .panel-body-rich p:last-child {
    margin-bottom: 0;
}
#contact-view .panel-contact-email {
    margin-top: 28px;
    text-align: center;
}
#contact-view .panel-contact-email a {
    font-family: var(--copy-font);
    font-size: clamp(1rem, 1.4vw, 1.35rem);
    font-weight: 500;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.94);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.32);
    padding-bottom: 2px;
    transition: border-bottom-color 0.3s ease, color 0.3s ease;
}
#contact-view .panel-contact-email a:hover,
#contact-view .panel-contact-email a:focus-visible {
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, 0.72);
    outline: none;
}

/* --- Waitlist submission states --- */
.waitlist-confirm {
    display: none;
    font-family: var(--copy-font);
    font-size: clamp(1.2rem, 1.8vw, 1.7rem);
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: 0.015em;
    font-variant-caps: all-small-caps;
    color: rgba(255, 255, 255, 0.96);
    text-shadow: 0 1px 14px rgba(0, 0, 0, 0.35);
    margin: 0;
    padding: 32px 0;
    text-align: center;
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.22, 0.8, 0.2, 1);
}
#waitlist-content.waitlist-success .waitlist-confirm,
#waitlist-standalone.waitlist-success .waitlist-confirm {
    display: block;
    opacity: 1;
}
#waitlist-content.waitlist-success .panel-body,
#waitlist-content.waitlist-success .panel-form,
#waitlist-content.waitlist-success .form-actions,
#waitlist-content.waitlist-success .waitlist-error,
#waitlist-standalone.waitlist-success .panel-body,
#waitlist-standalone.waitlist-success .panel-form,
#waitlist-standalone.waitlist-success .form-actions,
#waitlist-standalone.waitlist-success .waitlist-error {
    display: none;
}
.waitlist-error {
    font-family: var(--copy-font);
    font-size: 1rem;
    font-weight: 500;
    color: rgba(255, 200, 200, 0.92);
    text-align: center;
    margin: 14px 0 0 0;
}
.form-submit[disabled] {
    opacity: 0.55;
    cursor: default;
}
.panel-form {
    text-align: left;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.52s cubic-bezier(0.22, 0.8, 0.2, 1) 0.08s, transform 0.52s cubic-bezier(0.22, 0.8, 0.2, 1) 0.08s;
}
#contact-view.show .panel-form,
#waitlist-view.show .panel-form,
.waitlist-standalone .panel-form { opacity: 1; transform: translateY(0); }
.form-row { margin-bottom: 14px; }
.panel-form label {
    display: block;
    font-family: 'Cormorant', 'Cormorant Garamond', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
    font-size: 0.68rem;
    font-weight: 400;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.62);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}
.panel-form input,
.panel-form textarea,
.panel-form select {
    width: 100%;
    box-sizing: border-box;
    font-family: 'Cormorant', 'Cormorant Garamond', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
    font-size: 0.95rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.94);
    background: transparent;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0;
    padding: 10px 0 8px;
    transition: border-color 0.35s var(--ease-soft), box-shadow 0.35s var(--ease-soft);
}
.panel-form input::placeholder,
.panel-form textarea::placeholder { color: rgba(255, 255, 255, 0.48); }
.panel-form input:focus,
.panel-form textarea:focus,
.panel-form select:focus {
    outline: none;
    border-bottom-color: rgba(255, 255, 255, 0.82);
    box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.82), 0 14px 24px -18px rgba(0, 0, 0, 0.55);
}
/* Chrome/Safari paint autofilled inputs with a light yellow/blue background and
   force their own text colour — override both. The long transition is the standard
   trick to keep the browser from re-applying its default colour after render. */
.panel-form input:-webkit-autofill,
.panel-form input:-webkit-autofill:hover,
.panel-form input:-webkit-autofill:focus,
.panel-form input:-webkit-autofill:active,
.panel-form select:-webkit-autofill,
.panel-form select:-webkit-autofill:hover,
.panel-form select:-webkit-autofill:focus,
.panel-form select:-webkit-autofill:active,
.panel-form textarea:-webkit-autofill,
.panel-form textarea:-webkit-autofill:hover,
.panel-form textarea:-webkit-autofill:focus,
.panel-form textarea:-webkit-autofill:active {
    -webkit-text-fill-color: rgba(255, 255, 255, 0.94);
    -webkit-box-shadow: 0 0 0 1000px transparent inset, 0 1px 0 0 rgba(255, 255, 255, 0.3);
    caret-color: rgba(255, 255, 255, 0.94);
    transition: background-color 9999s ease-in-out 0s, color 9999s ease-in-out 0s;
}
.panel-form input:-webkit-autofill:focus,
.panel-form select:-webkit-autofill:focus,
.panel-form textarea:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px transparent inset, 0 1px 0 0 rgba(255, 255, 255, 0.82);
}
/* Firefox equivalent */
.panel-form input:autofill,
.panel-form select:autofill,
.panel-form textarea:autofill {
    background: transparent !important;
    color: rgba(255, 255, 255, 0.94) !important;
}
/* Suppress browser validation styling (red/pink backgrounds on :invalid in Safari/Firefox) */
.panel-form input:invalid,
.panel-form input:user-invalid,
.panel-form textarea:invalid,
.panel-form select:invalid {
    background: transparent;
    box-shadow: none;
}
.panel-form textarea { min-height: 110px; resize: vertical; }
.panel-form select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: transparent !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23eee' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 2px center;
    padding-right: 28px;
    /* Safari autofills the native control directly, bypassing :-webkit-autofill.
       Force the colour tokens at the base level so the browser can't override. */
    color: rgba(255, 255, 255, 0.94);
    -webkit-text-fill-color: rgba(255, 255, 255, 0.94);
}
.panel-form select:hover,
.panel-form select:focus,
.panel-form select:active {
    background-color: transparent !important;
    color: rgba(255, 255, 255, 0.94);
    -webkit-text-fill-color: rgba(255, 255, 255, 0.94);
}
/* The dropdown list that opens from the <select> inherits from here in some browsers;
   lock it down too so the open menu doesn't read as light-on-light. */
.panel-form select option {
    background: #0e0820;
    color: #fff;
}
.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
}
.form-submit {
    font-family: 'Cormorant', 'Cormorant Garamond', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
    font-size: 0.78rem;
    font-weight: 400;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.88);
    background: transparent;
    border: 0;
    border-radius: 0;
    min-width: 0;
    padding: 12px 4px;
    cursor: pointer;
    text-shadow: 0 0 0 rgba(0, 0, 0, 0);
    transition: color var(--motion-fast) ease, text-shadow 0.4s var(--ease-soft);
}
.form-submit:hover,
.form-submit:focus-visible {
    color: #fff;
    background: transparent;
    text-shadow: 0 0 18px rgba(255, 255, 255, 0.42);
    outline: none;
}
/* Centering for the waitlist submit button */
#waitlist-view .form-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

body.manifesto-open .nav-bottom-right .site-link,
body.manifesto-open .nav-top-right .site-link,
body.contact-open .nav-bottom-left .site-link,
body.contact-open .nav-top-right .site-link,
body.waitlist-open .nav-bottom-left .site-link,
body.waitlist-open .nav-bottom-right .site-link,
body.manifesto-open .field-marker,
body.contact-open .field-marker,
body.waitlist-open .field-marker,
body.manifesto-open .footer-legal,
body.contact-open .footer-legal,
body.waitlist-open .footer-legal {
    opacity: 0.25;
    pointer-events: none;
    transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
body.manifesto-open::before,
body.contact-open::before,
body.waitlist-open::before {
    opacity: 0.48;
}

/* ---- Final system cleanup layer ---- */
/* All three dialogs sit over the home atmosphere now — keep text in white. */
@media (hover: hover) and (pointer: fine) {
    body.manifesto-open #manifesto-view h1,
    body.manifesto-open #manifesto-view p {
        color: #fff !important;
    }
    body.contact-open #contact-view p,
    body.contact-open #contact-view a,
    body.contact-open #contact-view label,
    body.contact-open #contact-view input,
    body.contact-open #contact-view textarea,
    body.contact-open #contact-view select,
    body.waitlist-open #waitlist-view p,
    body.waitlist-open #waitlist-view a,
    body.waitlist-open #waitlist-view label,
    body.waitlist-open #waitlist-view input,
    body.waitlist-open #waitlist-view textarea,
    body.waitlist-open #waitlist-view select {
        color: rgba(255, 255, 255, 0.92) !important;
    }
    body.contact-open #contact-view input::placeholder,
    body.contact-open #contact-view textarea::placeholder,
    body.waitlist-open #waitlist-view input::placeholder,
    body.waitlist-open #waitlist-view textarea::placeholder {
        color: rgba(255, 255, 255, 0.48) !important;
    }
}

/* Mobile touch-only niceties */
@media (max-width: 768px) and (pointer: coarse) {
    body.reading-active .mobile-menu-btn,
    body.reading-active .mobile-menu-panel {
        opacity: 0 !important;
        pointer-events: none !important;
    }
}
