/* Chatbook by Shhalaj */

:root {
    --paper: #faf6ee;
    --paper-2: #f2ebdd;
    --card: #ffffff;
    --ink: #1d2422;
    --ink-2: #4a5552;
    --muted: #6b7471;
    --line: #e2d9c7;
    --accent: #14423c;
    --accent-2: #1f6b60;
    --accent-ink: #ffffff;
    --warm: #c9792e;
    --bubble-q: #14423c;
    --bubble-a: #ffffff;
    --shadow: 0 1px 2px rgba(29, 36, 34, .06), 0 8px 28px rgba(29, 36, 34, .08);
    --radius: 14px;
    --serif: "Fraunces", Georgia, "Times New Roman", serif;
    --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --paper: #121816;
        --paper-2: #18201e;
        --card: #1c2523;
        --ink: #eef0ec;
        --ink-2: #c3cbc7;
        --muted: #97a19d;
        --line: #2c3734;
        --accent: #5fbfae;
        --accent-2: #7fd3c3;
        --accent-ink: #0d1b18;
        --warm: #e5a465;
        --bubble-q: #2b6b61;
        --bubble-a: #222d2a;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .35);
        color-scheme: dark;
    }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 400 17px/1.6 var(--sans);
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent-2); text-underline-offset: 3px; }
a:hover { color: var(--accent); }

h1, h2, h3 { font-family: var(--serif); font-weight: 650; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 700px) { .wrap { padding: 0 28px; } }

.sr, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--card); padding: 8px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }

.muted { color: var(--muted); }
.center { text-align: center; }

:focus-visible { outline: 3px solid var(--warm); outline-offset: 2px; border-radius: 4px; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4em;
    background: var(--accent); color: var(--accent-ink);
    border: 2px solid var(--accent); border-radius: 999px;
    padding: .7em 1.4em; font: 600 1rem/1.2 var(--sans); text-decoration: none; cursor: pointer;
    transition: background .15s, color .15s, transform .15s;
}
.btn:hover { background: var(--accent-2); border-color: var(--accent-2); color: var(--accent-ink); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent); color: var(--accent-ink); }
.btn-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .7); }
.btn-light:hover { background: #fff; color: #14423c; border-color: #fff; }
.btn-small { padding: .45em 1em; font-size: .92rem; }
.btn[disabled] { opacity: .6; cursor: wait; transform: none; }

/* Header */
.site-head { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.head-row { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }
.brand { display: flex; align-items: baseline; gap: 8px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 30px; height: 30px; color: var(--accent); align-self: center; }
.brand-name { font-family: var(--serif); font-weight: 650; font-size: 1.45rem; }
.brand-by { font-size: .8rem; color: var(--muted); }

.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav a:not(.btn) { color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: .96rem; }
.site-nav a:not(.btn):hover, .site-nav a[aria-current="page"] { color: var(--accent); }
.site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }

.nav-toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; color: var(--ink); }
.bars, .bars::before, .bars::after { display: block; width: 22px; height: 2px; background: currentColor; border-radius: 2px; position: relative; transition: transform .2s; }
.bars::before, .bars::after { content: ""; position: absolute; left: 0; }
.bars::before { top: -7px; }
.bars::after { top: 7px; }
.nav-open .bars { background: transparent; }
.nav-open .bars::before { transform: translateY(7px) rotate(45deg); }
.nav-open .bars::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
    .nav-toggle { display: block; }
    .site-nav { display: none; position: absolute; left: 0; right: 0; top: 64px; flex-direction: column; align-items: stretch; gap: 0; background: var(--paper); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; box-shadow: var(--shadow); }
    .nav-open .site-nav { display: flex; }
    .site-nav a:not(.btn) { padding: 12px 4px; border-bottom: 1px solid var(--line); }
    .site-nav .btn { margin-top: 12px; }
}

/* Hero */
.hero { padding: 56px 0 64px; background: radial-gradient(1200px 500px at 85% -10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 600; color: var(--warm); margin-bottom: .8em; }
.hero h1 em { font-style: italic; color: var(--accent); }
.lede { font-size: 1.18rem; color: var(--ink-2); max-width: 36em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 14px; }
.hero-note { font-size: .92rem; color: var(--muted); }

.demo { margin: 0; background: var(--paper-2); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; }
.demo-bar { display: flex; align-items: center; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--card); }
.demo-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.demo-title { margin-left: 8px; font-size: .85rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-body { padding: 20px 18px 8px; display: flex; flex-direction: column; gap: 12px; }
.bubble { max-width: 86%; padding: 12px 15px; border-radius: 16px; font-size: .95rem; line-height: 1.45; }
.bubble-q { align-self: flex-end; background: var(--bubble-q); color: #fff; border-bottom-right-radius: 5px; }
.bubble-a { align-self: flex-start; background: var(--bubble-a); border: 1px solid var(--line); border-bottom-left-radius: 5px; width: 80%; }
.demo-lines { display: flex; flex-direction: column; gap: 7px; margin-bottom: 10px; }
.demo-lines i { display: block; height: 8px; border-radius: 4px; background: var(--line); }
.demo-lines i.short { width: 60%; }
.demo-cite { display: inline-block; font-size: .76rem; font-weight: 600; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); padding: 3px 9px; border-radius: 999px; }
.bubble-typing { width: auto; display: flex; gap: 5px; }
.bubble-typing b { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite both; }
.bubble-typing b:nth-child(2) { animation-delay: .2s; }
.bubble-typing b:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .bubble-typing b { animation: none; opacity: .6; } html { scroll-behavior: auto; } }
.demo figcaption { font-size: .76rem; color: var(--muted); padding: 6px 18px 14px; }

@media (max-width: 860px) {
    .hero { padding: 32px 0 44px; }
    .hero-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* Sections */
.section { padding: 64px 16px; }
@media (min-width: 700px) { .section { padding: 72px 28px; } }
.band { background: var(--paper-2); padding: 64px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.band-ink { background: #14423c; color: #fff; border: 0; }
.section-h { margin-bottom: .8em; }
.section-top { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.link-arrow { font-weight: 600; text-decoration: none; }
.link-arrow::after { content: " \2192"; }
.narrow { max-width: 780px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; gap: 24px; } }

.page-head { padding: 52px 0 12px; }
.page-head .lede { margin-bottom: 0; }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.steps li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.steps p { color: var(--ink-2); margin: 0; }
.step-n { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 600; margin-bottom: 14px; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

/* Shelf (home) */
.shelf { display: grid; grid-template-columns: repeat(5, 1fr); gap: 22px; margin-top: 8px; }
.shelf-book { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 4px; }
.shelf-cover { display: block; border-radius: 6px; overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 2 / 3; background: var(--paper-2); margin-bottom: 8px; transition: transform .2s; }
.shelf-cover img { width: 100%; height: 100%; object-fit: cover; }
.shelf-book:hover .shelf-cover { transform: translateY(-4px) rotate(-.5deg); }
.shelf-title { font-family: var(--serif); font-weight: 650; line-height: 1.25; }
.shelf-author { font-size: .88rem; color: var(--muted); }
.shelf-cta { font-size: .88rem; font-weight: 600; color: var(--accent-2); margin-top: 2px; }
@media (max-width: 960px) { .shelf { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .shelf { grid-template-columns: repeat(2, 1fr); gap: 16px; } }

/* Plans */
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.plan { border: 1px solid rgba(255, 255, 255, .25); border-radius: 18px; padding: 30px; }
.plan-main { background: #fff; color: #1d2422; border-color: #fff; }
.plan-main .btn { background: #14423c; border-color: #14423c; color: #fff; }
.plan-tag { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 600; color: #e5a465; margin-bottom: .4em; }
.plan-main .plan-tag { color: #a85f1c; }
.plan-price { font-family: var(--serif); font-size: 1.5rem; margin-bottom: .6em; }
.plan ul { padding-left: 1.1em; margin: 0 0 1.4em; }
.plan li { margin-bottom: .35em; }
@media (max-width: 760px) { .plans { grid-template-columns: 1fr; } }

/* Lists */
.ticks, .crosses { list-style: none; padding: 0; margin: 0; }
.ticks li, .crosses li { position: relative; padding: 12px 0 12px 36px; border-bottom: 1px solid var(--line); }
.ticks li::before, .crosses li::before { position: absolute; left: 4px; top: 12px; font-weight: 700; }
.ticks li::before { content: "\2713"; color: var(--accent-2); }
.crosses li::before { content: "\2715"; color: var(--warm); }

.callout { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.callout > div { max-width: 640px; }
.callout p { margin: 0; color: var(--ink-2); }

/* FAQ */
.faq { max-width: 820px; }
.faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq summary { cursor: pointer; font-weight: 600; padding: 14px 32px 14px 0; position: relative; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 10px; font-size: 1.4rem; color: var(--accent); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { color: var(--ink-2); }

/* Book list */
.book-list { display: flex; flex-direction: column; gap: 22px; }
.book-card { display: grid; grid-template-columns: 170px 1fr; gap: 28px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 24px; }
.book-cover { display: block; border-radius: 6px; overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 2 / 3; background: var(--paper-2); align-self: start; }
.book-cover img { width: 100%; height: 100%; object-fit: cover; }
.book-info h2 { font-size: 1.45rem; margin-bottom: .2em; }
.book-info h2 a { color: var(--ink); text-decoration: none; }
.book-info h2 a:hover { color: var(--accent); }
.book-author { color: var(--muted); margin-bottom: .8em; }
.book-desc { color: var(--ink-2); }
.book-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: .9em; }
.book-meta span { font-size: .82rem; background: var(--paper-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; color: var(--ink-2); }
.book-try { font-size: .95rem; color: var(--ink-2); }
.book-try q { font-style: italic; color: var(--ink); }
.book-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
@media (max-width: 620px) {
    .book-card { grid-template-columns: 1fr; padding: 18px; gap: 16px; }
    .book-cover { width: 140px; }
}
.note-box { margin-top: 40px; border: 1px dashed var(--line); border-radius: 18px; padding: 24px; background: var(--paper-2); }
.note-box h2 { font-size: 1.25rem; }
.note-box p { margin: 0; }
.empty { padding: 32px; background: var(--card); border-radius: 18px; border: 1px solid var(--line); }

/* Prose */
.prose h2 { font-size: 1.4rem; margin-top: 1.6em; }
.prose h2:first-child { margin-top: 0; }
.prose p { color: var(--ink-2); }

/* Forms */
.cb-form { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 26px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 620px) { .field-row { grid-template-columns: 1fr; gap: 0; } .cb-form { padding: 18px; } }
.field { display: block; margin-bottom: 16px; }
.field span { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.field small { font-weight: 400; color: var(--muted); }
.field input, .field textarea {
    width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
    background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px;
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent-2); outline-offset: 0; border-color: transparent; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; color: var(--ink-2); margin-bottom: 16px; }
.check input { margin-top: 4px; width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.form-msg { min-height: 1.4em; font-weight: 500; }
.form-msg.ok { color: var(--accent-2); }
.form-msg.err { color: #b3261e; }
@media (prefers-color-scheme: dark) { .form-msg.err { color: #ff8a80; } }
.form-done { text-align: center; padding: 30px 10px; }
.form-done h3 { font-size: 1.4rem; }

.contact-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: start; }
.contact-side { background: var(--paper-2); border: 1px solid var(--line); border-radius: 18px; padding: 24px; }
.contact-side h2 { font-size: 1.25rem; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }

/* Footer */
.site-foot { background: var(--paper-2); border-top: 1px solid var(--line); padding: 48px 0 20px; margin-top: 0; font-size: .94rem; }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 28px; }
.foot-grid a { display: block; color: var(--ink-2); text-decoration: none; padding: 3px 0; }
.foot-grid a:hover { color: var(--accent); text-decoration: underline; }
.foot-brand { font-family: var(--serif); font-size: 1.35rem; font-weight: 650; margin-bottom: .4em; }
.foot-brand span { font-family: var(--sans); font-size: .8rem; font-weight: 400; color: var(--muted); }
.foot-h { font-weight: 600; margin-bottom: .5em; }
.foot-base { border-top: 1px solid var(--line); margin-top: 32px; padding-top: 16px; font-size: .82rem; color: var(--muted); }
.foot-base p { margin: 0; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-grid > div:first-child { grid-column: 1 / -1; } }
