:root {
    --ink-strong: #162127;
    --ink-soft: #42535c;
    --surface: #f3ede3;
    --surface-strong: #d8c8b2;
    --accent: #0f6a62;
    --accent-warm: #cd7449;
    --line: rgba(22, 33, 39, 0.14);
    --shadow: 0 24px 60px rgba(18, 34, 41, 0.14);
    --max-width: 1200px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Space Grotesk", "Segoe UI", sans-serif;
    color: var(--ink-strong);
    background:
        radial-gradient(circle at top left, rgba(205, 116, 73, 0.18), transparent 32%),
        linear-gradient(180deg, #faf4ea 0%, #f2eee7 45%, #efe8db 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 42px 42px;
    opacity: 0.25;
    pointer-events: none;
}

a {
    color: inherit;
    text-decoration: none;
}

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

.page-shell {
    position: relative;
    min-height: 100vh;
    padding: 0 1.25rem 4rem;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1.1rem 0;
    transition: background-color 220ms ease, backdrop-filter 220ms ease, padding 220ms ease;
}

.site-header.is-scrolled {
    padding: 0.85rem 0;
    backdrop-filter: blur(18px);
}

.site-brand {
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.site-nav {
    display: flex;
    gap: 1.25rem;
    font-size: 0.95rem;
    color: var(--ink-soft);
}

.site-nav a:hover,
.site-nav a:focus-visible {
    color: var(--ink-strong);
}

.site-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.auth-chip {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 0.8rem;
    color: var(--ink-soft);
}

.auth-chip span {
    color: var(--ink-strong);
    font-weight: 700;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 999px;
    border: 1px solid transparent;
    padding: 0.95rem 1.4rem;
    font-weight: 700;
    transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

.button:hover,
.button:focus-visible {
    transform: translateY(-2px);
}

.button:disabled {
    opacity: 0.62;
    cursor: wait;
    transform: none;
}

.button-primary {
    background: var(--ink-strong);
    color: #fff9f2;
    box-shadow: var(--shadow);
}

.button-secondary {
    border-color: rgba(22, 33, 39, 0.18);
    background: rgba(255, 250, 243, 0.76);
}

.button-small {
    padding: 0.75rem 1.15rem;
    font-size: 0.92rem;
}

.hero-shell {
    position: relative;
    display: grid;
    align-items: stretch;
    max-width: var(--max-width);
    min-height: calc(100vh - 5.4rem);
    margin: 0 auto;
    padding: 2rem 0 3rem;
    overflow: hidden;
}

.hero-image-plane {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: 2.4rem;
    background: linear-gradient(135deg, rgba(22, 33, 39, 0.78), rgba(15, 106, 98, 0.68));
    box-shadow: var(--shadow);
}

.hero-image-plane::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 244, 228, 0.12), rgba(22, 33, 39, 0.12));
}

.hero-illustration {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.95;
    transform: scale(1.02);
    animation: drift 18s ease-in-out infinite alternate;
}

.hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    align-items: end;
    min-height: inherit;
    padding: clamp(2rem, 4vw, 4rem);
}

.hero-copy {
    max-width: 34rem;
    color: #fff7ee;
}

.eyebrow,
.section-label {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.75rem;
    font-weight: 700;
}

.brand-mark {
    margin: 0.25rem 0 0;
    font-family: "Fraunces", Georgia, serif;
    font-size: clamp(3rem, 8vw, 6rem);
    line-height: 0.95;
    letter-spacing: -0.05em;
}

.hero-title,
.dashboard-title,
.message-shell h1,
.focus-section h2 {
    margin: 0.85rem 0 0;
    font-family: "Fraunces", Georgia, serif;
    letter-spacing: -0.03em;
    line-height: 1.02;
}

.hero-title {
    font-size: clamp(2rem, 4.4vw, 3.35rem);
    max-width: 26rem;
}

.hero-support,
.dashboard-support,
.focus-section p,
.queue-item p,
.track-step p,
.message-shell p {
    color: inherit;
    line-height: 1.7;
    font-size: 1.02rem;
}

.hero-support {
    max-width: 30rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: 1.8rem;
}

.hero-footnote {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-top: 1.25rem;
    color: rgba(255, 247, 238, 0.82);
    font-size: 0.9rem;
}

.focus-section,
.dashboard-section,
.message-shell {
    max-width: var(--max-width);
    margin: 1.5rem auto 0;
    padding: 2rem 0;
}

.focus-section {
    display: grid;
    gap: 1.2rem;
    border-top: 1px solid var(--line);
}

.alt-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
}

.section-copy {
    max-width: 40rem;
}

.section-copy h2,
.dashboard-section h2 {
    font-size: clamp(1.85rem, 3vw, 2.65rem);
}

.dashboard-hero {
    display: grid;
    grid-template-columns: 1.7fr 0.9fr;
    gap: 1.5rem;
    max-width: var(--max-width);
    margin: 1rem auto 0;
    padding: 2rem 0 1rem;
    border-top: 1px solid var(--line);
}

.dashboard-title {
    font-size: clamp(2rem, 4vw, 3rem);
}

.dashboard-hero-console {
    align-items: start;
}

.console-stack {
    display: grid;
    gap: 1rem;
}

.console-shell,
.selector-shell {
    padding: 1.2rem 1.3rem;
}

.console-label {
    display: grid;
    gap: 0.55rem;
}

.console-label span {
    color: var(--ink-soft);
    font-size: 0.9rem;
}

.console-prompt-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.85rem;
    align-items: center;
}

.console-hint {
    margin: 0.85rem 0 0;
    color: var(--ink-soft);
    font-size: 0.93rem;
}

.dashboard-flash {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    max-width: var(--max-width);
    margin: 1rem auto 0;
    padding: 0.95rem 1.15rem;
    border-radius: 1.2rem;
    border: 1px solid var(--line);
    background: rgba(255, 250, 243, 0.86);
}

.dashboard-flash-success {
    border-color: rgba(15, 106, 98, 0.24);
    background: rgba(228, 244, 239, 0.92);
}

.dashboard-flash-warning {
    border-color: rgba(205, 116, 73, 0.25);
    background: rgba(255, 244, 236, 0.92);
}

.user-ribbon {
    align-self: end;
    padding: 1.3rem 1.4rem;
    border: 1px solid var(--line);
    border-radius: 1.6rem;
    background: rgba(255, 250, 243, 0.72);
}

.user-ribbon-label {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.7rem;
}

.dashboard-section-header {
    max-width: 38rem;
    margin-bottom: 1.25rem;
}

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

.queue-list.compact {
    gap: 0.9rem;
}

.queue-item,
.track-step {
    padding: 1.25rem 1.35rem;
    border: 1px solid var(--line);
    border-radius: 1.4rem;
    background: rgba(255, 250, 243, 0.78);
}

.queue-label {
    display: inline-block;
    margin-bottom: 0.45rem;
    color: var(--accent);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 700;
}

.queue-item h3,
.track-step h3 {
    margin: 0;
    font-size: 1.15rem;
}

.queue-status {
    display: inline-block;
    margin-top: 0.4rem;
    color: var(--accent-warm);
    font-weight: 700;
}

.queue-item-wide .queue-meta,
.inline-form {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.stack-form {
    margin-top: 1rem;
    flex-direction: column;
    align-items: stretch;
}

.queue-item .form-shell {
    margin-top: 0.9rem;
}

.queue-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.coverage-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.ask-coverage-item .queue-meta {
    align-items: center;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
}

.metric-tile {
    padding: 1.25rem 1.35rem;
    border: 1px solid var(--line);
    border-radius: 1.4rem;
    background: rgba(255, 250, 243, 0.78);
}

.metric-label {
    display: block;
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.72rem;
    font-weight: 700;
}

.metric-tile strong {
    display: block;
    margin-top: 0.45rem;
    font-family: "Fraunces", Georgia, serif;
    font-size: 2rem;
}

.form-shell {
    padding: 1.5rem;
    border: 1px solid var(--line);
    border-radius: 1.5rem;
    background: rgba(255, 250, 243, 0.82);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.form-shell label {
    display: grid;
    gap: 0.45rem;
    font-weight: 500;
}

.form-shell label span {
    color: var(--ink-soft);
    font-size: 0.9rem;
}

.suggest-wrap {
    position: relative;
}

.bookex-suggest-wrap input {
    width: 100%;
}

.suggestions {
    position: absolute;
    top: calc(100% + 0.45rem);
    left: 0;
    right: 0;
    z-index: 12;
    display: none;
    max-height: 18rem;
    overflow-y: auto;
    border: 1px solid rgba(22, 33, 39, 0.14);
    border-radius: 1rem;
    background: rgba(255, 251, 246, 0.98);
    box-shadow: 0 18px 40px rgba(18, 34, 41, 0.12);
}

.suggestion {
    padding: 0.8rem 0.95rem;
    cursor: pointer;
    transition: background-color 140ms ease, color 140ms ease;
}

.suggestion + .suggestion {
    border-top: 1px solid rgba(22, 33, 39, 0.08);
}

.suggestion:hover,
.suggestion.is-active {
    background: rgba(15, 106, 98, 0.1);
    color: var(--ink-strong);
}

.form-shell input,
.form-shell select,
.form-shell textarea,
.inline-form input,
.inline-form select {
    width: 100%;
    border: 1px solid rgba(22, 33, 39, 0.16);
    border-radius: 0.95rem;
    background: rgba(255, 255, 255, 0.75);
    padding: 0.8rem 0.95rem;
    font: inherit;
    color: var(--ink-strong);
}

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

.compact-form + .compact-form,
.form-stack {
    margin-top: 1rem;
}

.validation-summary-errors {
    margin-bottom: 1rem;
    color: #8a2d1d;
    font-weight: 700;
}

.split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
}

.workflow-track {
    display: grid;
    gap: 1rem;
}

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

.track-meter {
    width: 100%;
    height: 0.6rem;
    margin-top: 1rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(22, 33, 39, 0.08);
}

.track-meter-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), var(--accent-warm));
}

.narrow {
    max-width: 42rem;
}

[data-reveal] {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 600ms ease, transform 600ms ease;
}

[data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes drift {
    from {
        transform: scale(1.02) translate3d(0, 0, 0);
    }
    to {
        transform: scale(1.08) translate3d(-1.5%, 1.5%, 0);
    }
}

@media (max-width: 960px) {
    .dashboard-hero,
    .alt-grid,
    .split,
    .metric-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .site-header {
        flex-wrap: wrap;
    }

    .site-actions,
    .site-nav {
        width: 100%;
        justify-content: space-between;
    }

    .queue-item-wide .queue-meta,
    .inline-form {
        flex-direction: column;
    }

    .console-prompt-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .page-shell {
        padding: 0 0.95rem 3rem;
    }

    .hero-shell {
        min-height: 84vh;
    }

    .hero-image-plane {
        border-radius: 1.7rem;
    }

    .site-nav {
        gap: 0.8rem;
        font-size: 0.88rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .button,
    .button-small {
        width: 100%;
    }

    .auth-chip {
        align-items: flex-start;
    }
}
