/* ExpertPage design system (Milestone 32.6).
   One stylesheet for every page — runtime and Studio. Plain CSS, no build
   step, no external fonts. Clean, modern, credible; nothing clever. */

:root {
    /* Color scheme: near-black ink on a soft gray page, white surfaces,
       a confident indigo primary, and quiet semantic tones. */
    --ink: #171a21;
    --muted: #5b6472;
    --bg: #f5f6f8;
    --surface: #ffffff;
    --border: #e3e6eb;

    /* Navy & gold theme: navy for structure and links, gold for actions. */
    --primary: #1d3a6e;
    --primary-hover: #14213d;
    --primary-soft: #e9eef8;
    --accent: #fca311;
    --accent-hover: #e79408;
    --accent-ink: #14213d;

    --ok-ink: #22713a;
    --ok-soft: #e9f6ee;
    --warn-ink: #8a6d00;
    --warn-soft: #fdf3d0;
    --danger-ink: #b00020;
    --danger-soft: #fbeaec;

    --radius: 10px;
    --shadow: 0 1px 2px rgba(23, 26, 33, 0.06);
}

/* ----- base ---------------------------------------------------------------- */

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
}

.container {
    max-width: 880px;
    margin: 0 auto;
    padding: 0 20px;
}

.page { padding: 28px 20px 48px; }

h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 8px; }
h2 { font-size: 1.15rem; margin: 28px 0 10px; }
h3 { font-size: 1rem; margin: 20px 0 6px; }

/* Demo mode: sample Q&A rendered as a chat conversation, so it is
   unmistakable which is the question and which is the answer. Questions sit
   right (like a message you sent); answers sit left (like a reply), each
   fading/sliding in on load — pure CSS, no JavaScript. */
.demo-chat { margin: 14px 0 8px; display: flex; flex-direction: column; }

.demo-bubble {
    max-width: 78%;
    border-radius: 14px;
    padding: 10px 14px;
    margin: 6px 0;
    font-size: 0.95rem;
    line-height: 1.5;
    /* Long emails/URLs in an answer must wrap, never force sideways scroll. */
    overflow-wrap: anywhere;
    opacity: 0;
    animation: demo-bubble-in 0.45s ease forwards;
}

/* The message text keeps its own paragraph breaks (LLM answers arrive as
   plain text with newlines); pre-line turns them into line breaks instead of
   collapsing everything into one wall of text. */
.demo-bubble-text { display: block; white-space: pre-line; }

.demo-bubble-label {
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 3px;
    opacity: 0.75;
}

.demo-bubble-q {
    align-self: flex-end;
    background: var(--primary-soft);
    color: var(--primary);
    border-bottom-right-radius: 4px;
}

.demo-bubble-a {
    align-self: flex-start;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    border-bottom-left-radius: 4px;
}

@keyframes demo-bubble-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .demo-bubble { animation: none; opacity: 1; }
}

/* Signed-out hint beside the Ask button: asking is real, sign-in comes at
   the moment of submitting, not before. */
.ask-signin-hint { margin-left: 10px; font-size: 0.85rem; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

p.lede, .muted { color: var(--muted); }

pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    font-size: 0.9rem;
}

/* ----- header & footer ----------------------------------------------------- */

.site-header {
    /* The brand bar: deep navy with a gold wordmark. */
    background: #14213d;
    border-bottom: 1px solid #0e1830;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 14px;
    padding-bottom: 14px;
}

.brand {
    /* Masthead wordmark: a serif display stack (no external fonts) set
       against the sans body gives it a distinct, editorial character. */
    font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
        "Times New Roman", serif;
    font-weight: 700;
    font-size: 1.55rem;
    color: var(--accent);
    letter-spacing: -0.01em;
    line-height: 1.2;
}
.brand:hover { text-decoration: none; color: #ffd166; }

.site-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.92rem;
}
.site-nav a { color: rgba(255, 255, 255, 0.8); }
.site-nav a:hover { color: #fca311; text-decoration: none; }
.nav-user { color: rgba(255, 255, 255, 0.55); }

.site-footer {
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.85rem;
    padding: 20px 0 32px;
}

/* ----- buttons ------------------------------------------------------------- */

button, .btn {
    display: inline-block;
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 600;
    border: 1px solid var(--accent);
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
}
button:hover, .btn:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    text-decoration: none;
    color: var(--accent-ink);
}

.btn-secondary, table button, .actions button {
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--border);
}
.btn-secondary:hover, table button:hover, .actions button:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
    color: var(--primary);
}

table button, .actions button { padding: 4px 10px; font-size: 0.85rem; }

/* ----- forms --------------------------------------------------------------- */

label { font-weight: 600; font-size: 0.92rem; }

input[type="text"], input[type="email"], input[type="url"],
input[type="number"], textarea {
    width: 100%;
    max-width: 560px;
    padding: 9px 12px;
    margin-top: 4px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}
textarea { max-width: 100%; }
input:focus, textarea:focus {
    outline: 2px solid var(--primary-soft);
    border-color: var(--primary);
}

form p { margin: 14px 0; }

/* ----- cards & lists ------------------------------------------------------- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 20px;
    margin: 14px 0;
}

.expert-list { list-style: none; padding: 0; margin: 16px 0; }
.expert-list li {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 20px;
    margin-bottom: 12px;
}
.expert-list a { font-weight: 600; font-size: 1.05rem; }
.expert-list .desc { color: var(--muted); margin: 4px 0 0; }

/* ----- tables -------------------------------------------------------------- */

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    font-size: 0.92rem;
}
th, td {
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
th {
    background: var(--bg);
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
tr:last-child td { border-bottom: none; }

.table-scroll { overflow-x: auto; }

/* ----- badges & banners ---------------------------------------------------- */

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    background: var(--bg);
    color: var(--muted);
    border: 1px solid var(--border);
    vertical-align: middle;
}
.badge-published { background: var(--ok-soft); color: var(--ok-ink); border-color: transparent; }
.badge-review { background: var(--warn-soft); color: var(--warn-ink); border-color: transparent; }
.badge-edited { background: var(--warn-soft); color: var(--warn-ink); border-color: transparent; }

.banner {
    border-radius: var(--radius);
    padding: 12px 16px;
    margin: 14px 0;
    background: var(--primary-soft);
    white-space: pre-wrap;
}
.banner-ok { background: var(--ok-soft); color: var(--ok-ink); }
.banner-warn { background: var(--warn-soft); color: var(--warn-ink); }
.banner-error { background: var(--danger-soft); color: var(--danger-ink); }

/* ----- studio flow nav ----------------------------------------------------- */

.subnav {
    color: var(--muted);
    font-size: 0.9rem;
    margin: 0 0 6px;
}
.subnav a { color: var(--muted); }
.subnav a:hover { color: var(--primary); }

.kicker {
    color: var(--muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 4px;
}

/* ----- chat / answer ------------------------------------------------------- */

.answer-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius);
    padding: 16px 18px;
    white-space: pre-wrap;
}

.lock-box {
    background: var(--warn-soft);
    border-radius: var(--radius);
    padding: 16px 18px;
    max-width: 520px;
}
.lock-box p:first-child { margin-top: 0; }
.lock-box p:last-child { margin-bottom: 0; }

/* ----- legal pages & disclaimer (Milestone 34) ------------------------------ */

.legal { max-width: 720px; }
.legal h2 { margin-top: 26px; }
.legal li { margin-bottom: 8px; }

.disclaimer {
    color: var(--muted);
    font-size: 0.82rem;
    margin-top: 8px;
}

.footer-links { margin-left: 10px; }
.footer-links a { color: var(--muted); }

/* ----- landing page (Milestone 33.7) ---------------------------------------- */

.hero {
    text-align: center;
    padding: 10px 0 40px;
}

.hero-title {
    font-size: 2.5rem;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 0 0 16px;
}

.hero-sub {
    font-size: 1.15rem;
    color: var(--muted);
    max-width: 560px;
    margin: 0 auto 26px;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 10px;
}

.hero-note { font-size: 0.88rem; }

.btn-large {
    padding: 12px 24px;
    font-size: 1.05rem;
    border-radius: 10px;
}

.section-title {
    text-align: center;
    font-size: 1.4rem;
    margin: 48px 0 22px;
}

/* A CSS-only mockup of an expert page: browser chrome + URL + mini profile. */
.hero-mocks {
    /* A horizontal slider (pure CSS scroll-snap, no JavaScript): each mockup
       is wide enough to show its FULL URL; about two fit in view and the
       third peeks in from the right, inviting a swipe/scroll. */
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    /* No visible scrollbar: the third card peeking in from the right is the
       slide affordance; the bar itself is just clutter. */
    scrollbar-width: none;
    padding: 4px 2px 12px;
    margin: 24px 0 18px;
}

.hero-mocks::-webkit-scrollbar { display: none; }

.browser-mock {
    flex: 0 0 400px;
    scroll-snap-align: center;
    margin: 0;
    background: var(--surface);
    border: 1px solid rgba(20, 33, 61, 0.14);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(10, 14, 25, 0.22);
    overflow: hidden;
    text-align: left;
}

.browser-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(180deg, #1b2f57, #142544);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 9px 12px;
}

.browser-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
}

.browser-url {
    margin-left: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    padding: 3px 12px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.75);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.browser-url strong { color: var(--accent); }

.browser-body { padding: 16px 18px 18px; }
.mock-kicker {
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 2px;
}
.mock-title { margin: 0 0 4px; font-size: 1.12rem; }
.mock-desc { margin: 0 0 12px; color: var(--muted); font-size: 0.87rem; }

.mock-ask {
    display: flex;
    gap: 8px;
    align-items: center;
}
.mock-input {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 0.85rem;
    color: var(--muted);
    background: var(--bg);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mock-btn {
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 600;
    border-radius: 8px;
    padding: 9px 16px;
    font-size: 0.85rem;
}

.hero-tagline { margin: 12px 0 0; font-size: 1.08rem; }

.steps-two {
    grid-template-columns: repeat(2, 1fr);
    max-width: 720px;
    margin: 0 auto 14px;
}

.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.step {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
}
.step h3 { margin: 12px 0 6px; }
.step p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.step-number {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.feature { margin: 0; }
.feature h3 { margin: 0 0 6px; }
.feature p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.vision-quote {
    text-align: center;
    max-width: 620px;
    margin: 56px auto;
    font-size: 1.2rem;
    line-height: 1.5;
    color: var(--ink);
    border-left: 3px solid var(--primary);
    padding-left: 20px;
    text-align: left;
}

.cta-band {
    text-align: center;
    background: var(--primary-hover);
    color: #fff;
    border-radius: var(--radius);
    padding: 36px 24px;
    margin: 24px 0 8px;
}
.cta-band h2 { margin: 0 0 16px; color: #fff; }
.cta-band p { margin: 0; }

/* ----- small screens ------------------------------------------------------- */

@media (max-width: 600px) {
    .page { padding-top: 18px; }
    h1 { font-size: 1.35rem; }
    th, td { padding: 8px 10px; }
    .header-inner { padding-top: 10px; padding-bottom: 10px; }
    .hero { padding-top: 6px; }
    .hero-title { font-size: 1.7rem; }
    .steps, .steps-two, .feature-grid { grid-template-columns: 1fr; }
    /* One mockup per view on phones; the next card peeks in to invite a swipe. */
    .browser-mock { flex-basis: 86%; }
    /* Full URLs matter more than window-chrome decoration on small screens:
       drop the dots and let the URL wrap instead of truncating. */
    .browser-dot { display: none; }
    .browser-url {
        margin-left: 0;
        white-space: normal;
        overflow-wrap: anywhere;
        text-overflow: clip;
        line-height: 1.35;
    }
    /* Chat bubbles use nearly the full width on phones — 78% of a small
       screen makes long answers needlessly tall and cramped. */
    .demo-bubble { max-width: 94%; }
    /* 16px stops iOS Safari from auto-zooming when the ask box is tapped. */
    input[type="text"], input[type="email"], input[type="url"],
    input[type="number"], textarea { font-size: 16px; }
}
