/**
 * Ceremony page
 * =============
 * Ads landing: no site header, no main padding-top, CTA first.
 * Essay lives below. Styles live here — not inline in the template.
 */

/* Kill global header offset (layout.css .main { padding-top: header-height }). */
.main:has(.cer-wrap) {
    padding-top: 0;
}

.cer-wrap {
    max-width: var(--content-max-width);
    margin: 0 auto;
    /* Tiny breath from the viewport edge so the plate is not flush-stuck. */
    padding: 5px 1rem 2rem;
}

/* ── Contribute panel (first screen); brand lives on the plate ── */
.cer-live {
    position: relative;
    background: linear-gradient(135deg, #120b22, #0d1a17);
    border: 1px solid #2b2246;
    border-radius: 14px;
    padding: 1.15rem 1.35rem 1.35rem;
    margin: 0 0 1.5rem;
    scroll-margin-top: 0;
}
/* Hat + name on the card itself — top-left, no separate header row. */
.cer-live .cer-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    color: var(--color-text-primary, #fff);
    font-weight: 600;
    font-size: 0.92rem;
    margin: 0 0 0.65rem;
    line-height: 1;
}
.cer-live .cer-brand img {
    width: 26px;
    height: 26px;
}
.cer-live .cer-brand:hover {
    color: var(--color-secondary, #14f195);
}
.cer-live h2 {
    margin: 0 0 0.45rem;
    text-align: center;
    font-size: 1.45rem;
    font-weight: 700;
}
.cer-live .lead {
    color: var(--color-text-secondary, #a3a3a3);
    max-width: 36rem;
    margin: 0 auto 0.65rem;
    text-align: center;
    line-height: 1.5;
    font-size: 1.02rem;
}
.cer-live .lead b {
    color: var(--color-text-primary, #fff);
}

.cer-count {
    text-align: center;
    margin: 0.35rem 0 0.75rem;
}
.cer-count .num {
    font-family: var(--font-family-mono, monospace);
    font-size: 2.35rem;
    font-weight: 700;
    background: linear-gradient(90deg, #9945ff, #14f195);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1;
}
.cer-count .lbl {
    color: var(--color-text-tertiary, #666);
    font-size: 0.85rem;
    margin-top: 0.2rem;
}

.cer-form {
    display: flex;
    justify-content: center;
    margin: 0 auto 0.45rem;
}
.cer-btn {
    background: linear-gradient(90deg, #9945ff 0%, #14f195 100%);
    color: #0a0a0a;
    border: none;
    border-radius: 12px;
    padding: 1rem 2.6rem;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.01em;
    cursor: pointer;
    width: min(100%, 20rem);
    box-shadow: 0 6px 22px rgba(153, 69, 255, 0.28);
    transition: filter 0.15s, opacity 0.15s, transform 0.15s, box-shadow 0.15s;
}
.cer-btn:hover:not(:disabled) {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(153, 69, 255, 0.34);
}
.cer-btn:active:not(:disabled) {
    transform: translateY(0);
}
.cer-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}
@media (prefers-reduced-motion: reduce) {
    .cer-btn {
        transition: none;
    }
}

.cer-wallet {
    text-align: center;
    font-size: 0.82rem;
    color: var(--color-text-tertiary, #666);
    font-family: var(--font-family-mono, monospace);
    margin: 0.15rem 0;
    min-height: 0;
}
.cer-prog {
    max-width: 32rem;
    margin: 0 auto;
    min-height: 1.25rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--color-text-secondary, #a3a3a3);
    font-family: var(--font-family-mono, monospace);
}
.cer-prog .ok {
    color: var(--color-secondary, #14f195);
}
.cer-prog .err {
    color: var(--color-danger, #ef4444);
}

/* One short rule under the action — not a wall of text. */
.cer-wallet-rule {
    text-align: center;
    margin: 0.75rem auto 0;
    max-width: 28rem;
    font-size: 0.95rem;
    line-height: 1.45;
    color: var(--color-text-secondary, #a3a3a3);
}
.cer-wallet-rule b {
    color: var(--color-text-primary, #fff);
}

.cer-list {
    max-width: 36rem;
    margin: 0.85rem auto 0;
}
.cer-list .empty {
    display: none;
}
.cer-list .row {
    display: flex;
    align-items: baseline;
    gap: 0.55rem;
    padding: 0.4rem 0.15rem;
    border-bottom: 1px solid var(--color-border-subtle, #1c1c1c);
    font-size: 0.88rem;
}
.cer-list .row:last-child {
    border-bottom: none;
}
.cer-list .idx {
    font-family: var(--font-family-mono, monospace);
    color: var(--color-primary, #9945ff);
    font-weight: 700;
    flex: 0 0 2rem;
}
.cer-list .who {
    color: var(--color-text-primary, #fff);
    flex: 0 0 auto;
}
.cer-list .hh {
    font-family: var(--font-family-mono, monospace);
    color: var(--color-text-tertiary, #666);
    font-size: 0.75rem;
    margin-left: auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 11rem;
}

.cer-skip {
    text-align: center;
    margin: 0.85rem 0 0;
    font-size: 0.88rem;
    line-height: 1.4;
}
.cer-skip a {
    color: var(--color-text-tertiary, #888);
    text-decoration: none;
}
.cer-skip a:hover {
    color: var(--color-secondary, #14f195);
}

/* Sticky CTA when main button leaves viewport */
.cer-sticky {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    padding: 0.55rem 0.85rem calc(0.55rem + env(safe-area-inset-bottom, 0px));
    background: rgba(10, 10, 10, 0.94);
    backdrop-filter: blur(10px);
    border-top: 1px solid #2b2246;
    text-align: center;
}
.cer-sticky.is-on {
    display: block;
}
.cer-sticky .cer-btn {
    width: min(420px, 100%);
    padding: 0.9rem 1.25rem;
    font-size: 1.05rem;
}
body.cer-sticky-pad {
    padding-bottom: 4.5rem;
}

/* ── Essay / docs below the fold ── */
.cer-sec {
    margin: 2.25rem 0;
}
.cer-sec h2 {
    font-size: 1.5rem;
    margin: 0 0 0.3rem;
}
.cer-sec .sub {
    color: var(--color-text-tertiary, #666);
    font-size: 0.92rem;
    margin: 0 0 1.2rem;
}
.cer-card {
    background: var(--color-surface-primary, #111);
    border: 1px solid var(--color-border-default, #2a2a2a);
    border-radius: 14px;
    padding: 1.3rem 1.5rem;
    margin-bottom: 1rem;
}
.cer-card p {
    color: var(--color-text-secondary, #a3a3a3);
    line-height: 1.65;
    margin: 0 0 0.8rem;
    font-size: 1rem;
}
.cer-card p:last-child {
    margin-bottom: 0;
}
.cer-card b {
    color: var(--color-text-primary, #fff);
}
.cer-key {
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
    padding: 0.55rem 0;
    font-size: 1rem;
    color: var(--color-text-secondary, #a3a3a3);
    line-height: 1.55;
}
.cer-key .n {
    font-family: var(--font-family-mono, monospace);
    color: var(--color-primary, #9945ff);
    font-weight: 700;
    flex: 0 0 auto;
}
.cer-oneofn {
    text-align: center;
    font-size: 1.15rem;
    font-weight: 600;
    margin: 1rem 0;
    padding: 0.9rem;
    border-radius: 12px;
    background: rgba(153, 69, 255, 0.08);
    border: 1px solid rgba(153, 69, 255, 0.25);
}
.cer-oneofn b {
    color: var(--color-secondary, #14f195);
}
.cer-status {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.8rem;
}
.cer-stat {
    background: var(--color-surface-primary, #111);
    border: 1px solid var(--color-border-default, #2a2a2a);
    border-radius: 12px;
    padding: 1rem 1.1rem;
}
.cer-stat .t {
    font-weight: 600;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.cer-stat .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-secondary, #14f195);
    flex: 0 0 auto;
}
.cer-stat .d {
    color: var(--color-text-secondary, #a3a3a3);
    font-size: 0.9rem;
    line-height: 1.5;
}
.cer-stat a {
    color: var(--color-secondary, #14f195);
    font-size: 0.85rem;
}
.cer-rm {
    position: relative;
    padding-left: 1.4rem;
}
.cer-rm-item {
    position: relative;
    padding: 0 0 1.3rem 1.2rem;
    border-left: 2px solid var(--color-border-default, #2a2a2a);
}
.cer-rm-item:last-child {
    border-left-color: transparent;
}
.cer-rm-item::before {
    content: "";
    position: absolute;
    left: -7px;
    top: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-bg-primary, #0a0a0a);
    border: 2px solid var(--color-border-strong, #3a3a3a);
}
.cer-rm-item.done::before {
    background: var(--color-secondary, #14f195);
    border-color: var(--color-secondary, #14f195);
}
.cer-rm-item.now::before {
    background: var(--color-primary, #9945ff);
    border-color: var(--color-primary, #9945ff);
}
.cer-rm-item .h {
    font-weight: 600;
    margin-bottom: 0.3rem;
}
.cer-rm-item .tag {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.1rem 0.45rem;
    border-radius: 5px;
    margin-left: 0.5rem;
}
.cer-rm-item.done .tag {
    background: rgba(20, 241, 149, 0.14);
    color: var(--color-secondary, #14f195);
}
.cer-rm-item.now .tag {
    background: rgba(153, 69, 255, 0.16);
    color: var(--color-primary-hover, #b066ff);
}
.cer-rm-item.next .tag {
    background: var(--color-surface-active, #222);
    color: var(--color-text-tertiary, #888);
}
.cer-rm-item ul {
    margin: 0.3rem 0 0;
    padding-left: 1.1rem;
    color: var(--color-text-secondary, #a3a3a3);
    font-size: 0.95rem;
    line-height: 1.6;
}
.cer-code {
    font-family: var(--font-family-mono, monospace);
    font-size: 0.85rem;
    line-height: 1.7;
    background: var(--color-bg-primary, #0a0a0a);
    border: 1px solid var(--color-border-default, #2a2a2a);
    border-radius: 10px;
    padding: 0.8rem 1rem;
    overflow-x: auto;
    white-space: nowrap;
    color: var(--color-text-secondary, #a3a3a3);
}
.cer-code b {
    color: var(--color-secondary, #14f195);
    font-weight: 500;
}
.cer-grad {
    background: linear-gradient(90deg, #9945ff 0%, #14f195 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Hero only below CTA (essay intro) — normal readable size */
.cer-hero-below {
    text-align: center;
    padding: 0.5rem 0 1rem;
}
.cer-hero-below h1 {
    font-size: 1.75rem;
    letter-spacing: -0.02em;
    margin: 0 0 0.5rem;
}
.cer-hero-below p {
    color: var(--color-text-secondary, #a3a3a3);
    font-size: 1.05rem;
    line-height: 1.55;
    max-width: 38rem;
    margin: 0 auto;
}

@media (max-width: 640px) {
    .cer-wrap {
        padding: 5px 0.75rem 1.5rem;
    }
    .cer-live {
        padding: 0.95rem 0.9rem 1.15rem;
        border-radius: 12px;
    }
    .cer-live .cer-brand {
        margin-bottom: 0.5rem;
    }
    .cer-live h2 {
        font-size: 1.3rem;
    }
    .cer-live .lead {
        font-size: 0.98rem;
    }
    .cer-count .num {
        font-size: 2.1rem;
    }
    .cer-btn {
        width: 100%;
        max-width: none;
        font-size: 1.1rem;
        padding: 0.95rem 1.25rem;
    }
    .cer-wallet-rule {
        font-size: 0.92rem;
    }
    .cer-list {
        max-height: 8rem;
        overflow: auto;
    }
}
