/* RJL Resaka custom theme */
:root {
    --bg: #08111f;
    --bg-soft: #0e1a2c;
    --surface: rgba(10, 21, 38, 0.82);
    --surface-strong: #12233a;
    --surface-border: rgba(255, 255, 255, 0.08);
    --text: #ecf6ff;
    --muted: #a7bed3;
    --primary: #22d3ee;
    --primary-dark: #0ea5b7;
    --secondary: #ff7a59;
    --accent: #9ef3d5;
    --gold: #f7c948;
    --danger: #ff7a59;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --space-section: clamp(4rem, 7vw, 6rem);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body.resaka-body {
    margin: 0;
    font-family: "Inter", system-ui, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(34, 211, 238, 0.18), transparent 30%),
        radial-gradient(circle at 85% 10%, rgba(255, 122, 89, 0.12), transparent 26%),
        linear-gradient(180deg, #09111f 0%, #0d1c32 45%, #09111f 100%);
    min-height: 100vh;
}

body.resaka-body::before,
body.resaka-body::after {
    content: "";
    position: fixed;
    inset: auto;
    border-radius: 999px;
    pointer-events: none;
    z-index: 0;
    filter: blur(20px);
}

body.resaka-body::before {
    width: 280px;
    height: 280px;
    top: 7rem;
    right: -6rem;
    background: rgba(34, 211, 238, 0.18);
}

body.resaka-body::after {
    width: 200px;
    height: 200px;
    left: -4rem;
    bottom: 15%;
    background: rgba(255, 122, 89, 0.12);
}

.resaka-shell,
.site-header,
main {
    position: relative;
    z-index: 1;
}

.container-xl {
    max-width: 1240px;
}

.navbar {
    background: rgba(7, 16, 29, 0.48);
    border: 1px solid var(--surface-border);
    border-radius: 999px;
    padding: 0.85rem 1.15rem;
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.2);
}

.brand-mark {
    font-family: "Manrope", sans-serif;
    font-weight: 800;
    letter-spacing: -0.04em;
    font-size: 1.3rem;
}

.brand-mark span,
.nav-link:hover,
.nav-link:focus {
    color: var(--primary) !important;
}

.nav-link {
    color: rgba(236, 246, 255, 0.82) !important;
    font-weight: 600;
}

.profile-pill,
.presence-chip,
.panel-note {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    border-radius: 999px;
    padding: 0.6rem 0.95rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text);
    font-size: 0.94rem;
}

.flash-stack {
    margin-top: 0.35rem;
}

.flash-stack .alert {
    background: rgba(18, 35, 58, 0.92);
    color: var(--text);
    border-left: 4px solid var(--primary);
    border-radius: 18px;
}

.hero-section,
.workflow-section,
.detail-section {
    padding: var(--space-section) 0;
}

.hero-copy {
    padding-right: 0.5rem;
}

.eyebrow {
    display: inline-flex;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--accent);
    background: rgba(158, 243, 213, 0.08);
    border: 1px solid rgba(158, 243, 213, 0.14);
    margin-bottom: 1.15rem;
}

.display-title,
.section-heading h2,
.thread-header h2,
.profile-spotlight h1 {
    font-family: "Manrope", sans-serif;
    letter-spacing: -0.04em;
}

.display-title {
    font-size: clamp(2.9rem, 6vw, 5.2rem);
    line-height: 0.98;
    margin: 0 0 1.4rem;
}

.lead-copy,
.section-heading p,
.panel-header p,
.muted-copy,
.preview-footer,
.conversation-copy p {
    color: var(--muted);
    font-size: 1.04rem;
}

.hero-actions,
.helper-row {
    align-items: center;
}

.metric-card,
.card-panel,
.info-card,
.preview-window {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    backdrop-filter: blur(22px);
    box-shadow: var(--shadow);
}

.metric-card {
    border-radius: 22px;
    padding: 1.15rem 1rem;
}

.metric-card strong {
    display: block;
    font-size: 1.65rem;
    font-family: "Manrope", sans-serif;
}

.metric-card span {
    color: var(--muted);
}

.card-panel,
.info-card {
    border-radius: var(--radius-xl);
    padding: 1.6rem;
}

.chat-preview-panel {
    position: relative;
    overflow: hidden;
}

.chat-preview-panel::after {
    content: "";
    position: absolute;
    inset: auto -2.5rem -3rem auto;
    width: 180px;
    height: 180px;
    border-radius: 32px;
    transform: rotate(24deg);
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.4), rgba(158, 243, 213, 0.08));
}

.preview-window {
    border-radius: 28px;
    padding: 1.2rem;
    position: relative;
    z-index: 1;
}

.preview-topbar {
    display: flex;
    gap: 0.45rem;
    margin-bottom: 1.15rem;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.25);
}

.preview-thread {
    display: grid;
    gap: 0.95rem;
}

.bubble,
.message-bubble {
    max-width: 88%;
    border-radius: 22px;
    padding: 0.95rem 1rem;
    line-height: 1.55;
}

.bubble-incoming,
.message-row:not(.is-own) .message-bubble {
    background: rgba(255, 255, 255, 0.07);
    border-top-left-radius: 8px;
}

.bubble-outgoing,
.message-row.is-own .message-bubble {
    margin-left: auto;
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.95), rgba(14, 165, 183, 0.92));
    color: #062130;
    border-top-right-radius: 8px;
}

.bubble-accent {
    border: 1px solid rgba(255, 122, 89, 0.4);
}

.preview-footer {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.presence-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 0 6px rgba(158, 243, 213, 0.12);
    flex-shrink: 0;
}

.section-heading {
    max-width: 720px;
    margin-bottom: 2rem;
}

.section-heading h2 {
    font-size: clamp(2rem, 4vw, 3.2rem);
    margin-bottom: 0.8rem;
}

.panel-header {
    margin-bottom: 1.2rem;
}

.panel-header h3,
.info-card h3 {
    font-family: "Manrope", sans-serif;
    font-size: 1.35rem;
    margin-bottom: 0.45rem;
}

.form-control,
.form-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    color: var(--text);
    padding: 0.86rem 1rem;
}

.form-control::placeholder {
    color: rgba(167, 190, 211, 0.8);
}

.form-control:focus,
.form-select:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(34, 211, 238, 0.6);
    box-shadow: 0 0 0 0.25rem rgba(34, 211, 238, 0.15);
    color: var(--text);
}

.form-select {
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 18px) calc(1.25rem), calc(100% - 12px) calc(1.25rem);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.form-select option {
    color: #0a1526;
}

.form-label,
.helper-label {
    color: rgba(236, 246, 255, 0.92);
    font-weight: 600;
}

.form-error {
    color: #ffd1c7;
    font-size: 0.92rem;
    margin-top: 0.45rem;
}

.btn {
    border-radius: 999px;
    font-weight: 700;
    padding: 0.88rem 1.35rem;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.btn:hover,
.btn:focus {
    transform: translateY(-1px);
}

.btn-brand {
    color: #072033;
    border: 0;
    background: linear-gradient(135deg, var(--primary), #66e6f0);
    box-shadow: 0 18px 36px rgba(34, 211, 238, 0.22);
}

.btn-brand:hover,
.btn-brand:focus {
    color: #072033;
    background: linear-gradient(135deg, #6ce8f4, var(--primary));
}

.btn-ghost {
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
}

.btn-ghost:hover,
.btn-ghost:focus {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
}

.emoji-chip,
.reaction-chip {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    border-radius: 999px;
    padding: 0.5rem 0.8rem;
    font-size: 0.92rem;
    text-decoration: none;
}

.emoji-chip:hover,
.reaction-chip:hover,
.emoji-chip:focus,
.reaction-chip:focus {
    background: rgba(34, 211, 238, 0.14);
    color: var(--text);
}

.reaction-chip.static {
    display: inline-flex;
}

.conversation-list {
    display: grid;
    gap: 1rem;
}

.conversation-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    padding: 1.1rem;
    border-radius: 22px;
    text-decoration: none;
    color: inherit;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.conversation-card:hover,
.conversation-card:focus {
    transform: translateY(-2px);
    border-color: rgba(34, 211, 238, 0.28);
    background: rgba(255, 255, 255, 0.06);
    color: inherit;
}

.avatar-orb {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #072033;
    font-family: "Manrope", sans-serif;
    font-weight: 800;
    font-size: 1.3rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.avatar-xl {
    width: 86px;
    height: 86px;
    border-radius: 28px;
    font-size: 2rem;
}

.conversation-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: baseline;
}

.conversation-head h4,
.profile-spotlight h1 {
    margin: 0;
    font-size: 1.2rem;
}

.conversation-copy strong,
.conversation-copy span,
.conversation-head span,
.meta-list span,
.meta-list strong,
.message-meta span {
    display: inline-block;
}

.conversation-copy strong {
    margin-right: 0.35rem;
}

.conversation-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.85rem;
}

.unread-badge,
.read-chip,
.reaction-pill {
    border-radius: 999px;
    padding: 0.3rem 0.7rem;
    font-weight: 700;
}

.unread-badge {
    background: rgba(255, 122, 89, 0.16);
    color: #ffd8cf;
    border: 1px solid rgba(255, 122, 89, 0.24);
}

.open-link,
.back-link {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.empty-state {
    text-align: center;
    padding: 2.2rem 1.4rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed rgba(255, 255, 255, 0.12);
}

.empty-state.compact {
    padding: 1.8rem 1rem;
}

.empty-illustration {
    font-size: 2.5rem;
    margin-bottom: 0.8rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 1.35rem;
}

.profile-spotlight {
    text-align: left;
}

.profile-spotlight p {
    color: var(--muted);
}

.meta-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.9rem;
}

.meta-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.meta-list span {
    color: var(--muted);
}

.thread-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: start;
    margin-bottom: 1.2rem;
}

.thread-header h2 {
    font-size: 2rem;
    margin: 0.3rem 0 0.4rem;
}

.message-thread {
    display: grid;
    gap: 1rem;
    max-height: 62vh;
    overflow-y: auto;
    padding-right: 0.35rem;
}

.message-row {
    display: flex;
}

.message-row.is-own {
    justify-content: flex-end;
}

.message-bubble-wrap {
    display: grid;
    gap: 0.5rem;
    max-width: min(100%, 720px);
}

.message-meta {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.55rem;
    font-size: 0.88rem;
}

.message-bubble p {
    margin: 0;
}

.message-row.is-own .message-meta,
.message-row.is-own .message-bubble p {
    color: #072033;
}

.read-chip {
    background: rgba(7, 32, 51, 0.14);
    color: #072033;
}

.reaction-pill {
    margin-top: 0.8rem;
    background: rgba(255, 255, 255, 0.14);
    display: inline-flex;
}

.reaction-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.reaction-actions form {
    margin: 0;
}

.composer-panel {
    margin-top: 1.35rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.reaction-preview-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.site-header .navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(34, 211, 238, 0.22);
}

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

@media (max-width: 767.98px) {
    .hero-section,
    .workflow-section,
    .detail-section {
        padding: 2.8rem 0;
    }

    .navbar {
        border-radius: 24px;
    }

    .display-title {
        font-size: clamp(2.4rem, 12vw, 3.4rem);
    }

    .conversation-card {
        grid-template-columns: 1fr;
    }

    .conversation-meta {
        align-items: flex-start;
    }

    .thread-header {
        flex-direction: column;
    }

    .bubble,
    .message-bubble {
        max-width: 100%;
    }
}
