:root {
    /* backgrounds */
    --bg: #faf7f2;
    --bg-warm: #f5efe6;
    --surface: #fffdf9;
    --surface-alt: #fef6ee;

    /* borders */
    --border: #e8d8c8;
    --border-soft: #f0e4d4;

    /* main colors — lily can go wild here */
    --pink: #d4747a;
    --pink-light: #eaa8ac;
    --pink-pale: #faeaea;
    --gold: #c08840;
    --gold-light: #ddb870;
    --gold-pale: #fdf4e0;
    --accent: #8fb0a0;
    /* sage green as a third accent */
    --accent-pale: #eaf3ee;

    /* text */
    --text: #342820;
    --text-mid: #6b4e3d;
    --text-muted: #a8897a;

    /* shadows — softer, warmer */
    --shadow: 0 2px 12px rgba(180, 120, 80, 0.08);
    --shadow-md: 0 6px 24px rgba(180, 120, 80, 0.13);

    /* shape */
    --radius: 10px;
    --radius-sm: 6px;

    /* typography */
    --font-display: 'Architects Daughter', 'Comic Sans MS', cursive;
    --font-body: 'Lora', Georgia, serif;
    --font-mono: 'Courier New', monospace;
}

/* ── Reset ──────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    background-image:
        radial-gradient(circle at 20% 50%, rgba(212, 116, 122, 0.04) 0%, transparent 60%),
        radial-gradient(circle at 80% 20%, rgba(192, 136, 64, 0.04) 0%, transparent 50%);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.7;
    min-height: 100vh;
}

/* ── Header ─────────────────────────────────────────────── */
.site-header {
    background: var(--surface);
    border-bottom: 2px dashed var(--border);
    padding: 0 2rem;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--pink);
    text-decoration: none;
    letter-spacing: 0.01em;
}

.logo em {
    color: var(--gold);
    font-style: normal;
}

.header-tagline {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ── Layout ─────────────────────────────────────────────── */
.layout {
    display: grid;
    grid-template-columns: 230px 1fr 210px;
    gap: 1.4rem;
    max-width: 1160px;
    margin: 0 auto;
    padding: 1.8rem 1.4rem;
    align-items: start;
}

/* ── Cards ──────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* slightly hand-drawn feel on cards */
.card:nth-child(odd) {
    transform: rotate(-0.3deg);
}

.card:nth-child(even) {
    transform: rotate(0.2deg);
}

.card-label {
    font-family: var(--font-display);
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0.75rem 1.1rem 0.5rem;
    border-bottom: 1px dashed var(--border-soft);
    letter-spacing: 0.05em;
}

/* ── Left sidebar ───────────────────────────────────────── */
.sidebar-left {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 76px;
}

/* Profile */
.profile-card .pfp-wrap {
    background: linear-gradient(135deg, var(--pink-pale), var(--gold-pale));
    padding: 1.4rem;
    display: flex;
    justify-content: center;
    border-bottom: 1px dashed var(--border-soft);
}

.pfp {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 3px solid var(--surface);
    box-shadow: 0 0 0 2px var(--pink-light), var(--shadow);
    object-fit: cover;
    background: linear-gradient(135deg, var(--pink-pale), var(--gold-pale));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.profile-info {
    padding: 0.9rem 1.1rem 1.1rem;
}

.profile-name {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--text);
    margin-bottom: 0.15rem;
}

.profile-handle {
    font-size: 0.75rem;
    color: var(--pink);
    margin-bottom: 0.7rem;
}

.profile-bio {
    font-size: 0.82rem;
    color: var(--text-mid);
    line-height: 1.7;
    margin-bottom: 0.85rem;
}

.profile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.tag {
    font-size: 0.7rem;
    padding: 0.15rem 0.55rem;
    border-radius: 99px;
    background: var(--pink-pale);
    color: var(--pink);
    border: 1px solid var(--pink-light);
    font-family: var(--font-display);
}

.tag.gold {
    background: var(--gold-pale);
    color: var(--gold);
    border-color: var(--gold-light);
}

.tag.sage {
    background: var(--accent-pale);
    color: var(--accent);
    border-color: var(--accent);
}

/* Live log */
.log-card .log-body {
    padding: 0.7rem 0.9rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-mid);
    max-height: 200px;
    overflow-y: auto;
    line-height: 1.75;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.log-line.ok {
    color: var(--gold);
}

.log-line.err {
    color: var(--pink);
}

.log-status {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem 0.6rem;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--border);
}

.dot.live {
    background: #88c898;
    animation: blink 2s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: 0.3
    }
}

/* ── Center ─────────────────────────────────────────────── */
.center {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}

.back-link {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--font-display);
}

.back-link:hover {
    color: var(--pink);
}

.post-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.8rem 2rem;
    transition: box-shadow 0.2s, transform 0.2s;
}

.post-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.post-meta {
    margin-bottom: 0.6rem;
}

.post-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: var(--font-display);
    letter-spacing: 0.06em;
}

.post-title {
    font-family: var(--font-display);
    font-size: 1.45rem;
    color: var(--text);
    margin-bottom: 0.9rem;
    line-height: 1.35;
}

.post-title a {
    color: inherit;
    text-decoration: none;
}

.post-title a:hover {
    color: var(--pink);
}

/* wiggly divider instead of straight line */
.post-divider {
    font-size: 1rem;
    color: var(--pink-light);
    margin-bottom: 1rem;
    letter-spacing: 0.2em;
    user-select: none;
}

.post-body {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-mid);
    line-height: 1.85;
}

.post-body p {
    margin-bottom: 1rem;
}

.post-body p:last-child {
    margin-bottom: 0;
}

.post-footer {
    margin-top: 1.2rem;
    padding-top: 0.9rem;
    border-top: 1px dashed var(--border-soft);
    display: flex;
    justify-content: flex-end;
}

.read-more {
    font-size: 0.78rem;
    color: var(--pink);
    text-decoration: none;
    font-family: var(--font-display);
}

.read-more:hover {
    color: var(--gold);
}

.empty-state {
    background: var(--surface);
    border: 1.5px dashed var(--border);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 2rem;
    margin-bottom: 0.7rem;
}

.empty-state p {
    font-size: 0.85rem;
    font-style: italic;
}

/* ── Right sidebar ──────────────────────────────────────── */
.sidebar-right {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 76px;
}

.duel-list {
    padding: 0.4rem 0;
}

.duel-entry {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 1.1rem;
    border-bottom: 1px dashed var(--border-soft);
    transition: background 0.15s;
}

.duel-entry:last-child {
    border-bottom: none;
}

.duel-entry:hover {
    background: var(--pink-pale);
}

.duel-rank {
    font-family: var(--font-display);
    font-size: 0.95rem;
    color: var(--gold-light);
    min-width: 18px;
}

.duel-rank.first {
    color: var(--gold);
}

.duel-rank.second {
    color: var(--text-muted);
}

.duel-rank.third {
    color: #c07850;
}

.duel-name {
    flex: 1;
    font-size: 0.8rem;
    color: var(--text);
}

.duel-count {
    font-size: 0.75rem;
    color: var(--pink);
    font-family: var(--font-display);
}

.duel-empty {
    padding: 1rem;
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ── Gallery sidebar preview ───────────────────────────── */
.gallery-card .gallery-preview {
    padding: 0.6rem 0.9rem 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.gallery-preview-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    background: var(--bg-warm);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.12s;
    animation: fadeSlideIn 0.3s both;
    width: calc(100% - 4px);
    margin: 0 2px;
}

.gallery-preview-row:hover {
    background: var(--pink-pale);
    border-color: var(--pink-light);
    transform: translateX(2px);
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

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

.gallery-preview-thumb {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg);
}

.gallery-preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-preview-title {
    font-size: 0.72rem;
    color: var(--text-mid);
    font-family: var(--font-display);
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.gallery-see-all {
    margin-top: 0.3rem;
    margin-left: 2px;
    background: none;
    border: none;
    font-family: var(--font-display);
    font-size: 0.72rem;
    color: var(--pink);
    cursor: pointer;
    padding: 0;
    text-align: left;
}

.gallery-see-all:hover {
    color: var(--gold);
}

/* ── Gallery modal ─────────────────────────────────────── */
.gallery-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(30, 18, 12, 0.72);
    z-index: 999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.gallery-modal.open {
    display: flex;
}

.gallery-modal-inner {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    width: min(760px, 95vw);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.gallery-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.2rem 0.6rem;
    border-bottom: 1px dashed var(--border-soft);
    flex-shrink: 0;
}

.gallery-modal-title {
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.gallery-modal-close {
    background: none;
    border: none;
    font-size: 1.1rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0.1rem 0.3rem;
    border-radius: var(--radius-sm);
    transition: color 0.15s, background 0.15s;
}

.gallery-modal-close:hover {
    color: var(--pink);
    background: var(--pink-pale);
}

/* viewer area — title on top, image below */
.gallery-viewer {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 0;
    padding: 1rem 3.5rem 0.8rem;
}

.gallery-viewer-img-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    min-height: 0;
}

.gallery-viewer-title {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--text);
    text-align: center;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.gallery-viewer-img {
    max-width: 100%;
    max-height: 52vh;
    border-radius: var(--radius);
    object-fit: contain;
    border: 1.5px solid var(--border);
    box-shadow: var(--shadow-md);
    display: block;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1.4rem;
    color: var(--text-mid);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    line-height: 1;
    z-index: 2;
}

.gallery-nav:hover {
    background: var(--pink-pale);
    color: var(--pink);
    border-color: var(--pink-light);
}

.gallery-nav-prev {
    left: 0.8rem;
}

.gallery-nav-next {
    right: 0.8rem;
}

.gallery-counter {
    font-family: var(--font-display);
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
    padding: 0.4rem 0 0.5rem;
    flex-shrink: 0;
}

/* Filmstrip */
.gallery-filmstrip {
    display: flex;
    gap: 0.4rem;
    padding: 0.6rem 1rem;
    overflow-x: auto;
    border-top: 1px dashed var(--border-soft);
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    flex-shrink: 0;
}

.filmstrip-thumb {
    flex-shrink: 0;
    width: 54px;
    height: 54px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid var(--border);
    cursor: pointer;
    opacity: 0.55;
    transition: opacity 0.15s, border-color 0.15s;
}

.filmstrip-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.filmstrip-thumb:hover {
    opacity: 0.85;
}

.filmstrip-thumb.active {
    opacity: 1;
    border-color: var(--pink);
}

/* ── Footer ─────────────────────────────────────────────── */
.site-footer {
    text-align: center;
    padding: 2rem 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-top: 1px dashed var(--border-soft);
    margin-top: 0.5rem;
    font-family: var(--font-display);
}

.gallery-preview-thumb--video,
.filmstrip-thumb-video {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gold-pale);
    color: var(--gold);
    font-size: 1.1rem;
    border-radius: var(--radius-sm);
}

.filmstrip-thumb-video {
    font-size: 1.4rem;
}

.visitor-count {
    margin-left: auto;
    font-size: 0.8em;
    opacity: 0.6;
    font-family: var(--font-body);
    white-space: nowrap;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
    .layout {
        grid-template-columns: 200px 1fr;
    }

    .sidebar-right {
        display: none;
    }
}

@media (max-width: 600px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar-left {
        position: static;
    }
}

/* ── Pagination ──────────────────────────────────────────────────────────────── */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin: 24px 0 8px;
    flex-wrap: wrap;
}

.page-btn {
    padding: 5px 13px;
    border: 1.5px dashed #c9b99a;
    border-radius: 20px;
    font-family: 'Architects Daughter', cursive;
    font-size: 0.9em;
    color: #8a7355;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
    user-select: none;
}

.page-btn:hover {
    background: #f5ede0;
    border-color: #a8926e;
}

.page-btn.active {
    background: #8a7355;
    color: #fff;
    border-color: #8a7355;
    cursor: default;
}

.page-btn.disabled {
    opacity: 0.32;
    cursor: default;
    pointer-events: none;
}

/* ── Specs card (about lily's brain/hardware) ──────────────────────────── */
.specs-card .specs-body {
    padding: 0.8rem 1.1rem 1rem;
}

.specs-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.3rem 0;
    border-bottom: 1px dashed var(--border-soft);
    font-size: 0.8rem;
}

.specs-row:last-of-type {
    border-bottom: none;
}

.specs-key {
    font-family: var(--font-display);
    color: var(--text-muted);
    letter-spacing: 0.03em;
}

.specs-val {
    color: var(--text);
    font-weight: 600;
    text-align: right;
}

.specs-desc {
    margin-top: 0.6rem;
    font-size: 0.78rem;
    color: var(--text-mid);
    line-height: 1.6;
    font-style: italic;
}

/* ── Comment actions: like / reply / share ─────────────────────────────── */
.comment-actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 0.76rem;
    color: var(--text-muted);
    padding: 2px 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.15s, transform 0.1s;
}

.comment-actions button:hover {
    color: var(--pink);
}

.comment-actions button:active {
    transform: scale(0.94);
}

.like-btn .heart {
    font-size: 0.95em;
    transition: transform 0.15s;
}

.like-btn.liked {
    color: var(--pink);
}

.like-btn.liked .heart {
    transform: scale(1.15);
}

.like-btn.liked:hover {
    color: var(--pink);
}

.inline-status {
    font-size: 0.74rem;
    color: var(--accent);
    font-style: italic;
}

.share-btn {
    background: none;
    border: 1px dashed var(--border);
    border-radius: 99px;
    padding: 3px 10px;
    font-family: var(--font-display);
    font-size: 0.72rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.share-btn:hover {
    background: var(--pink-pale);
    color: var(--pink);
    border-color: var(--pink-light);
}

.share-btn.small {
    padding: 2px 8px;
    font-size: 0.7rem;
}

.post-footer .share-btn.small {
    margin-right: auto;
}

/* ── Nested comment threads ─────────────────────────────────────────────── */
.comment-entry {
    position: relative;
    background: var(--surface);
    /* NEW */
}
.comment-children {
    border-left: 1.5px dashed var(--border-soft);
    background: var(--surface);
    /* NEW — opaque, paints over parent's gold bg */
}
.comment-entry:target,
.comment-entry.highlight {
    background: var(--gold-pale);
}

.reply-form {
    background: var(--bg-warm);
    border: 1px dashed var(--border-soft);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
}

/* ── Lily's comments — same gold/italic identity she always had,
   now applied to her as a regular thread participant ─────────────────── */
.comment-entry.is-lily {
    background: var(--gold-pale);
    border-left: 3px solid var(--gold-light);
}

.lily-name {
    font-weight: bold;
    color: var(--gold);
    font-size: 0.95em;
    font-family: var(--font-display);
}

.comment-entry.lily-typing {
    background: var(--gold-pale);
    border-left: 3px solid var(--border-soft);
    opacity: 0.85;
}
.post-like-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px dashed var(--border-soft);
}

.post-like-btn {
    background: none;
    border: 1.5px dashed var(--border);
    border-radius: 99px;
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 5px 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.15s, background 0.15s, border-color 0.15s, transform 0.1s;
}

.post-like-btn:hover {
    background: var(--pink-pale);
    color: var(--pink);
    border-color: var(--pink-light);
}

.post-like-btn:active {
    transform: scale(0.95);
}

.post-like-btn .heart {
    font-size: 1em;
    transition: transform 0.15s;
}

.post-like-btn.liked {
    color: var(--pink);
    border-color: var(--pink-light);
    background: var(--pink-pale);
}

.post-like-btn.liked .heart {
    transform: scale(1.15);
}

.toggle-replies-btn {
    background: none;
    border: none;
    font-family: var(--font-display);
    font-size: 0.74rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 0 2px 0;
    display: block;
    transition: color 0.15s;
}

.toggle-replies-btn:hover {
    color: var(--pink);
}