/* ============================================================
   landing.css
   Marketing surface (home / pricing / docs) + auth-card layout
   for login & register. Loaded only on those pages via
   {% block stylesheets %} so the authenticated app stays small.
   ============================================================ */

/* --- Hero --------------------------------------------------- */

.hero {
    position: relative;
    text-align: center;
    padding: var(--space-16) var(--space-4) var(--space-10);
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 800px 360px at 50% 0%, var(--accent-soft), transparent 70%),
        radial-gradient(ellipse 600px 240px at 50% 100%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%);
    z-index: -1;
    opacity: .9;
}
.hero h1 {
    font-size: clamp(36px, 7vw, 60px);
    line-height: 1.05;
    letter-spacing: -0.025em;
    margin: 0 auto var(--space-4);
    max-width: 16ch;
    background: linear-gradient(180deg, var(--fg), color-mix(in srgb, var(--fg) 65%, transparent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
html[data-theme="dark"] .hero h1,
html[data-theme="auto"] .hero h1 {
    background: linear-gradient(180deg, #ffffff, color-mix(in srgb, #ffffff 60%, transparent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero .lede {
    font-size: clamp(16px, 2.4vw, 19px);
    color: var(--fg-muted);
    max-width: 56ch;
    margin: 0 auto var(--space-6);
    line-height: 1.55;
}
.hero .cta {
    display: inline-flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    justify-content: center;
}
.hero-meta {
    margin-top: var(--space-5);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3) var(--space-5);
    justify-content: center;
    font-size: var(--text-xs);
    color: var(--fg-subtle);
}
.hero-meta span { display: inline-flex; align-items: center; gap: 4px; }

/* Live demo block — a tasteful hero accessory: terminal-styled curl
   command + the actual badge SVG it would produce. */
.hero-demo {
    margin: var(--space-8) auto 0;
    max-width: 720px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-2);
    box-shadow: var(--shadow-lg);
    text-align: left;
}
.hero-demo .demo-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px var(--space-3);
}
.hero-demo .demo-bar i {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--surface-2);
}
.hero-demo .demo-bar i:nth-child(1) { background: #f87171; }
.hero-demo .demo-bar i:nth-child(2) { background: #fbbf24; }
.hero-demo .demo-bar i:nth-child(3) { background: #34d399; }
.hero-demo .demo-bar .demo-title {
    margin-left: auto;
    color: var(--fg-subtle);
    font-size: 11px;
    font-family: var(--font-mono);
}
.hero-demo pre {
    border: 0;
    background: transparent;
    padding: 0 var(--space-4) var(--space-4);
    font-size: var(--text-sm);
    line-height: 1.55;
}
.hero-demo .demo-prompt { color: var(--accent); user-select: none; }
.hero-demo .demo-output {
    border-top: 1px solid var(--border);
    padding: var(--space-3) var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--fg-muted);
    font-size: var(--text-xs);
    font-family: var(--font-mono);
}

/* --- Section headers --------------------------------------- */

.section { padding: var(--space-16) 0; }
.section-narrow { padding: var(--space-12) 0; }
.section-eyebrow {
    display: inline-block;
    color: var(--accent);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: var(--space-3);
}
.section-title {
    font-size: clamp(22px, 4vw, 36px);
    line-height: 1.15;
    letter-spacing: -0.025em;
    margin-bottom: var(--space-3);
}
.section-lead {
    color: var(--fg-muted);
    font-size: var(--text-md);
    max-width: 60ch;
    margin: 0 0 var(--space-8);
}
.section-head {
    text-align: center;
    margin: 0 auto var(--space-10);
    max-width: 60ch;
}
.section-head .section-lead { margin: 0 auto; }

/* --- How it works (3-step strip) --------------------------- */

.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-5);
    counter-reset: step;
}
.step {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-sm), var(--inset-edge);
    position: relative;
}
.step::before {
    counter-increment: step;
    content: counter(step, decimal-leading-zero);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
    margin-bottom: var(--space-3);
}
.step h3 { font-size: var(--text-md); margin-bottom: 6px; }
.step p { margin: 0; color: var(--fg-muted); font-size: var(--text-sm); }
@media (max-width: 720px) {
    .steps { grid-template-columns: 1fr; }
}

/* --- Feature grid ------------------------------------------ */

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
}
.feature {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-sm), var(--inset-edge);
    transition: border-color .12s ease, transform .12s ease;
}
.feature:hover {
    border-color: var(--border-strong);
    transform: translateY(-1px);
}
.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: var(--accent-soft);
    color: var(--accent);
    margin-bottom: var(--space-3);
}
.feature h3 {
    font-size: var(--text-md);
    margin: 0 0 6px;
    letter-spacing: -0.01em;
}
.feature p {
    margin: 0;
    color: var(--fg-muted);
    font-size: var(--text-sm);
    line-height: 1.55;
}
.feature p code {
    font-size: 12px;
    padding: 1px 4px;
}
@media (max-width: 880px) {
    .feature-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 540px) {
    .feature-grid { grid-template-columns: 1fr; }
}

/* --- Code tabs (hero or anywhere) -------------------------- */

.code-card {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.code-card .code-tabs-bar {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}
.code-card pre {
    border: 0;
    border-radius: 0;
    background: var(--bg-elev);
    padding: var(--space-4) var(--space-5);
    font-size: var(--text-sm);
}
.code-card .copy-btn { top: 14px; right: 14px; }

/* No-JS fallback: stack tab panes vertically with a small label.
   `.js` is added to <html> by app.js when it boots. */
html:not(.js) .code-card .tab-pane { display: block !important; }
html:not(.js) .code-card .tab-pane::before {
    content: attr(data-label);
    display: block;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--fg-subtle);
    padding: 6px var(--space-5) 0;
}
html:not(.js) .code-card .code-tabs-bar { display: none; }
html.js .code-card .tab-pane[hidden] { display: none; }

/* --- Pricing ----------------------------------------------- */

.price-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
    align-items: stretch;
}
.price-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    box-shadow: var(--shadow-sm), var(--inset-edge);
    position: relative;
}
.price-card.is-featured {
    border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent), var(--shadow);
}
.price-card .featured-badge {
    position: absolute;
    top: -10px;
    right: 16px;
    background: var(--accent);
    color: var(--accent-fg);
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.price-card .plan-name {
    font-size: var(--text-md);
    font-weight: 600;
}
.price-card .plan-price {
    font-size: 36px;
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1;
}
.price-card .plan-price small {
    font-size: 13px;
    font-weight: 500;
    color: var(--fg-muted);
}
.price-card .plan-quota {
    color: var(--fg-muted);
    font-size: var(--text-sm);
}
.price-card .plan-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}
.price-card .plan-features li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: var(--text-sm);
    color: var(--fg-muted);
}
.price-card .plan-features li svg {
    color: var(--success);
    flex-shrink: 0;
    margin-top: 2px;
}
.price-card .btn { margin-top: var(--space-2); }

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

/* --- FAQ --------------------------------------------------- */

.faq {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3) var(--space-6);
}
.faq details {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    padding: var(--space-3) var(--space-4);
}
.faq summary {
    cursor: pointer;
    font-weight: 500;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
    content: '+';
    font-family: var(--font-mono);
    color: var(--fg-subtle);
    transition: transform .15s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p { color: var(--fg-muted); font-size: var(--text-sm); margin: var(--space-3) 0 0; }
@media (max-width: 720px) { .faq { grid-template-columns: 1fr; } }

/* --- Docs page (sticky-TOC two-column) --------------------- */

.docs-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: var(--space-12);
    margin-top: var(--space-6);
}
.docs-content {
    min-width: 0;
    max-width: 760px;
}
.docs-content h2 {
    margin-top: var(--space-10);
    padding-top: var(--space-6);
    border-top: 1px solid var(--border);
    scroll-margin-top: 80px;
}
.docs-content h2:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}
.docs-content h3 { margin-top: var(--space-6); scroll-margin-top: 80px; }
.docs-content p, .docs-content ul, .docs-content ol { color: var(--fg); font-size: var(--text-md); line-height: 1.65; }
.docs-content ul, .docs-content ol { padding-left: var(--space-5); }
.docs-content code { font-size: 13px; }
.docs-content pre { font-size: var(--text-sm); margin: var(--space-3) 0; }
.docs-content table { margin: var(--space-3) 0; }
.docs-content blockquote {
    border-left: 2px solid var(--accent);
    background: var(--accent-soft);
    color: var(--fg);
    padding: var(--space-3) var(--space-4);
    border-radius: 0 var(--radius) var(--radius) 0;
    margin: var(--space-4) 0;
}

.docs-toc {
    position: sticky;
    top: 80px;
    align-self: flex-start;
    font-size: var(--text-sm);
}
.docs-toc h5 {
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--fg-subtle);
    margin: 0 0 var(--space-3);
}
.docs-toc ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.docs-toc a {
    color: var(--fg-muted);
    border-left: 2px solid transparent;
    padding: 2px var(--space-3);
    margin-left: -2px;
    display: block;
    line-height: 1.4;
}
.docs-toc a:hover { color: var(--fg); text-decoration: none; }
.docs-toc a.is-current { color: var(--fg); border-left-color: var(--accent); }
.docs-toc ul ul { margin-top: 4px; padding-left: var(--space-3); }

@media (max-width: 880px) {
    .docs-layout { grid-template-columns: 1fr; }
    .docs-toc { position: static; margin-bottom: var(--space-6); padding-bottom: var(--space-4); border-bottom: 1px solid var(--border); }
}

/* --- Auth (login / register) ------------------------------- */

main.auth-shell {
    min-height: calc(100vh - 56px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-10) var(--space-4);
}
.auth-card {
    width: 100%;
    max-width: 380px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-8) var(--space-6);
    box-shadow: var(--shadow-lg), var(--inset-edge);
}
.auth-card .auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-bottom: var(--space-6);
    color: var(--fg);
}
.auth-card .auth-brand .brand-mark { color: var(--accent); }
.auth-card h1 {
    text-align: center;
    margin: 0 0 var(--space-2);
    font-size: var(--text-xl);
}
.auth-card .auth-sub {
    text-align: center;
    color: var(--fg-muted);
    font-size: var(--text-sm);
    margin: 0 0 var(--space-5);
}
.auth-card .form-actions {
    margin-top: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.auth-card .form-actions .btn { width: 100%; }
.auth-card .auth-aside {
    text-align: center;
    margin-top: var(--space-5);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border);
    color: var(--fg-muted);
    font-size: var(--text-sm);
}

/* --- Final CTA strip --------------------------------------- */

.cta-strip {
    background: linear-gradient(180deg, var(--surface), var(--surface-2));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-10) var(--space-6);
    text-align: center;
    margin: var(--space-12) 0 var(--space-8);
}
.cta-strip h2 {
    font-size: clamp(22px, 3.5vw, 32px);
    margin-bottom: var(--space-3);
}
.cta-strip p { color: var(--fg-muted); margin: 0 auto var(--space-5); max-width: 50ch; }
