:root {
    --ink: #14231f;
    --muted: #5c6c67;
    --paper: #f6f1e8;
    --panel: rgba(255, 252, 246, 0.86);
    --line: rgba(20, 35, 31, 0.12);
    --teal: #0f766e;
    --teal-deep: #0b5a54;
    --amber: #b45309;
    --danger: #9f1239;
    --ok: #166534;
    --shadow: 0 24px 60px rgba(20, 35, 31, 0.12);
    --radius: 18px;
    --font-display: "Fraunces", Georgia, serif;
    --font-body: "Manrope", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    color: var(--ink);
    font-family: var(--font-body);
    background: #efe9dc;
}

body {
    position: relative;
}

.page-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 12% 8%, rgba(15, 118, 110, 0.22), transparent 36%),
        radial-gradient(circle at 88% 18%, rgba(180, 83, 9, 0.14), transparent 30%),
        radial-gradient(circle at 70% 90%, rgba(15, 118, 110, 0.12), transparent 35%),
        linear-gradient(165deg, #f7f2e7 0%, #e7efe9 48%, #dce7e2 100%);
}

.site-header,
.site-main,
.site-footer {
    width: min(1080px, calc(100% - 2rem));
    margin-inline: auto;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.4rem 0 0.5rem;
}

.brand {
    font-family: var(--font-display);
    font-size: clamp(1.15rem, 2.8vw, 1.45rem);
    font-weight: 700;
    color: var(--ink);
    text-decoration: none;
    letter-spacing: -0.03em;
}

.site-header nav a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
}

.site-header nav a:hover { color: var(--teal-deep); }

.site-header nav a.btn-primary,
.site-header nav a.btn-primary:hover {
    color: #fff;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-email {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.nav-logout {
    display: inline;
    margin: 0;
}

.btn-small {
    padding: 0.45rem 0.9rem;
    font-size: 0.88rem;
}

.auth-form {
    grid-template-columns: 1fr;
}

.auth-switch {
    margin: 1.25rem 0 0;
    color: var(--muted);
}

.auth-switch a {
    color: var(--teal-deep);
    font-weight: 600;
    text-decoration: none;
}

.auth-switch a:hover { text-decoration: underline; }

.dashboard-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.empty-state {
    padding: 1.5rem 0 0.5rem;
    color: var(--muted);
}

.empty-state p { margin: 0 0 1rem; }

.bot-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.bot-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.55);
}

.bot-card h2 {
    margin: 0 0 0.2rem;
    font-family: var(--font-display);
    font-size: 1.25rem;
}

.bot-card p {
    margin: 0;
    color: var(--muted);
}

.bot-card-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.site-footer {
    padding: 0 0 2rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-row > p { margin: 0; }

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem 1.1rem;
    align-items: center;
}

.footer-nav a,
.footer-email {
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
}

.footer-nav a:hover,
.footer-email:hover {
    color: var(--teal-deep);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.email-obf { color: var(--muted); font-weight: 600; }

.product-pitch,
.pricing-teaser {
    margin: 2rem 0 1rem;
}

.product-pitch h2,
.pricing-teaser h2 {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    margin: 0 0 0.75rem;
}

.lede.narrow {
    max-width: 42rem;
}

.pricing-teaser .plan-card h3 {
    font-family: var(--font-display);
    margin: 0 0 0.5rem;
    font-size: 1.35rem;
}

.pricing-teaser .plan-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.plan-price {
    margin: 0 0 0.65rem !important;
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--ink) !important;
    line-height: 1.2 !important;
}

.legal-doc .legal-body {
    line-height: 1.65;
    color: var(--ink);
}

.legal-doc .legal-body h2 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    margin: 1.75rem 0 0.5rem;
}

.legal-doc .legal-body p,
.legal-doc .legal-body ul {
    color: var(--muted);
}

.legal-doc .legal-body ul {
    padding-left: 1.2rem;
}

.site-main { padding: 1.5rem 0 3rem; }

.hero {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 2rem;
    align-items: center;
    min-height: calc(100vh - 9rem);
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--teal-deep);
    margin: 0 0 0.75rem;
}

.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2.8rem, 7vw, 4.6rem);
    line-height: 0.95;
    margin: 0 0 1rem;
    letter-spacing: -0.03em;
}

.lede {
    font-size: 1.12rem;
    line-height: 1.65;
    color: var(--muted);
    max-width: 36rem;
    margin: 0 0 1.5rem;
}

.cta-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border: 0;
    border-radius: 999px;
    padding: 0.8rem 1.25rem;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--teal);
    color: #fff;
    box-shadow: 0 10px 24px rgba(15, 118, 110, 0.28);
}

.btn-primary:hover { background: var(--teal-deep); }

.btn-ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--line);
}

.btn-ghost:hover { background: rgba(255,255,255,0.55); }

.hero-panel { display: flex; justify-content: center; }

.fake-site {
    width: min(100%, 340px);
    aspect-ratio: 4/5;
    border-radius: 24px;
    background: rgba(255,255,255,0.7);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

.fake-bar {
    height: 10px;
    width: 42%;
    border-radius: 999px;
    background: rgba(20, 35, 31, 0.12);
    margin-bottom: 1.25rem;
}

.fake-lines span {
    display: block;
    height: 10px;
    border-radius: 999px;
    background: rgba(20, 35, 31, 0.08);
    margin-bottom: 0.7rem;
}

.fake-lines span:nth-child(1) { width: 88%; }
.fake-lines span:nth-child(2) { width: 72%; }
.fake-lines span:nth-child(3) { width: 64%; }

.fake-widget { position: absolute; right: 1rem; bottom: 1rem; }

.fake-bubble {
    background: var(--teal);
    color: #fff;
    padding: 0.7rem 0.9rem;
    border-radius: 14px 14px 4px 14px;
    font-size: 0.85rem;
    margin-bottom: 0.6rem;
    max-width: 180px;
    animation: rise 1.4s ease both;
}

.fake-fab {
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 50%;
    background: var(--teal);
    color: #fff;
    font-size: 1.35rem;
    float: right;
    display: grid;
    place-items: center;
    box-shadow: 0 12px 24px rgba(15, 118, 110, 0.35);
    animation: pulse 2.4s ease-in-out infinite;
}

.fake-fab .bi {
    line-height: 1;
}

@keyframes rise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.features article {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem;
    backdrop-filter: blur(8px);
}

.features h2 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    margin: 0 0 0.5rem;
}

.features p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: clamp(1.25rem, 3vw, 2rem);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.panel.narrow { max-width: 560px; }

.panel-head h1 {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    margin: 0 0 0.4rem;
}

.panel-head p { margin: 0 0 1.25rem; color: var(--muted); }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-grid label {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-weight: 600;
    font-size: 0.92rem;
}

.form-grid label.full { grid-column: 1 / -1; }

.form-grid input,
.form-grid textarea,
.form-grid select {
    font: inherit;
    font-weight: 500;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.75rem 0.9rem;
    background: rgba(255,255,255,0.8);
}

.form-grid textarea { resize: vertical; min-height: 180px; line-height: 1.5; }

.form-grid input:focus,
.form-grid textarea:focus,
.form-grid select:focus {
    outline: 2px solid rgba(15, 118, 110, 0.35);
    border-color: var(--teal);
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.alert {
    border-radius: 14px;
    padding: 0.9rem 1rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.alert ul { margin: 0; padding-left: 1.1rem; }

.alert-error {
    background: rgba(159, 18, 57, 0.08);
    border: 1px solid rgba(159, 18, 57, 0.25);
    color: var(--danger);
}

.alert-success {
    background: rgba(22, 101, 52, 0.08);
    border: 1px solid rgba(22, 101, 52, 0.22);
    color: var(--ok);
}

.alert-warn {
    background: rgba(180, 83, 9, 0.08);
    border: 1px solid rgba(180, 83, 9, 0.22);
    color: #7c2d12;
}

.alert-warn code {
    display: block;
    margin: 0.45rem 0;
    word-break: break-all;
    font-size: 0.86rem;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.stats > div {
    background: rgba(255,255,255,0.55);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 0.9rem 1rem;
}

.stats .label {
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.swatch {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.swatch i {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid rgba(0,0,0,0.1);
}

.embed-box {
    border: 1px dashed rgba(15, 118, 110, 0.35);
    border-radius: 16px;
    padding: 1rem;
    background: rgba(15, 118, 110, 0.04);
    margin-bottom: 1rem;
}

.embed-box-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.embed-box h2 {
    margin: 0;
    font-size: 1rem;
}

.embed-box pre {
    margin: 0;
    padding: 0.9rem;
    overflow-x: auto;
    background: #14231f;
    color: #e8efe9;
    border-radius: 12px;
    font-size: 0.86rem;
    line-height: 1.5;
}

.hint {
    margin: 0.65rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.plan-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.plan-card {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1.1rem;
    background: rgba(255,255,255,0.55);
}

.plan-card.is-current {
    border-color: var(--teal);
    box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.15);
}

.plan-card h2 {
    margin: 0 0 0.75rem;
    font-family: var(--font-display);
}

.plan-card ul {
    margin: 0 0 1rem;
    padding-left: 1.1rem;
    color: var(--muted);
    line-height: 1.55;
}

.plan-note {
    margin: 0;
    color: var(--muted);
    font-weight: 600;
}

.log-layout {
    display: grid;
    grid-template-columns: minmax(220px, 0.9fr) 1.4fr;
    gap: 1rem;
    min-height: 420px;
}

.log-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 560px;
    overflow: auto;
}

.log-item {
    display: block;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.75rem 0.9rem;
    background: rgba(255,255,255,0.5);
}

.log-item.is-active,
.log-item:hover {
    border-color: var(--teal);
}

.log-item strong {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.92rem;
}

.log-item span {
    color: var(--muted);
    font-size: 0.8rem;
}

.log-detail {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1rem;
    background: rgba(255,255,255,0.55);
    max-height: 560px;
    overflow: auto;
}

.log-msg {
    margin-bottom: 0.9rem;
}

.log-msg header {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin-bottom: 0.3rem;
}

.log-msg pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.5;
}

.log-msg-user pre {
    background: rgba(15, 118, 110, 0.08);
    border-radius: 10px;
    padding: 0.7rem 0.8rem;
}

.log-msg-assistant pre {
    background: rgba(20, 35, 31, 0.04);
    border-radius: 10px;
    padding: 0.7rem 0.8rem;
}

.blog-index-head {
    margin: 0.5rem 0 2rem;
}

.blog-index-head h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 2.8rem);
    margin: 0 0 0.75rem;
    line-height: 1.1;
}

.blog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

.blog-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
}

.blog-card-link {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    color: inherit;
    text-decoration: none;
    min-height: 100%;
}

.blog-card-media {
    min-height: 180px;
    background: rgba(15, 118, 110, 0.08);
}

.blog-card-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-card-body {
    padding: 1.25rem 1.35rem 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.blog-card-body time,
.blog-post-head time {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.blog-card-body h2 {
    font-family: var(--font-display);
    font-size: 1.45rem;
    margin: 0;
    line-height: 1.2;
}

.blog-card-body p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
    flex: 1;
}

.blog-read-more {
    margin-top: 0.5rem;
    color: var(--teal-deep);
    font-weight: 700;
    font-size: 0.92rem;
}

.blog-back {
    margin: 0 0 1rem;
}

.blog-back a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
}

.blog-back a:hover {
    color: var(--teal-deep);
}

.blog-post-head h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4.5vw, 3rem);
    line-height: 1.08;
    margin: 0.35rem 0 0.85rem;
}

.blog-post-hero {
    margin: 1.5rem 0 1.75rem;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.blog-post-hero img {
    display: block;
    width: 100%;
    height: auto;
    vertical-align: middle;
}

.blog-post-body {
    max-width: 42rem;
    line-height: 1.7;
    color: var(--muted);
}

.blog-post-body h2 {
    font-family: var(--font-display);
    color: var(--ink);
    font-size: 1.35rem;
    margin: 1.75rem 0 0.55rem;
}

.blog-post-body h3 {
    font-family: var(--font-display);
    color: var(--ink);
    font-size: 1.15rem;
    margin: 1.4rem 0 0.45rem;
}

.blog-post-body p,
.blog-post-body ul,
.blog-post-body ol {
    margin: 0 0 1rem;
}

.blog-post-body a {
    color: var(--teal-deep);
    font-weight: 600;
}

.blog-post-body strong {
    color: var(--ink);
}

.muted { color: var(--muted); }

@media (max-width: 860px) {
    .hero,
    .features,
    .form-grid,
    .stats,
    .plan-grid,
    .log-layout,
    .blog-card-link {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: auto;
        padding-top: 1rem;
    }

    .fake-site { max-width: 280px; }

    .bot-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-email { display: none; }

    .blog-card-media {
        min-height: 160px;
        max-height: 220px;
    }
}
