/* ============================================================
   OhFace palette system
   Active palette is whichever :root block is uncommented below.
   Swap palettes by commenting out one block and uncommenting another.
   ============================================================ */

/* ---- Option D: Hypercolor Trust (ACTIVE) ----
   Trust foundation (teal/cream/navy) + curated 90s neon accents.
   Foundation does the safety work; neons do the joy.
*/
:root {
    /* Foundation — trust */
    --of-primary:        #0F8B8D;   /* deep teal */
    --of-primary-dark:   #0A6E70;
    --of-primary-soft:   #DCEDED;
    --of-bg:             #FBF9F4;   /* warm off-white */
    --of-surface:        #FFFFFF;
    --of-text:           #1D3557;   /* deep navy */
    --of-text-muted:     #6B7B8C;
    --of-border:         #E5E1D8;

    /* Neon accent layer — joy */
    --of-neon-pink:      #FF4FB7;   /* primary CTA, love reaction */
    --of-neon-pink-dark: #E03A9C;
    --of-neon-lime:      #5DE065;   /* positive credit counters */
    --of-neon-yellow:    #FFE94A;   /* highlighter strokes */
    --of-neon-purple:    #9D4EDD;   /* badges, achievements */
    --of-neon-cyan:      #3EE6E6;   /* hover, link underlines */

    /* Functional */
    --of-success:        var(--of-neon-lime);
    --of-danger:         #E63946;
    --of-shadow-soft:    0 1px 3px rgba(29, 53, 87, 0.08);
    --of-shadow-chunky:  0 4px 0 rgba(29, 53, 87, 0.15);
}

/* ---- Option A: Warm Sage ----
:root {
    --of-primary: #7C9A82; --of-primary-dark: #5E7A65; --of-primary-soft: #E8EFE9;
    --of-bg: #FAF7F0; --of-surface: #FFFFFF;
    --of-text: #2D3033; --of-text-muted: #8E8B86; --of-border: #E5E1D8;
    --of-neon-pink: #F4A988; --of-neon-pink-dark: #D88562;
    --of-neon-lime: #A4B8A6; --of-neon-yellow: #F1D399;
    --of-neon-purple: #9F8FA8; --of-neon-cyan: #B0CFD0;
    --of-success: var(--of-neon-lime); --of-danger: #C97064;
    --of-shadow-soft: 0 1px 3px rgba(45,48,51,0.08);
    --of-shadow-chunky: 0 4px 0 rgba(45,48,51,0.12);
}
*/

/* ---- Option B: Trust Teal + Sunshine (no neon) ----
:root {
    --of-primary: #0F8B8D; --of-primary-dark: #0A6E70; --of-primary-soft: #DCEDED;
    --of-bg: #FBF9F4; --of-surface: #FFFFFF;
    --of-text: #1D3557; --of-text-muted: #6B7B8C; --of-border: #E5E1D8;
    --of-neon-pink: #FFB627; --of-neon-pink-dark: #E69E13;
    --of-neon-lime: #5DA873; --of-neon-yellow: #FFB627;
    --of-neon-purple: #6A7BA5; --of-neon-cyan: #4EAEAF;
    --of-success: #5DA873; --of-danger: #E63946;
    --of-shadow-soft: 0 1px 3px rgba(29,53,87,0.08);
    --of-shadow-chunky: 0 4px 0 rgba(29,53,87,0.15);
}
*/

/* ---- Option C: Sunset Community ----
:root {
    --of-primary: #E07856; --of-primary-dark: #B85F40; --of-primary-soft: #F8E6DD;
    --of-bg: #FFF8F0; --of-surface: #FFFFFF;
    --of-text: #3A3536; --of-text-muted: #A89888; --of-border: #EDDFD0;
    --of-neon-pink: #5B3758; --of-neon-pink-dark: #432840;
    --of-neon-lime: #94B49F; --of-neon-yellow: #F4C95D;
    --of-neon-purple: #7E5B7C; --of-neon-cyan: #A4C8C9;
    --of-success: #5B8A6E; --of-danger: #C44536;
    --of-shadow-soft: 0 1px 3px rgba(58,53,54,0.08);
    --of-shadow-chunky: 0 4px 0 rgba(58,53,54,0.15);
}
*/

/* ============================================================
   Dark mode — applied via data-bs-theme="dark" on <html>.
   The theme switcher (Light / Dark / System) resolves the choice in JS;
   Bootstrap 5.3 components adapt to data-bs-theme natively, and these
   overrides retune the custom OhFace tokens for dark surfaces.
   ============================================================ */
[data-bs-theme="dark"] {
    --of-primary:        #2CBEC0;
    --of-primary-dark:   #6FE3E4;
    --of-primary-soft:   #123534;
    --of-bg:             #0F1317;
    --of-surface:        #171C22;
    --of-text:           #E7ECF2;
    --of-text-muted:     #9CA8B4;
    --of-border:         #2A313A;
    --of-shadow-soft:    0 1px 3px rgba(0, 0, 0, 0.5);
    --of-shadow-chunky:  0 4px 0 rgba(0, 0, 0, 0.55);
}
[data-bs-theme="dark"] .navbar-toggler-icon { filter: invert(1) brightness(1.6); }
[data-bs-theme="dark"] .navbar-toggler { border-color: var(--of-border); }

/* ============================================================
   Palette: Neon — set via data-of-palette="neon" on <html>.
   Only retunes the ACCENT tokens, so it layers on top of either
   light or dark (which own bg/surface/text). Placed after the dark
   block so accents win in both themes.
   ============================================================ */
[data-of-palette="neon"] {
    --of-primary:        #B026FF;   /* electric purple */
    --of-primary-dark:   #8A1FCC;
    --of-primary-soft:   rgba(176, 38, 255, 0.16);
    --of-neon-pink:      #FF10A0;
    --of-neon-pink-dark: #E00080;
    --of-neon-lime:      #39FF14;
    --of-neon-yellow:    #FFE500;
    --of-neon-purple:    #B026FF;
    --of-neon-cyan:      #00E5FF;
}
[data-of-palette="neon"][data-bs-theme="dark"] {
    --of-primary:        #C24DFF;   /* lift purple for dark surfaces */
    --of-primary-dark:   #E0A6FF;
}

/* Demo bar — fixed sunshine background with legible text in both themes */
.of-demo-bar { background: var(--of-neon-yellow); color: #14181c; }
.of-demo-bar a { color: #0A6E70; text-decoration: underline; }

/* ============================================================
   Base
   ============================================================ */
body {
    background-color: var(--of-bg);
    color: var(--of-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

/* Headlines get a touch more weight for that chunky 90s feel */
h1, h2, h3, .h1, .h2, .h3, .display-4, .display-5, .display-6 {
    font-weight: 700;
    color: var(--of-text);
    letter-spacing: -0.01em;
}

/* ============================================================
   Navbar
   ============================================================ */
.navbar {
    background-color: var(--of-surface) !important;
    border-bottom: 1px solid var(--of-border);
}
.navbar-brand {
    color: var(--of-primary) !important;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.navbar .nav-link { color: var(--of-text); }
.navbar .nav-link:hover { color: var(--of-primary); }

/* ============================================================
   Buttons — chunky soft-shadow 90s feel
   ============================================================ */
.btn-ohface-primary {
    background-color: var(--of-neon-pink);
    border: 2px solid var(--of-neon-pink);
    color: #fff !important;
    font-weight: 700;
    border-radius: 0.5rem;
    box-shadow: var(--of-shadow-chunky);
    transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}
.btn-ohface-primary:hover {
    background-color: var(--of-neon-pink-dark);
    border-color: var(--of-neon-pink-dark);
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 0 rgba(29, 53, 87, 0.18);
}
.btn-ohface-primary:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 rgba(29, 53, 87, 0.18);
}

.btn-ohface-trust {
    background-color: transparent;
    border: 2px solid var(--of-primary);
    color: var(--of-primary);
    font-weight: 700;
    border-radius: 0.5rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.btn-ohface-trust:hover {
    background-color: var(--of-primary);
    color: #fff;
}

/* Override Bootstrap warning so old code doesn't poison the look */
.btn-warning {
    background-color: var(--of-neon-pink);
    border-color: var(--of-neon-pink);
    color: #fff !important;
}
.btn-warning:hover {
    background-color: var(--of-neon-pink-dark);
    border-color: var(--of-neon-pink-dark);
    color: #fff !important;
}
.btn-outline-warning {
    border-color: var(--of-primary);
    color: var(--of-primary);
}
.btn-outline-warning:hover {
    background-color: var(--of-primary);
    border-color: var(--of-primary);
    color: #fff;
}
.text-warning { color: var(--of-primary-dark) !important; }

/* ============================================================
   Cards — soft shadow with optional polaroid variant
   ============================================================ */
.card-soft {
    border: 1px solid var(--of-border);
    border-radius: 0.75rem;
    box-shadow: var(--of-shadow-soft);
    background-color: var(--of-surface);
}

.card-polaroid {
    background: var(--of-surface);
    padding: 0.75rem 0.75rem 1.5rem 0.75rem;
    border-radius: 0.25rem;
    box-shadow: 0 6px 14px rgba(29, 53, 87, 0.10);
    transform: rotate(-0.6deg);
    transition: transform 0.2s ease;
}
.card-polaroid:hover { transform: rotate(0deg) translateY(-2px); }

/* ============================================================
   Highlighter stroke — sunshine yellow swept behind a word.
   Use: <span class="hi-stroke">good things</span>
   ============================================================ */
.hi-stroke {
    background: linear-gradient(180deg,
        transparent 0%,
        transparent 55%,
        var(--of-neon-yellow) 55%,
        var(--of-neon-yellow) 92%,
        transparent 92%);
    padding: 0 0.15em;
}

/* ============================================================
   Brand pill — replaces .brand-tag
   ============================================================ */
.brand-tag {
    background: var(--of-neon-pink);
    color: #fff;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: 0 2px 0 rgba(29, 53, 87, 0.18);
}

/* ============================================================
   Credit counter — neon lime with one-shot pulse on page load
   ============================================================ */
.credit-counter {
    color: var(--of-neon-lime);
    font-weight: 800;
    text-shadow:
        0 0 0 transparent,
        2px 2px 0 rgba(15, 139, 141, 0.20);
    animation: of-credit-pop 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s 1;
    transform-origin: left center;
}
@keyframes of-credit-pop {
    0%   { transform: scale(0.6);  opacity: 0;   filter: brightness(1.4); }
    60%  { transform: scale(1.08); opacity: 1;   filter: brightness(1.4); }
    100% { transform: scale(1.0);  opacity: 1;   filter: brightness(1.0); }
}

/* ============================================================
   Hypercolor reaction button — flash pink → cyan → settle
   on .reacted state toggle (set by JS on click).
   ============================================================ */
.reaction-btn {
    background: var(--of-surface);
    border: 2px solid var(--of-border);
    color: var(--of-text-muted);
    border-radius: 999px;
    padding: 0.5rem 1.1rem;
    font-weight: 600;
    font-size: 1.05rem;
    cursor: pointer;
    transition: transform 0.12s ease, border-color 0.15s, color 0.15s, background-color 0.15s;
    user-select: none;
}
.reaction-btn:hover {
    border-color: var(--of-neon-cyan);
    color: var(--of-primary);
    transform: translateY(-1px);
}
.reaction-btn .heart { display: inline-block; transition: transform 0.2s ease; }

.reaction-btn.reacted {
    background: var(--of-neon-pink);
    border-color: var(--of-neon-pink);
    color: #fff;
    animation: of-hypercolor-flash 0.7s ease-out 1;
}
.reaction-btn.reacted .heart {
    transform: scale(1.25);
}

@keyframes of-hypercolor-flash {
    0%   { background: var(--of-neon-cyan);   color: var(--of-text);  }
    35%  { background: var(--of-neon-yellow); color: var(--of-text);  }
    70%  { background: var(--of-neon-pink);   color: #fff;            }
    100% { background: var(--of-neon-pink);   color: #fff;            }
}

/* Floating "+1" that drifts up and fades on reaction */
.float-plus-one {
    position: absolute;
    color: var(--of-neon-lime);
    font-weight: 800;
    font-size: 1.1rem;
    pointer-events: none;
    animation: of-float-up 0.9s ease-out forwards;
    text-shadow: 0 1px 0 rgba(29, 53, 87, 0.25);
}
@keyframes of-float-up {
    0%   { transform: translate(0, 0)     scale(0.7); opacity: 0; }
    20%  { transform: translate(0, -6px)  scale(1.1); opacity: 1; }
    100% { transform: translate(0, -42px) scale(1.0); opacity: 0; }
}

/* ============================================================
   Memphis Group flourish — squiggle divider
   Use: <hr class="hr-squiggle">
   ============================================================ */
.hr-squiggle {
    border: 0;
    height: 14px;
    background-image:
        radial-gradient(circle at 10px 4px, var(--of-neon-pink) 3px, transparent 4px),
        radial-gradient(circle at 30px 10px, var(--of-neon-cyan) 3px, transparent 4px),
        radial-gradient(circle at 50px 4px, var(--of-neon-yellow) 3px, transparent 4px),
        radial-gradient(circle at 70px 10px, var(--of-neon-purple) 3px, transparent 4px),
        radial-gradient(circle at 90px 4px, var(--of-neon-lime) 3px, transparent 4px);
    background-size: 100px 14px;
    background-repeat: repeat-x;
    opacity: 0.85;
    margin: 1.5rem 0;
}

/* ============================================================
   Form polish — trust foundation, focus rings in primary
   ============================================================ */
.form-control {
    border-color: var(--of-border);
    border-radius: 0.5rem;
}
.form-control:focus {
    border-color: var(--of-primary);
    box-shadow: 0 0 0 0.2rem rgba(15, 139, 141, 0.18);
}

/* ============================================================
   Footer
   ============================================================ */
footer { color: var(--of-text-muted); }

/* ============================================================
   Threads-style feed — post card + interaction bar
   ============================================================ */
.of-feed { max-width: 620px; margin: 0 auto; }

.of-post {
    display: flex;
    gap: 0.85rem;
    padding: 1.1rem 0.25rem 0.6rem;
    border-bottom: 1px solid var(--of-border);
}
.of-post:first-child { padding-top: 0.25rem; }

.of-post-avatar {
    flex: 0 0 auto;
    width: 44px; height: 44px;
    border-radius: 999px;
    background: var(--of-primary-soft);
    color: var(--of-primary-dark);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 1.15rem;
    user-select: none;
}
.of-post-main { flex: 1 1 auto; min-width: 0; }

.of-post-head {
    display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.35rem;
    line-height: 1.2;
}
.of-post-name { font-weight: 700; color: var(--of-text); }
.of-post-handle,
.of-post-time,
.of-post-dot { color: var(--of-text-muted); font-size: 0.95rem; }

.of-post-body {
    margin: 0.35rem 0 0.6rem;
    color: var(--of-text);
    line-height: 1.5;
    overflow-wrap: anywhere;
}
.of-post-body p { margin: 0 0 0.5rem; }
.of-post-body p:last-child { margin-bottom: 0; }
.of-post-body ul, .of-post-body ol { margin: 0.25rem 0 0.5rem 1.25rem; }
.of-post-body blockquote {
    margin: 0.35rem 0; padding: 0.15rem 0 0.15rem 0.85rem;
    border-left: 3px solid var(--of-primary-soft); color: var(--of-text-muted);
}
.of-post-body a { color: var(--of-primary); text-decoration: underline; text-decoration-color: var(--of-neon-cyan); }
.of-post-body a:hover { color: var(--of-primary-dark); }

.of-post-media {
    margin: 0.4rem 0 0.2rem;
    border-radius: 0.85rem;
    overflow: hidden;
    border: 1px solid var(--of-border);
    background: #000;
}
.of-post-media img,
.of-post-media video { display: block; width: 100%; height: auto; max-height: 560px; object-fit: cover; }

/* Interaction bar */
.of-actionbar {
    display: flex; align-items: center; gap: 0.35rem;
    margin-top: 0.5rem;
}
.of-action {
    display: inline-flex; align-items: center; gap: 0.3rem;
    background: transparent; border: 0;
    color: var(--of-text-muted);
    border-radius: 999px;
    padding: 0.4rem 0.6rem;
    font-weight: 600; font-size: 0.92rem;
    cursor: pointer;
    transition: background-color 0.12s ease, color 0.12s ease, transform 0.12s ease;
}
.of-action:hover { background: var(--of-primary-soft); color: var(--of-primary-dark); }
.of-action:active { transform: scale(0.94); }
.of-action-count { min-width: 1ch; }
.of-action.is-on.of-action-thumb  { color: var(--of-primary); }
.of-action.is-on.of-action-heart  { color: var(--of-neon-pink); }
.of-action.is-on.of-action-repost { color: var(--of-neon-lime); }
.of-action.is-on svg { transform: scale(1.12); }
.of-action-heart:hover  { color: var(--of-neon-pink); }
.of-action-repost:hover { color: var(--of-neon-lime); }
.of-action.is-on.of-action-save { color: var(--of-primary); }
.of-action-report:hover { color: var(--of-danger); background: rgba(230,57,70,0.08); }

/* Follow button in the post header */
.of-follow {
    margin-left: auto;
    background: transparent;
    border: 1.5px solid var(--of-primary);
    color: var(--of-primary);
    border-radius: 999px;
    padding: 0.1rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.12s ease, color 0.12s ease;
}
.of-follow:hover,
.of-follow.following { background: var(--of-primary); color: #fff; }

/* Feed tabs (For you / Liked / Saved) */
.of-tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--of-border); margin-bottom: 0.75rem; }
.of-tab {
    padding: 0.5rem 0.9rem; font-weight: 600; color: var(--of-text-muted);
    text-decoration: none; border-bottom: 2px solid transparent;
}
.of-tab:hover { color: var(--of-primary); }
.of-tab.active { color: var(--of-text); border-bottom-color: var(--of-primary); }

/* Online presence widget */
.of-online { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.of-online .dot { width: 9px; height: 9px; border-radius: 999px; display: inline-block; margin-right: 0.4rem; }
.of-online .dot-online { background: var(--of-neon-lime); box-shadow: 0 0 0 3px rgba(93,224,101,0.25); }
.of-online .dot-lurk { background: var(--of-text-muted); }

/* "New posts" banner — hidden until the live poll finds fresh posts */
.of-newposts {
    display: none; position: sticky; top: 8px; z-index: 20;
    margin: 0 auto 0.75rem; width: max-content; max-width: 92%;
    background: var(--of-neon-pink); color: #fff; font-weight: 700;
    padding: 0.4rem 1.1rem; border-radius: 999px;
    box-shadow: var(--of-shadow-chunky); cursor: pointer; text-align: center;
}
.of-newposts.show { display: block; animation: of-credit-pop 0.4s ease 1; }
.of-newposts:hover { background: var(--of-neon-pink-dark); }

/* People list (followers / following) */
.of-person { display: flex; align-items: center; gap: 0.7rem; padding: 0.5rem 0; border-top: 1px solid var(--of-border); }
.of-person:first-child { border-top: 0; }
.of-person .of-reply-avatar { width: 38px; height: 38px; font-size: 0.95rem; }

/* Avatars — image or initial share the same bubble */
img.of-post-avatar, img.of-reply-avatar { object-fit: cover; }
.of-avatar-lg { width: 52px !important; height: 52px !important; font-size: 1.3rem !important; }
.of-avatar-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.of-avatar-choice {
    width: 48px; height: 48px; border-radius: 999px; cursor: pointer;
    border: 3px solid transparent; object-fit: cover; background: var(--of-surface);
}
.of-avatar-choice:hover { border-color: var(--of-neon-cyan); }
.of-avatar-choice.selected { border-color: var(--of-primary); }

/* Guest landing hero — the value prop */
.of-hero { max-width: 860px; margin: 0 auto 1rem; text-align: center; padding: 1.5rem 0.5rem 0; }
.of-hero .lead { color: var(--of-text); line-height: 1.55; }
.of-hero-pillars .h6 { color: var(--of-primary); }

/* Comment thread (revealed by the reply button) */
.of-thread { display: none; margin-top: 0.6rem; padding-top: 0.6rem; border-top: 1px dashed var(--of-border); }
.of-thread.open { display: block; }
.of-reply { display: flex; gap: 0.6rem; padding: 0.5rem 0; }
.of-reply + .of-reply { border-top: 1px solid var(--of-border); }
.of-reply-avatar {
    flex: 0 0 auto; width: 32px; height: 32px; border-radius: 999px;
    background: var(--of-primary-soft); color: var(--of-primary-dark);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 0.82rem;
}
.of-reply-main { flex: 1 1 auto; min-width: 0; }
.of-reply-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.3rem; line-height: 1.2; }
.of-reply-name { font-weight: 700; font-size: 0.92rem; }
.of-reply-handle, .of-reply-time { color: var(--of-text-muted); font-size: 0.85rem; }
.of-reply-body { font-size: 0.95rem; line-height: 1.45; overflow-wrap: anywhere; }
.of-reply-compose { margin-top: 0.5rem; }

@media (max-width: 480px) {
    .of-action span.of-action-count { font-size: 0.88rem; }
    .of-action { padding: 0.4rem 0.5rem; }
    .of-post-avatar { width: 40px; height: 40px; font-size: 1.05rem; }
}

/* ============================================================
   Reduced motion respect
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .credit-counter,
    .reaction-btn.reacted,
    .float-plus-one,
    .card-polaroid {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
}

/* Beta banner */
.of-beta-bar { background: color-mix(in srgb, var(--of-primary) 12%, transparent); color: var(--of-text); }
.of-beta-bar a { color: var(--of-primary); text-decoration: underline; }
.of-beta-bar .btn-link { color: var(--of-text-muted); }
