/* =====================================================================
   Philosophy Encyclopedia — front-end theme
   Light academia: warm off-white paper, gold accents, serif display.
   ===================================================================== */

:root {
    --bg:        #ffffff;   /* page — white */
    --bg-2:      #f1f2f4;   /* inputs, bands */
    --panel:     #ffffff;   /* cards */
    --panel-2:   #f6f7f8;   /* subtle raised */
    --line:      rgba(0,0,0,.13);
    --line-2:    rgba(0,0,0,.20);
    --ink:       #111111;   /* headings / body — near black */
    --ink-soft:  #3f434a;   /* secondary text */
    --ink-mute:  #767a82;   /* muted text */
    --gold:      #111111;   /* accent / links — black */
    --gold-2:    #333333;   /* hover / gradients */
    --gold-btn:  #111111;   /* button fills — black */
    --violet:    #444444;
    --cyan:      #444444;
    --radius:    14px;
    --radius-lg: 22px;
    --wrap:      1120px;
    --serif: "Fraunces", ui-serif, Georgia, "Times New Roman", serif;
    --sans:  "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --shadow: 0 16px 44px -22px rgba(20,30,60,.22);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--sans);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.65;
    overflow-x: hidden;                 /* safety net against any horizontal overflow */
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Soft, warm paper wash behind everything */
body::before {
    content: "";
    position: fixed; inset: 0;
    background: none;
    pointer-events: none;
    z-index: 0;
}

.wrap { width: min(var(--wrap), 92vw); margin-inline: auto; position: relative; z-index: 1; }

/* Discourage copying the article text (soft deterrent). Fields stay editable. */
body { -webkit-user-select: none; -moz-user-select: none; user-select: none; }
input, textarea, select, button, [contenteditable="true"] { -webkit-user-select: text; -moz-user-select: text; user-select: text; }
img { -webkit-user-drag: none; user-drag: none; }

a { color: var(--gold); text-decoration: none; transition: color .18s; }
a:hover { color: var(--gold-2); }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.12; letter-spacing: -.01em; margin: 0 0 .5em; }

.eyebrow {
    text-transform: uppercase; letter-spacing: .22em; font-size: .74rem;
    color: var(--gold); font-weight: 600; margin: 0 0 1rem;
}
.sr-only, .skip-link {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
}
.skip-link:focus {
    position: fixed; top: 12px; left: 12px; width: auto; height: auto; clip: auto;
    background: var(--gold); color: #fff; padding: .6rem 1rem; border-radius: 8px; z-index: 100;
}

/* ------------------------------------------------------------ buttons */
.btn {
    display: inline-flex; align-items: center; gap: .5rem; justify-content: center;
    font-family: var(--sans); font-weight: 600; font-size: .95rem;
    padding: .8rem 1.5rem; border-radius: 999px; cursor: pointer;
    border: 1px solid transparent; transition: transform .15s, background .2s, border-color .2s, box-shadow .2s;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
    background: linear-gradient(135deg, var(--gold-btn), var(--gold-2));
    color: #fff; box-shadow: 0 10px 26px -12px rgba(0,0,0,.35);
}
.btn-primary:hover { color: #fff; }
.btn-ghost { border-color: var(--line-2); color: var(--ink); background: transparent; }
.btn-ghost:hover { color: var(--ink); border-color: var(--gold); background: var(--panel-2); }
.btn-block { width: 100%; }

/* ------------------------------------------------------------ header */
.site-header {
    position: sticky; top: 0; z-index: 40;
    backdrop-filter: blur(14px);
    background: rgba(255,255,255,.82);
    border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 0; }
.brand { display: flex; align-items: center; gap: .75rem; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark { color: var(--gold); display: grid; place-items: center; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 1.16rem; letter-spacing: -.01em; }
.brand-tag { font-size: .72rem; color: var(--ink-mute); letter-spacing: .04em; }

.main-nav { display: flex; align-items: center; gap: .35rem; }
.main-nav a {
    color: var(--ink-soft); font-weight: 500; font-size: .93rem;
    padding: .5rem .8rem; border-radius: 8px; transition: color .18s, background .18s;
}
.main-nav a:hover { color: var(--ink); background: rgba(24,32,52,.05); }
.main-nav a.active { color: var(--gold); }
.main-nav .nav-cta {
    color: #fff; background: linear-gradient(135deg, var(--gold-btn), var(--gold-2));
    font-weight: 600; margin-left: .4rem;
}
.main-nav .nav-cta:hover { color: #fff; filter: brightness(1.03); }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: .4rem; }
.nav-toggle span { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; transition: .25s; }

/* ------------------------------------------------------------ hero */
.hero { position: relative; overflow: hidden; padding: clamp(4rem, 10vw, 8rem) 0 clamp(3rem, 7vw, 6rem); }
.hero::after {
    content: ""; position: absolute; inset: 0; z-index: 0;
    background:
        radial-gradient(60% 55% at 50% 0%, rgba(0,0,0,.05), transparent 70%),
        radial-gradient(50% 60% at 15% 80%, rgba(0,0,0,.03), transparent 70%);
    pointer-events: none;
}
.hero-inner { text-align: center; max-width: 820px; margin-inline: auto; }
.hero-title {
    font-size: clamp(2.6rem, 7vw, 5rem); font-weight: 600; margin: 0 0 1.4rem;
    background: linear-gradient(180deg, var(--ink) 30%, #3f465c);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-lede { font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: var(--ink-soft); max-width: 660px; margin: 0 auto 2rem; }
.hero-lede em { color: var(--gold); font-style: italic; }
.hero-actions { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 2.5rem; justify-content: center; margin: 3rem 0 0; padding: 0; }
.hero-stats div { text-align: center; }
.hero-stats dt { font-family: var(--serif); font-size: 2.2rem; font-weight: 600; color: var(--gold); }
.hero-stats dd { margin: 0; font-size: .82rem; color: var(--ink-mute); text-transform: uppercase; letter-spacing: .12em; }

/* ------------------------------------------------------- section head */
.section-head { text-align: center; max-width: 640px; margin: 0 auto clamp(2rem,5vw,3.5rem); }
.section-head h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.section-head p { color: var(--ink-soft); margin: 0 auto; }
.contents { padding: clamp(3rem, 7vw, 6rem) 0; }
.contents-tools { margin-top: 1.5rem; }
#toc-filter {
    width: min(420px, 100%); padding: .75rem 1.1rem; border-radius: 999px;
    background: var(--panel); border: 1px solid var(--line-2); color: var(--ink); font: inherit;
}
#toc-filter:focus { outline: none; border-color: var(--gold); }

/* table of contents grid */
.toc-grid {
    list-style: none; padding: 0; margin: 0; counter-reset: toc;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: .6rem;
}
.toc-item a {
    display: flex; align-items: center; gap: .9rem;
    padding: .85rem 1.1rem; border-radius: var(--radius);
    background: var(--panel); border: 1px solid var(--line);
    color: var(--ink); transition: border-color .18s, background .18s, transform .12s;
}
.toc-item a:hover { border-color: var(--gold); background: var(--panel-2); transform: translateX(3px); }
.toc-item a::before {
    counter-increment: toc; content: counter(toc, decimal-leading-zero);
    font-family: var(--serif); font-size: .85rem; color: var(--gold);
    min-width: 2.2ch; text-align: right; opacity: .8;
}
.toc-title { flex: 1; font-weight: 500; }
.toc-arrow { color: var(--ink-mute); transition: transform .18s, color .18s; }
.toc-item a:hover .toc-arrow { color: var(--gold); transform: translateX(3px); }

.empty-note { text-align: center; color: var(--ink-mute); padding: 3rem 0; }

/* ------------------------------------------------- page hero (inner pages) */
.page-hero { padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(1.5rem, 3vw, 2.5rem); text-align: center; position: relative; }
.page-hero::after {
    content: ""; position: absolute; inset: 0;
    background: radial-gradient(55% 70% at 50% 0%, rgba(0,0,0,.045), transparent 70%);
    pointer-events: none;
}
.page-hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
.page-hero-lede { color: var(--ink-soft); max-width: 620px; margin: .5rem auto 0; font-size: 1.08rem; }

/* ------------------------------------------------------------ blog list */
.blog-list { padding: 0 0 clamp(3rem,7vw,6rem); }
.post-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1.4rem; }
.post-card {
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg);
    padding: 1.6rem; display: flex; flex-direction: column; transition: transform .18s, border-color .18s;
}
.post-card:hover { transform: translateY(-4px); border-color: var(--line-2); box-shadow: var(--shadow); }
.post-card-meta { display: flex; align-items: center; gap: .8rem; margin-bottom: .9rem; font-size: .8rem; color: var(--ink-mute); }
.post-card h2 { font-size: 1.4rem; margin: 0 0 .6rem; }
.post-card h2 a { color: var(--ink); }
.post-card h2 a:hover { color: var(--gold); }
.post-card p { color: var(--ink-soft); font-size: .96rem; margin: 0 0 1.2rem; flex: 1; }
.read-more { font-weight: 600; font-size: .9rem; }
.pill {
    display: inline-block; padding: .18rem .7rem; border-radius: 999px; font-size: .72rem;
    font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
    background: rgba(0,0,0,.06); color: #333; border: 1px solid rgba(0,0,0,.16);
}

.pagination { display: flex; gap: .4rem; justify-content: center; margin-top: 2.5rem; }
.pagination a {
    min-width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px;
    background: var(--panel); border: 1px solid var(--line); color: var(--ink-soft); font-weight: 600;
}
.pagination a:hover { border-color: var(--gold); color: var(--ink); }
.pagination a.active { background: var(--gold); color: #fff; border-color: var(--gold); }

/* ------------------------------------------------------------ single post */
.single-hero { padding: clamp(2.5rem,6vw,4.5rem) 0 1.5rem; position: relative; }
.single-hero::after {
    content:""; position:absolute; inset:0;
    background: radial-gradient(50% 80% at 50% 0%, rgba(0,0,0,.04), transparent 70%); pointer-events:none;
}
.single-hero-inner { max-width: 760px; margin-inline: auto; text-align: center; }
.crumbs { font-size: .82rem; color: var(--ink-mute); margin-bottom: 1.2rem; }
.crumbs a { color: var(--ink-soft); }
.single-meta { display: flex; gap: .9rem; align-items: center; justify-content: center; font-size: .82rem; color: var(--ink-mute); margin-bottom: 1rem; }
.single-hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
.single-body { max-width: 760px; margin-inline: auto; padding-bottom: clamp(3rem,6vw,5rem); }

/* long-form reading */
.prose { font-size: 1.14rem; line-height: 1.85; color: var(--ink-soft); }
.prose > * + * { margin-top: 1.35em; }
.prose p { margin: 0; }
.prose h2 { font-size: 1.9rem; color: var(--ink); margin-top: 2.2em; }
.prose h3 { font-size: 1.45rem; color: var(--ink); margin-top: 1.8em; }
.prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(0,0,0,.35); }
.prose strong { color: var(--ink); }
.prose em { color: var(--gold-2); }
.prose blockquote {
    margin: 1.6em 0; padding: 1rem 1.6rem; border-left: 3px solid var(--gold);
    background: var(--panel); border-radius: 0 var(--radius) var(--radius) 0;
    font-family: var(--serif); font-size: 1.28rem; font-style: italic; color: var(--ink);
}
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin: .5em 0; }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius); margin: 1.5em 0; }
.prose figure { margin: 1.5em 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.prose code { background: var(--panel-2); padding: .15em .45em; border-radius: 6px; font-size: .9em; }

/* prev / next */
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3.5rem; }
.post-nav-link {
    display: flex; flex-direction: column; gap: .3rem; padding: 1.1rem 1.3rem;
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink);
    transition: border-color .18s, transform .15s;
}
.post-nav-link:hover { border-color: var(--gold); color: var(--ink); transform: translateY(-2px); }
.post-nav-link.next { text-align: right; }
.post-nav-link .dir { font-size: .78rem; color: var(--gold); text-transform: uppercase; letter-spacing: .1em; }
.post-nav-link .ttl { font-family: var(--serif); font-weight: 500; }

/* ------------------------------------------------------ subscribe band */
.subscribe-band { padding: clamp(3rem,6vw,5rem) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--bg-2), var(--bg)); }
.subscribe-inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.subscribe-inner h2 { font-size: clamp(1.6rem,3.5vw,2.4rem); margin-bottom: .5rem; }
.subscribe-inner p { color: var(--ink-soft); margin: 0; max-width: 460px; }
.subscribe-form { display: flex; gap: .6rem; flex-wrap: wrap; }
.subscribe-form input {
    padding: .8rem 1.1rem; border-radius: 999px; min-width: 260px;
    background: var(--panel); border: 1px solid var(--line-2); color: var(--ink); font: inherit;
}
.subscribe-form input:focus { outline: none; border-color: var(--gold); }

/* ------------------------------------------------------------ plans */
.plans { padding: clamp(1rem,3vw,2rem) 0 clamp(4rem,8vw,7rem); }
.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.6rem; max-width: 820px; margin-inline: auto; }
.plan-card {
    position: relative; background: var(--panel); border: 1px solid var(--line);
    border-radius: var(--radius-lg); padding: 2.2rem; display: flex; flex-direction: column;
}
.plan-card.featured { border-color: var(--ink); box-shadow: 0 24px 60px -24px rgba(0,0,0,.2); background: linear-gradient(180deg, var(--panel-2), var(--panel)); }
.plan-badge {
    position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #fff;
    font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
    padding: .3rem .9rem; border-radius: 999px;
}
.plan-name { font-size: 1.4rem; margin-bottom: .6rem; }
.plan-price { font-family: var(--serif); font-size: 2.6rem; font-weight: 600; color: var(--gold); margin-bottom: 1.4rem; }
.plan-price span { font-size: 1rem; color: var(--ink-mute); font-family: var(--sans); }
.plan-features { list-style: none; padding: 0; margin: 0 0 1.8rem; flex: 1; }
.plan-features li { padding: .55rem 0 .55rem 1.8rem; position: relative; color: var(--ink-soft); border-top: 1px solid var(--line); }
.plan-features li:first-child { border-top: 0; }
.plan-features li::before { content: "✦"; position: absolute; left: 0; color: var(--gold); }

/* ------------------------------------------------------------ auth */
.auth-page { padding: clamp(3rem,8vw,6rem) 0; }
.auth-inner { display: grid; place-items: center; }
.auth-card {
    width: min(440px, 100%); background: var(--panel); border: 1px solid var(--line);
    border-radius: var(--radius-lg); padding: 2.4rem; box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 2rem; margin-bottom: .3rem; }
.auth-sub { color: var(--ink-mute); margin: 0 0 1.6rem; }
.auth-alt { margin-top: 1.4rem; text-align: center; color: var(--ink-mute); font-size: .92rem; }
.stack-form { display: flex; flex-direction: column; gap: 1rem; }
.stack-form label { display: flex; flex-direction: column; gap: .4rem; font-size: .88rem; color: var(--ink-soft); font-weight: 500; }
.stack-form input, .stack-form textarea, .stack-form select {
    padding: .8rem 1rem; border-radius: 10px; background: var(--bg-2);
    border: 1px solid var(--line-2); color: var(--ink); font: inherit;
}
.stack-form input:focus, .stack-form textarea:focus { outline: none; border-color: var(--gold); }

.alert { padding: .85rem 1.1rem; border-radius: 10px; margin-bottom: 1.2rem; font-size: .92rem; border: 1px solid transparent; }
.alert.error   { background: rgba(214,69,69,.10); border-color: rgba(214,69,69,.32); color: #b42318; }
.alert.success { background: rgba(46,160,94,.10); border-color: rgba(46,160,94,.32); color: #157a45; }
.alert.info    { background: rgba(31,151,168,.10); border-color: rgba(31,151,168,.30); color: #0b6b7a; }
.alert a { color: inherit; text-decoration: underline; }

/* ------------------------------------------------------------ videos */
.video-gallery { padding: clamp(1rem,3vw,2rem) 0 clamp(4rem,8vw,7rem); }
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px,1fr)); gap: 1.4rem; }
.video-card { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.video-embed { position: relative; aspect-ratio: 16/9; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-card figcaption { padding: 1rem 1.2rem; font-family: var(--serif); font-weight: 500; }

/* ------------------------------------------------------------ 404 */
.error-page { text-align: center; padding: clamp(5rem,12vw,9rem) 0; }
.error-page .eyebrow { font-size: 1rem; }
.error-page h1 { font-size: clamp(2rem,5vw,3rem); }
.error-page p { color: var(--ink-soft); margin-bottom: 2rem; }

/* ------------------------------------------------------------ footer */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); padding: clamp(3rem,5vw,4rem) 0 2rem; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2.5rem; }
.footer-about p { color: var(--ink-mute); font-size: .95rem; margin: 1rem 0 0; max-width: 42ch; }
.footer-links, .footer-contact { display: flex; flex-direction: column; gap: .5rem; }
.footer-links h4, .footer-contact h4 { font-family: var(--sans); font-size: .78rem; text-transform: uppercase; letter-spacing: .14em; color: var(--ink-mute); margin: 0 0 .4rem; }
.footer-links a, .footer-contact a { color: var(--ink-soft); font-size: .95rem; }
.footer-links a:hover, .footer-contact a:hover { color: var(--gold); }
.footer-bottom { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); color: var(--ink-mute); font-size: .85rem; }
.footer-credit { margin-top: .6rem; text-align: center; font-size: .62rem; letter-spacing: .04em; color: var(--ink-mute); opacity: .6; }
.footer-credit a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.footer-credit a:hover { color: var(--ink); }

/* ------------------------------------------------------ live stage */
.live-stage { padding: clamp(1.5rem, 4vw, 2.5rem) 0 0; }
.live-layout { display: flex; gap: 1rem; align-items: stretch; max-width: 1180px; margin-inline: auto; }
.live-layout .live-player { flex: 1 1 auto; max-width: none; margin: 0; min-width: 0; }
.live-player { position: relative; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line-2); background: #05070d; box-shadow: var(--shadow); max-width: 960px; margin-inline: auto; display: flex; flex-direction: column; }
.live-player .live-screen { flex: 1; }

/* live chat (YouTube-style, right of the video) */
.live-chat { flex: 0 0 330px; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.chat-head { padding: .8rem 1rem; font-family: var(--serif); font-weight: 600; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: .5rem; }
.chat-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #e23b3b; animation: livepulse 1.4s infinite; }
.chat-messages { flex: 1; overflow-y: auto; padding: .8rem 1rem; display: flex; flex-direction: column; gap: .55rem; min-height: 220px; }
.chat-msg { font-size: .9rem; line-height: 1.45; color: var(--ink-soft); word-break: break-word; }
.chat-user { font-weight: 600; color: var(--gold); margin-right: .35rem; }
.chat-body { color: var(--ink); }
.chat-empty { color: var(--ink-mute); font-size: .88rem; text-align: center; margin: auto 0; }
.chat-compose { display: flex; gap: .5rem; padding: .7rem; border-top: 1px solid var(--line); }
.chat-input { flex: 1; min-width: 0; padding: .6rem .8rem; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line-2); color: var(--ink); font: inherit; font-size: .9rem; }
.chat-input:focus { outline: none; border-color: var(--gold); }
.chat-send { flex: none; width: 40px; border: 0; border-radius: 50%; background: linear-gradient(135deg, var(--gold-btn), var(--gold-2)); color: #fff; cursor: pointer; font-size: 1rem; }
.chat-send:disabled { opacity: .5; cursor: default; }
.chat-error { color: #c0392b; font-size: .82rem; margin: 0; padding: 0 .8rem .7rem; }
.chat-locked { padding: 1rem; border-top: 1px solid var(--line); text-align: center; }
.chat-locked p { margin: 0 0 .7rem; color: var(--ink-mute); font-size: .88rem; }
.live-topbar { display: flex; align-items: center; gap: .8rem; padding: .7rem 1rem; background: rgba(5,7,13,.9); border-bottom: 1px solid var(--line); }
.live-badge { display: inline-flex; align-items: center; gap: .4rem; background: #e23b3b; color: #fff; font-size: .72rem; font-weight: 700; letter-spacing: .08em; padding: .22rem .6rem; border-radius: 6px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: livepulse 1.4s infinite; }
@keyframes livepulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
.live-title { flex: 1; min-width: 0; font-family: var(--serif); font-weight: 500; font-size: .98rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-viewers { flex: none; }
.live-viewers { font-size: .8rem; color: var(--ink-mute); white-space: nowrap; }
.live-viewers .eye { color: #e23b3b; }

.live-screen { position: relative; aspect-ratio: 16/9; background: #05070d; }
.live-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
.live-timecode { position: absolute; left: 12px; bottom: 12px; z-index: 3; font-family: ui-monospace, Menlo, monospace; font-size: .78rem; color: #fff; background: rgba(0,0,0,.55); padding: .2rem .5rem; border-radius: 5px; }
.live-player.is-locked .live-screen > *:not(.paywall) { filter: blur(14px) brightness(.5); }

/* animated placeholder "stream" */
.live-placeholder { position: absolute; inset: 0; overflow: hidden; }
.lp-nebula { position: absolute; inset: -20%; background:
    radial-gradient(40% 40% at 30% 40%, rgba(139,123,240,.55), transparent 60%),
    radial-gradient(35% 35% at 70% 55%, rgba(100,201,214,.45), transparent 60%),
    radial-gradient(45% 45% at 55% 75%, rgba(231,182,100,.35), transparent 60%),
    #05070d;
    filter: blur(20px); animation: nebula 14s ease-in-out infinite alternate; }
@keyframes nebula { 0% { transform: translate(-4%, -3%) scale(1.05); } 100% { transform: translate(5%, 4%) scale(1.15); } }
.lp-scan { position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(255,255,255,.03) 0 1px, transparent 1px 3px); mix-blend-mode: overlay; animation: scan 6s linear infinite; }
@keyframes scan { 0% { background-position-y: 0; } 100% { background-position-y: 60px; } }
.lp-eq { position: absolute; left: 50%; bottom: 22%; transform: translateX(-50%); display: flex; gap: 5px; align-items: flex-end; height: 60px; }
.lp-eq span { width: 6px; background: linear-gradient(180deg, var(--gold-2), var(--violet)); border-radius: 3px; animation: eq 1s ease-in-out infinite; }
.lp-eq span:nth-child(odd) { animation-duration: .8s; }
.lp-eq span:nth-child(3n) { animation-duration: 1.3s; }
.lp-eq span:nth-child(1){height:20%}.lp-eq span:nth-child(2){height:60%}.lp-eq span:nth-child(3){height:35%}.lp-eq span:nth-child(4){height:80%}.lp-eq span:nth-child(5){height:45%}.lp-eq span:nth-child(6){height:70%}.lp-eq span:nth-child(7){height:30%}.lp-eq span:nth-child(8){height:90%}.lp-eq span:nth-child(9){height:50%}.lp-eq span:nth-child(10){height:65%}.lp-eq span:nth-child(11){height:25%}.lp-eq span:nth-child(12){height:55%}
@keyframes eq { 0%,100% { transform: scaleY(.4); } 50% { transform: scaleY(1); } }
.lp-caption { position: absolute; left: 50%; top: 46%; transform: translate(-50%,-50%); text-align: center; color: rgba(255,255,255,.85); font-size: .9rem; }
.lp-caption code { background: rgba(0,0,0,.4); padding: .1em .4em; border-radius: 5px; font-size: .85em; }

/* paywall overlay */
.paywall { position: relative; z-index: 5; display: grid; place-items: center; padding: 1.6rem 1rem; background: rgba(5,7,13,.72); backdrop-filter: blur(4px); }
.paywall[hidden] { display: none; } /* the [hidden] attribute must win over the rule above */
/* When the paywall is up, let the player grow to the card's height so it is
   never clipped on narrow screens (the 16:9 box is too short on phones). */
.live-player.is-locked .live-screen { aspect-ratio: auto; min-height: 260px; }
.paywall-card { width: min(420px, 100%); background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line-2); border-radius: var(--radius-lg); padding: 2rem; text-align: center; box-shadow: var(--shadow); }
.paywall-card h2 { font-size: 2rem; margin: 0 0 .4rem; }
.paywall-card h2 span { font-size: 1rem; color: var(--ink-mute); font-family: var(--sans); }
.paywall-sub { color: var(--ink-soft); margin: 0 0 1.4rem; font-size: .95rem; }
.paywall-form { display: flex; flex-direction: column; gap: .8rem; }
.paywall-form input { padding: .85rem 1rem; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line-2); color: var(--ink); font: inherit; text-align: center; }
.paywall-form input:focus { outline: none; border-color: var(--gold); }
.apple-pay-btn { display: flex; align-items: center; justify-content: center; gap: .3rem; background: #000; color: #fff; height: 48px; border-radius: 10px; font-weight: 600; font-size: 1.05rem; cursor: pointer; border: 1px solid #000; transition: transform .12s, opacity .2s; user-select: none; }
.apple-pay-btn:hover { transform: translateY(-1px); }
.apple-pay-btn .ap-logo { width: 20px; height: 24px; -webkit-mask: no-repeat center/contain; mask: no-repeat center/contain; background: #fff;
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="black" d="M16.3 12.9c0-2 1.6-2.9 1.7-3-1-1.4-2.4-1.6-2.9-1.6-1.2-.1-2.4.7-3 .7s-1.6-.7-2.6-.7c-1.3 0-2.6.8-3.3 2-1.4 2.4-.4 6 1 8 .7 1 1.4 2.1 2.5 2 1-.1 1.3-.6 2.5-.6s1.5.6 2.6.6c1.1 0 1.7-1 2.4-2 .7-1.1 1-2.2 1-2.3-.1 0-2.4-.9-2.4-3.5zM14.4 6.9c.5-.7.9-1.6.8-2.6-.8 0-1.8.5-2.4 1.2-.5.6-1 1.6-.8 2.5.9.1 1.8-.4 2.4-1.1z"/></svg>');
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="black" d="M16.3 12.9c0-2 1.6-2.9 1.7-3-1-1.4-2.4-1.6-2.9-1.6-1.2-.1-2.4.7-3 .7s-1.6-.7-2.6-.7c-1.3 0-2.6.8-3.3 2-1.4 2.4-.4 6 1 8 .7 1 1.4 2.1 2.5 2 1-.1 1.3-.6 2.5-.6s1.5.6 2.6.6c1.1 0 1.7-1 2.4-2 .7-1.1 1-2.2 1-2.3-.1 0-2.4-.9-2.4-3.5zM14.4 6.9c.5-.7.9-1.6.8-2.6-.8 0-1.8.5-2.4 1.2-.5.6-1 1.6-.8 2.5.9.1 1.8-.4 2.4-1.1z"/></svg>'); }
.apple-pay-btn.busy { opacity: .6; pointer-events: none; }
.apple-pay-btn.disabled { background: #333; border-color: #333; color: #999; pointer-events: none; }
.apple-pay-btn.is-mock::after { content: " · test"; opacity: .6; font-size: .8rem; }
.paywall-note { font-size: .82rem; color: var(--ink-mute); margin: 0; min-height: 1em; }
.paywall-error { font-size: .85rem; color: #c0392b; margin: 0; }
.paywall-alt { margin: 1.2rem 0 0; font-size: .9rem; color: var(--ink-mute); }
/* site-wide free-time overlay (partials/time-gate.php) */
.time-gate { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 1.2rem; overflow-y: auto; background: rgba(5,7,13,.72); backdrop-filter: blur(4px); }
.time-gate[hidden] { display: none; }
.paywall-legal { margin: .8rem 0 0; font-size: .72rem; color: var(--ink-mute); line-height: 1.5; }
.paid-check { width: 56px; height: 56px; margin: 0 auto 1rem; border-radius: 50%; background: rgba(88,199,138,.16); color: #6fe0a0; display: grid; place-items: center; font-size: 1.8rem; }

/* ------------------------------------------------ subscribe widget */
.subscribe-widget { display: flex; flex-direction: column; gap: .8rem; text-align: left; }
.subscribe-widget .sw-email {
    padding: .85rem 1rem; border-radius: 10px; background: var(--bg-2);
    border: 1px solid var(--line-2); color: var(--ink); font: inherit; text-align: center;
}
.subscribe-widget .sw-email:focus { outline: none; border-color: var(--gold); }
.subscribe-widget .sw-pay { min-height: 44px; display: grid; gap: .5rem; }
.subscribe-widget .sw-note { font-size: .82rem; color: var(--ink-mute); margin: 0; min-height: 1em; text-align: center; }
.subscribe-widget .sw-error { font-size: .85rem; color: #c0392b; margin: 0; text-align: center; }
.subscribe-widget .sw-legal { margin: .4rem 0 0; font-size: .72rem; color: var(--ink-mute); line-height: 1.5; text-align: center; }
.subscribe-widget .sw-alt { margin: .6rem 0 0; font-size: .9rem; color: var(--ink-mute); text-align: center; }
.subscribe-widget .sw-success { text-align: center; }
.subscribe-widget .sw-success h3 { font-size: 1.5rem; margin: 0 0 .4rem; }
.paid-check { width: 56px; height: 56px; margin: 0 auto 1rem; border-radius: 50%; background: rgba(88,199,138,.16); color: #6fe0a0; display: grid; place-items: center; font-size: 1.8rem; }

/* subscribe / register page */
.subscribe-page { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: center; max-width: 940px; }
.subscribe-pitch .subscribe-price { font-family: var(--serif); font-size: 3rem; font-weight: 600; color: var(--gold); margin: .4rem 0 1rem; }
.subscribe-pitch .subscribe-price span { font-size: 1.1rem; color: var(--ink-mute); font-family: var(--sans); }
.subscribe-pitch h1 { font-size: clamp(2rem,4vw,2.8rem); }
.subscribe-lede { color: var(--ink-soft); margin: 0 0 1.4rem; }
.subscribe-card {
    background: linear-gradient(180deg, var(--panel-2), var(--panel));
    border: 1px solid var(--line-2); border-radius: var(--radius-lg); padding: 2rem; box-shadow: var(--shadow);
}
.subscribe-card h2 { font-size: 1.5rem; margin: 0 0 .3rem; }

.plans-grid.one { grid-template-columns: minmax(0, 420px); justify-content: center; }

/* ------------------------------------------------------ account page */
.account-page { padding: clamp(2.5rem,6vw,4.5rem) 0 clamp(4rem,8vw,6rem); min-height: 60vh; }
.account-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }
.account-head h1 { font-size: clamp(1.8rem,4vw,2.6rem); margin: 0; }
.account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; align-items: start; }
.account-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.8rem; }
.account-card h2 { font-size: 1.4rem; margin: 0 0 1.2rem; }
.sub-status { display: flex; align-items: center; gap: .6rem; font-size: 1.1rem; margin-bottom: 1.2rem; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; }
.status-dot.on { background: #6fe0a0; box-shadow: 0 0 10px #6fe0a0; }
.status-dot.off { background: var(--ink-mute); }
.sub-details { margin: 0 0 1.6rem; padding: 0; }
.sub-details div { display: flex; justify-content: space-between; padding: .6rem 0; border-top: 1px solid var(--line); }
.sub-details dt { color: var(--ink-mute); margin: 0; }
.sub-details dd { margin: 0; color: var(--ink); font-weight: 500; }
.danger-btn { border-color: rgba(214,69,69,.45); color: #c0392b; }
.danger-btn:hover { border-color: #d64545; color: #fff; background: #d64545; }
.muted-note { color: var(--ink-mute); font-size: .92rem; margin: 0 0 1.2rem; }
.form-sep { border: 0; border-top: 1px solid var(--line); margin: .4rem 0; }
.account-card .stack-form small { color: var(--ink-mute); font-weight: 400; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 820px) {
    .nav-toggle { display: flex; }
    .main-nav {
        position: fixed; inset: 62px 0 auto 0; flex-direction: column; align-items: stretch;
        background: rgba(255,255,255,.98); backdrop-filter: blur(14px);
        padding: 1rem 6vw 1.6rem; gap: .2rem; border-bottom: 1px solid var(--line);
        transform: translateY(-120%); transition: transform .3s; z-index: 39;
    }
    .main-nav.open { transform: translateY(0); }
    .main-nav a { padding: .8rem 1rem; }
    .main-nav .nav-cta { margin: .4rem 0 0; text-align: center; }
    .hero-stats { gap: 1.6rem; }
    .footer-grid { grid-template-columns: 1fr; gap: 1.6rem; }
    .post-nav { grid-template-columns: 1fr; }
    .subscribe-form input { min-width: 0; flex: 1; }
    .account-grid { grid-template-columns: 1fr; }
    .subscribe-page { grid-template-columns: 1fr; gap: 1.6rem; }
    .live-layout { flex-direction: column; }
    .live-chat { flex: none; width: 100%; height: 360px; }
}

/* phones — compact the live player, paywall and chat */
@media (max-width: 480px) {
    .live-stage { padding-top: 1rem; }
    .live-topbar { padding: .55rem .7rem; gap: .5rem; }
    .live-title { font-size: .86rem; }
    .live-viewers { font-size: .72rem; }
    .live-player.is-locked .live-screen { min-height: 0; }
    .paywall { padding: 1.1rem .8rem; }
    .paywall-card { padding: 1.4rem 1.1rem; }
    .paywall-card h2 { font-size: 1.6rem; }
    .paywall-sub { font-size: .88rem; margin-bottom: 1rem; }
    .subscribe-widget .sw-email { padding: .7rem .8rem; }
    .live-chat { height: 320px; }
    .chat-messages { min-height: 0; }
}

/* ------------------------------------------------------ video gallery */
.vgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.2rem; }
.vcard { cursor: pointer; outline: none; }
.vcard:focus-visible .vthumb { box-shadow: 0 0 0 3px var(--ink); }
.vthumb {
    position: relative; aspect-ratio: 16/9; border-radius: var(--radius);
    overflow: hidden; background: #000; border: 1px solid var(--line);
    transition: transform .16s, box-shadow .16s;
}
.vcard:hover .vthumb { transform: translateY(-3px); box-shadow: var(--shadow); }
.vthumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.vplay {
    position: absolute; inset: 0; display: grid; place-items: center;
    font-size: 1.6rem; color: #fff; background: rgba(0,0,0,.28);
    opacity: .92; transition: opacity .16s;
}
.vcard:hover .vplay { opacity: 1; }
.vlock-badge {
    position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.75); color: #fff;
    font-size: .66rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
    padding: .2rem .5rem; border-radius: 999px;
}
.vtitle { font-size: .95rem; margin: .6rem 0 0; font-family: var(--sans); font-weight: 500; color: var(--ink); line-height: 1.35; }
.vgate { text-align: center; margin-top: 2.5rem; padding-top: 1.8rem; border-top: 1px solid var(--line); }
.vgate p { color: var(--ink-soft); margin: 0 0 1rem; }

.vmodal { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.82); display: grid; place-items: center; padding: 1.2rem; }
.vmodal[hidden] { display: none; }
.vmodal-inner { width: min(960px, 100%); position: relative; }
.vmodal-inner video { width: 100%; border-radius: var(--radius); background: #000; display: block; }
.vmodal-title { color: #fff; margin: .7rem 0 0; font-family: var(--serif); }
.vmodal-close {
    position: absolute; top: -2.4rem; right: 0; background: none; border: 0;
    color: #fff; font-size: 2rem; line-height: 1; cursor: pointer;
}

/* ---------------------------------------------------------- text tool */
.tool { padding: 0 0 clamp(3rem,7vw,5rem); }
.tool-quota { text-align: center; }
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; align-items: start; }
.tool-pane { display: flex; flex-direction: column; }
.tool-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-mute); font-weight: 600; margin-bottom: .5rem; display: block; }
.tool-label-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.tool-input {
    width: 100%; min-height: 300px; padding: 1rem 1.1rem; border-radius: var(--radius);
    background: var(--panel); border: 1px solid var(--line-2); color: var(--ink);
    font: inherit; font-size: .98rem; line-height: 1.65; resize: vertical;
}
.tool-input:focus { outline: none; border-color: var(--ink); }
.tool-output { background: var(--panel-2); }
.tool-notes { min-height: 160px; margin-top: .4rem; }
.tool-meta { font-size: .8rem; color: var(--ink-mute); margin: .4rem 0 0; text-align: right; }
.tool-actions { display: flex; gap: .6rem; margin-top: .9rem; flex-wrap: wrap; }
.tool-error { color: #c0392b; font-size: .9rem; margin: .7rem 0 0; }
.tool-error a { color: inherit; text-decoration: underline; }
.btn-copy {
    background: var(--ink); color: #fff; border: 0; border-radius: 999px;
    padding: .35rem .9rem; font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer;
}
.btn-copy:hover { opacity: .85; }
.btn-copy.copied { background: #157a45; }

@media (max-width: 1100px) { .vgrid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 900px)  { .vgrid { grid-template-columns: repeat(3, 1fr); } .tool-grid { grid-template-columns: 1fr; } }
@media (max-width: 620px)  { .vgrid { grid-template-columns: repeat(2, 1fr); gap: .9rem; } .vtitle { font-size: .86rem; } }
