:root {
    --ink: #20272a;
    --muted: #657074;
    --teal: #169d9b;
    --teal-deep: #087878;
    --plum: #3a253f;
    --wine: #61335b;
    --lavender: #f2eaf5;
    --gold: #c9993f;
    --paper: #fcfaf8;
    --line: rgba(52, 41, 61, 0.13);
    --card: rgba(255, 255, 255, 0.86);
    --shadow: 0 18px 50px rgba(55, 33, 58, 0.12);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background: #f9f7f5;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

button,
input,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

a {
    color: inherit;
}

:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 3px;
}

.page-art {
    position: fixed;
    z-index: -2;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.68) 0%, rgba(255, 255, 255, 0.9) 45%, rgba(251, 247, 248, 0.78) 100%),
        url("sonia-foundation.jpg") center top / cover no-repeat;
}

.page-art::after {
    position: absolute;
    z-index: -1;
    inset: 0;
    content: "";
    background:
        radial-gradient(circle at 8% 20%, rgba(100, 48, 95, 0.12), transparent 22rem),
        radial-gradient(circle at 92% 78%, rgba(22, 157, 155, 0.1), transparent 24rem);
}

.shell {
    width: min(1180px, calc(100% - 40px));
    margin-inline: auto;
}

.skip-link {
    position: fixed;
    z-index: 20;
    top: 10px;
    left: 10px;
    padding: 10px 14px;
    transform: translateY(-150%);
    border-radius: 10px;
    color: #fff;
    background: var(--plum);
    text-decoration: none;
}

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

.skip-link:focus {
    transform: translateY(0);
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 84px;
    gap: 16px;
}

.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-size: 0.86rem;
    font-weight: 750;
    letter-spacing: 0.02em;
    text-decoration: none;
}

.wordmark-eye {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 2px solid var(--teal);
    border-radius: 55% 45% 55% 45%;
    color: var(--teal);
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 0.7;
    transform: rotate(-12deg);
}

.gathering-pill,
.stream-status,
.reaction-hint,
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.gathering-pill {
    padding: 8px 12px;
    color: var(--plum);
    background: rgba(255, 255, 255, 0.52);
}

.guest-layout {
    padding-bottom: 42px;
}

.hero-copy {
    width: min(710px, 100%);
    padding: 52px 0 36px;
}

.eyebrow {
    margin: 0 0 9px;
    color: var(--teal-deep);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    color: var(--plum);
    font-family: Iowan Old Style, Baskerville, "Times New Roman", serif;
    line-height: 1.05;
}

h1 {
    max-width: 13ch;
    margin-bottom: 16px;
    font-size: clamp(2.7rem, 6vw, 5.1rem);
    font-weight: 500;
    letter-spacing: -0.045em;
}

h2 {
    margin-bottom: 0;
    font-size: clamp(1.65rem, 3vw, 2.15rem);
    font-weight: 500;
    letter-spacing: -0.025em;
}

h3 {
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.lead {
    max-width: 620px;
    margin-bottom: 12px;
    color: #394346;
    font-size: clamp(1.08rem, 2vw, 1.34rem);
}

.quiet-note,
.field-note,
.identity-line {
    color: var(--muted);
    font-size: 0.92rem;
}

.quiet-note {
    margin-bottom: 0;
}

.card {
    border: 1px solid rgba(77, 52, 83, 0.12);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.stream-section {
    padding: clamp(20px, 4vw, 34px);
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 21px;
}

.section-heading .eyebrow {
    margin-bottom: 7px;
}

.stream-status {
    flex: none;
    padding: 8px 11px;
    background: rgba(255, 255, 255, 0.7);
}

.stream-status > span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #a8afb0;
}

.stream-status--ready {
    border-color: rgba(22, 157, 155, 0.25);
    color: var(--teal-deep);
}

.stream-status--ready > span {
    background: var(--teal);
    box-shadow: 0 0 0 4px rgba(22, 157, 155, 0.12);
}

.stream-frame {
    position: relative;
    display: grid;
    overflow: hidden;
    min-height: min(57vw, 580px);
    place-items: center;
    border: 1px solid rgba(35, 31, 40, 0.12);
    border-radius: 17px;
    background:
        linear-gradient(135deg, rgba(29, 119, 116, 0.9), rgba(57, 35, 62, 0.94)),
        #34223b;
    aspect-ratio: 16 / 9;
}

.stream-frame::before {
    position: absolute;
    inset: 0;
    content: "";
    opacity: 0.23;
    background: url("sonia-foundation.jpg") center / cover no-repeat;
    mix-blend-mode: screen;
}

.stream-frame iframe {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    border: 0;
}

.stream-placeholder {
    position: relative;
    z-index: 1;
    max-width: 440px;
    padding: 34px 28px;
    color: rgba(255, 255, 255, 0.88);
    text-align: center;
}

.stream-placeholder h3 {
    color: #fff;
}

.stream-placeholder p {
    margin-bottom: 0;
}

.placeholder-icon,
.gate-symbol {
    display: grid;
    width: 52px;
    height: 52px;
    margin: 0 auto 18px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 50%;
    color: #fff;
    font-size: 1.45rem;
}

.engage-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    align-items: start;
    gap: 24px;
    margin-top: 24px;
}

.reactions-card,
.comments-card,
.settings-card,
.reaction-summary,
.moderation-card {
    padding: clamp(20px, 3vw, 30px);
}

.reaction-hint {
    padding: 7px 10px;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.6);
}

.reaction-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.reaction-button {
    display: flex;
    min-height: 142px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-direction: column;
    padding: 15px 8px;
    border: 1px solid rgba(96, 57, 92, 0.15);
    border-radius: 17px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.64);
    box-shadow: 0 5px 14px rgba(56, 35, 59, 0.05);
    transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.reaction-button:hover:not(:disabled),
.reaction-button:focus-visible {
    border-color: rgba(22, 157, 155, 0.55);
    background: #fff;
    box-shadow: 0 9px 20px rgba(28, 100, 97, 0.14);
    transform: translateY(-3px);
}

.reaction-button.is-sent {
    animation: reaction-pop 410ms ease-out;
}

.reaction-emoji {
    font-size: 2rem;
    line-height: 1;
}

.reaction-label {
    color: var(--plum);
    font-size: 0.84rem;
    font-weight: 750;
}

.reaction-total {
    color: var(--muted);
    font-size: 0.75rem;
}

.comments-heading {
    margin-bottom: 8px;
}

.identity-line {
    min-height: 23px;
    margin-bottom: 16px;
}

.comment-form textarea,
.stacked-form textarea,
.stacked-form input {
    width: 100%;
    border: 1px solid rgba(70, 59, 76, 0.2);
    border-radius: 13px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.83);
    box-shadow: inset 0 1px 1px rgba(60, 37, 63, 0.03);
    transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.comment-form textarea {
    display: block;
    min-height: 106px;
    resize: vertical;
    padding: 13px 14px;
}

.comment-form textarea:focus,
.stacked-form textarea:focus,
.stacked-form input:focus {
    border-color: var(--teal);
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(22, 157, 155, 0.1);
}

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 11px;
}

.character-hint {
    color: var(--muted);
    font-size: 0.77rem;
}

.primary-button,
.secondary-button,
.compact-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 42px;
    border: 1px solid transparent;
    border-radius: 11px;
    font-weight: 750;
    text-decoration: none;
    transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.primary-button {
    padding: 10px 15px;
    color: #fff;
    background: var(--teal-deep);
    box-shadow: 0 8px 16px rgba(5, 95, 95, 0.18);
}

.primary-button:hover:not(:disabled) {
    background: #076a6a;
    box-shadow: 0 10px 20px rgba(5, 95, 95, 0.26);
    transform: translateY(-1px);
}

.secondary-button {
    padding: 10px 14px;
    border-color: rgba(56, 37, 61, 0.2);
    color: var(--plum);
    background: rgba(255, 255, 255, 0.7);
}

.secondary-button:hover {
    background: #fff;
    transform: translateY(-1px);
}

.text-button {
    padding: 5px 0;
    border: 0;
    color: var(--teal-deep);
    background: transparent;
    font-size: 0.88rem;
    font-weight: 750;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.form-feedback {
    min-height: 21px;
    margin: 10px 0 0;
    color: var(--teal-deep);
    font-size: 0.86rem;
    font-weight: 650;
}

.form-feedback.is-error {
    color: #9b2b42;
}

.comment-feed {
    display: grid;
    gap: 0;
    max-height: 474px;
    margin: 23px 0 0;
    padding: 0;
    overflow: auto;
    border-top: 1px solid var(--line);
    list-style: none;
}

.comment-item {
    display: grid;
    grid-template-columns: 37px 1fr;
    gap: 11px;
    padding: 15px 2px;
    border-bottom: 1px solid var(--line);
}

.comment-avatar {
    display: grid;
    width: 37px;
    height: 37px;
    place-items: center;
    border-radius: 50%;
    color: var(--teal-deep);
    background: #d8f0ef;
    font-size: 0.83rem;
    font-weight: 800;
}

.comment-meta {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 7px;
    color: var(--ink);
    font-size: 0.84rem;
}

.comment-meta time {
    color: var(--muted);
    font-size: 0.75rem;
}

.comment-item p,
.moderation-content p {
    margin: 4px 0 0;
    color: #3d4648;
    font-size: 0.91rem;
    overflow-wrap: anywhere;
}

.empty-comments,
.empty-admin-state {
    padding: 20px 2px;
    color: var(--muted);
    font-size: 0.91rem;
    text-align: center;
}

.is-hidden {
    display: none !important;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 0 28px;
    color: var(--muted);
    font-size: 0.8rem;
}

.site-footer a {
    color: var(--teal-deep);
    font-weight: 700;
    text-decoration: none;
}

.guest-gate {
    position: fixed;
    z-index: 10;
    display: grid;
    inset: 0;
    place-items: center;
    padding: 24px;
    background: rgba(42, 30, 47, 0.42);
    backdrop-filter: blur(8px);
    transition: opacity 220ms ease, visibility 220ms ease;
}

.guest-gate.is-hidden {
    visibility: hidden;
    opacity: 0;
}

.guest-gate-card {
    width: min(100%, 440px);
    padding: 34px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 28px 70px rgba(32, 16, 39, 0.32);
}

.guest-gate-card h2 {
    margin-bottom: 11px;
    font-size: 2rem;
}

.guest-gate-card > p:not(.eyebrow) {
    color: var(--muted);
}

.gate-symbol {
    margin-left: 0;
    border-color: rgba(22, 157, 155, 0.25);
    color: var(--teal-deep);
    background: #ebf8f7;
}

.guest-gate-card form,
.stacked-form {
    display: grid;
    gap: 9px;
}

.guest-gate-card label,
.stacked-form label {
    margin-top: 7px;
    color: var(--ink);
    font-size: 0.84rem;
    font-weight: 750;
}

.guest-gate-card input {
    width: 100%;
    min-height: 47px;
    padding: 10px 12px;
    border: 1px solid rgba(70, 59, 76, 0.2);
    border-radius: 12px;
}

.guest-gate-card .primary-button {
    width: 100%;
    margin-top: 10px;
}

.noscript-notice {
    position: fixed;
    z-index: 30;
    right: 16px;
    bottom: 16px;
    left: 16px;
    padding: 14px;
    border-radius: 12px;
    color: #fff;
    background: var(--plum);
    text-align: center;
}

.floating-reactions {
    position: fixed;
    z-index: 6;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.floating-reaction {
    position: absolute;
    bottom: -70px;
    font-size: clamp(1.9rem, 4vw, 3.4rem);
    filter: drop-shadow(0 8px 8px rgba(45, 24, 47, 0.25));
    animation: float-up 3.9s cubic-bezier(0.14, 0.58, 0.23, 0.97) forwards;
}

.reaction-lane-0 { left: 10%; }
.reaction-lane-1 { left: 18%; }
.reaction-lane-2 { left: 26%; }
.reaction-lane-3 { left: 34%; }
.reaction-lane-4 { left: 42%; }
.reaction-lane-5 { left: 50%; }
.reaction-lane-6 { left: 58%; }
.reaction-lane-7 { left: 66%; }
.reaction-lane-8 { left: 74%; }
.reaction-lane-9 { left: 82%; }

.system-alert {
    margin: 10px 0 20px;
    padding: 13px 16px;
    border: 1px solid rgba(115, 79, 30, 0.2);
    border-radius: 13px;
    color: #6d4e1d;
    background: rgba(255, 249, 231, 0.92);
}

.system-alert--success {
    border-color: rgba(22, 157, 155, 0.22);
    color: #056c6a;
    background: rgba(233, 249, 247, 0.94);
}

.system-alert--error {
    border-color: rgba(166, 44, 71, 0.24);
    color: #8f2640;
    background: rgba(255, 239, 243, 0.94);
}

.admin-main {
    padding: 36px 0 64px;
}

.admin-auth {
    width: min(100%, 545px);
    margin: 55px auto;
    padding: clamp(25px, 5vw, 44px);
}

.admin-auth h1 {
    max-width: none;
    margin-bottom: 14px;
    font-size: clamp(2.3rem, 5vw, 3.55rem);
}

.admin-auth > p {
    color: var(--muted);
}

.admin-auth code {
    padding: 2px 4px;
    border-radius: 5px;
    color: var(--plum);
    background: var(--lavender);
    font-size: 0.88em;
}

.stacked-form {
    margin-top: 23px;
}

.stacked-form input,
.stacked-form textarea {
    min-height: 46px;
    padding: 10px 12px;
    resize: vertical;
}

.stacked-form .primary-button {
    justify-self: start;
    margin-top: 11px;
}

.field-note {
    margin: -1px 0 2px;
    font-size: 0.8rem;
}

.admin-welcome {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin: 18px 0 25px;
}

.admin-welcome h1 {
    max-width: none;
    margin-bottom: 10px;
    font-size: clamp(2.45rem, 5vw, 4rem);
}

.admin-welcome p:not(.eyebrow) {
    margin: 0;
    color: var(--muted);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 13px;
    margin-bottom: 24px;
}

.stat-card {
    padding: 18px;
    border: 1px solid rgba(77, 52, 83, 0.12);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.76);
    box-shadow: 0 8px 20px rgba(55, 33, 58, 0.06);
}

.stat-card span {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 0.77rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.stat-card strong {
    color: var(--plum);
    font-family: Iowan Old Style, Baskerville, "Times New Roman", serif;
    font-size: 2rem;
    font-weight: 500;
}

.admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
    gap: 24px;
    margin-bottom: 24px;
}

.reaction-summary dl {
    display: grid;
    gap: 0;
    margin: 22px 0 0;
}

.reaction-summary dl div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
}

.reaction-summary dt {
    color: var(--ink);
    font-size: 0.93rem;
}

.reaction-summary dd {
    margin: 0;
    color: var(--teal-deep);
    font-size: 1.15rem;
    font-weight: 800;
}

.moderation-list {
    border-top: 1px solid var(--line);
}

.moderation-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
}

.moderation-content {
    min-width: 0;
}

.status-badge {
    padding: 3px 7px;
    font-size: 0.64rem;
}

.status-badge--approved {
    border-color: rgba(22, 157, 155, 0.22);
    color: var(--teal-deep);
    background: #ebf8f7;
}

.status-badge--hidden {
    border-color: rgba(112, 103, 114, 0.2);
    color: #685e6b;
    background: #f4f2f4;
}

.moderation-actions {
    display: flex;
    flex: none;
    align-items: center;
    gap: 7px;
}

.moderation-actions form {
    margin: 0;
}

.compact-button {
    min-height: 34px;
    padding: 7px 10px;
    border-color: rgba(56, 37, 61, 0.16);
    color: var(--plum);
    background: rgba(255, 255, 255, 0.82);
    font-size: 0.77rem;
}

.compact-button:hover {
    background: #fff;
}

.compact-button--danger {
    border-color: rgba(158, 46, 67, 0.2);
    color: #9b2b42;
    background: #fff6f7;
}

@keyframes float-up {
    0% {
        opacity: 0;
        transform: translate3d(0, 0, 0) scale(0.65) rotate(-8deg);
    }
    12% {
        opacity: 1;
    }
    82% {
        opacity: 0.9;
    }
    100% {
        opacity: 0;
        transform: translate3d(26px, -106vh, 0) scale(1.18) rotate(10deg);
    }
}

@keyframes reaction-pop {
    50% {
        transform: translateY(-5px) scale(1.04);
    }
}

@media (max-width: 800px) {
    .hero-copy {
        padding-top: 32px;
    }

    .engage-grid,
    .admin-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-welcome {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 560px) {
    .shell {
        width: min(100% - 28px, 1180px);
    }

    .site-header {
        min-height: 72px;
    }

    .wordmark {
        max-width: 225px;
        font-size: 0.72rem;
    }

    .wordmark-eye {
        width: 28px;
        height: 28px;
        font-size: 1.4rem;
    }

    .gathering-pill {
        padding: 6px 8px;
        font-size: 0.64rem;
    }

    .hero-copy {
        padding-bottom: 27px;
    }

    h1 {
        font-size: clamp(2.45rem, 14vw, 3.6rem);
    }

    .section-heading {
        gap: 12px;
    }

    .stream-status,
    .reaction-hint {
        font-size: 0.62rem;
    }

    .stream-frame {
        min-height: 58vw;
    }

    .reaction-button {
        min-height: 118px;
    }

    .reaction-emoji {
        font-size: 1.65rem;
    }

    .reaction-label {
        font-size: 0.72rem;
    }

    .form-row,
    .site-footer,
    .moderation-row {
        align-items: stretch;
        flex-direction: column;
    }

    .form-row .primary-button {
        width: 100%;
    }

    .site-footer {
        gap: 5px;
    }

    .guest-gate {
        padding: 14px;
    }

    .guest-gate-card {
        padding: 26px 22px;
    }

    .admin-main {
        padding-top: 16px;
    }

    .admin-auth {
        margin: 20px auto;
    }

    .moderation-actions {
        flex-wrap: wrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
