/* assets/css/site.css
 *
 * Shared styles for spondulix.ai: the brochure pages (home, about,
 * contact, legal) and the API documentation.  Mirrors the design of the
 * application at app.spondulix.ai so the two read as one product.
 *
 * Palette
 *   navy       #0B1F3D   navy-deep  #061529
 *   sky        #86C3FA   sky-deep   #3D8FE0
 *   ink        #14213d   muted      #5b6577
 *   surface    #f5f8fc   line       #e6ebf2
 */

:root {
    --navy: #0B1F3D;
    --navy-deep: #061529;
    --sky: #86C3FA;
    --sky-deep: #3D8FE0;
    --ink: #14213d;
    --muted: #5b6577;
    --surface: #f5f8fc;
    --line: #e6ebf2;
    --mono: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

html, body {
    height: 100%;
    margin: 0;
}

body {
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
    letter-spacing: -0.02em;
    font-weight: 700;
}

.page-wrapper {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

.content {
    flex: 1;
}

/* ---- shared header ------------------------------------------------- */

.site-nav {
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
}

.site-nav .nav-link {
    color: #3c4658;
    font-weight: 500;
    padding-left: 0.9rem;
    padding-right: 0.9rem;
}

.site-nav .nav-link:hover,
.site-nav .nav-link.active {
    color: var(--navy);
}

.site-nav .btn-primary {
    --bs-btn-bg: var(--navy);
    --bs-btn-border-color: var(--navy);
    --bs-btn-hover-bg: #123a6b;
    --bs-btn-hover-border-color: #123a6b;
    --bs-btn-active-bg: var(--navy-deep);
    --bs-btn-active-border-color: var(--navy-deep);
}

.brand-mark {
    width: 34px;
    height: 34px;
}

.brand-name {
    margin-left: 0.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--navy);
}

/* ---- shared footer ------------------------------------------------- */

footer {
    margin-top: auto;
}

.site-footer {
    background: var(--navy);
    color: rgba(255, 255, 255, 0.75);
    padding: 3.5rem 0 2rem;
    font-size: 0.95rem;
}

.site-footer .brand-name {
    color: #fff;
}

/* The mark is navy on navy here; render it as a white silhouette */
.site-footer .brand-mark {
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.site-footer .footer-tagline {
    color: rgba(255, 255, 255, 0.6);
    max-width: 22rem;
}

.site-footer .footer-heading {
    color: #fff;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.site-footer .footer-links li {
    margin-bottom: 0.5rem;
}

.site-footer a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
}

.site-footer a:hover {
    color: #fff;
    text-decoration: underline;
    text-decoration-color: var(--sky);
}

.site-footer .footer-bottom {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Page-content links: animated underline, scoped so the header, footer,
   buttons and nav links keep their own styling. */
main a:not(.btn):not(.nav-link):not(.contact-card):not(.docs-nav-link):not(.card-link) {
    color: #0d6efd;
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
}

main a:not(.btn):not(.nav-link):not(.contact-card):not(.docs-nav-link):not(.card-link):hover {
    color: #0a58ca;
}

main a:not(.btn):not(.nav-link):not(.contact-card):not(.docs-nav-link):not(.card-link)::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    bottom: 0;
    left: 0;
    background-color: #0a58ca;
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease;
}

main a:not(.btn):not(.nav-link):not(.contact-card):not(.docs-nav-link):not(.card-link):hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* ---- hero ---------------------------------------------------------- */

.hero {
    position: relative;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy) 55%, #123a6b 100%);
    padding: 5.5rem 0 6rem;
}

.hero::before {
    content: '';
    position: absolute;
    width: 60rem;
    height: 60rem;
    top: -30rem;
    right: -20rem;
    background: radial-gradient(closest-side, rgba(134, 195, 250, 0.28), rgba(134, 195, 250, 0));
    pointer-events: none;
}

.hero .container {
    position: relative;
}

.eyebrow {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--sky);
    margin-bottom: 1rem;
}

.hero-title {
    font-size: clamp(2.4rem, 5vw, 3.6rem);
    line-height: 1.1;
    margin-bottom: 1.25rem;
}

.hero-lead {
    font-size: 1.2rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.82);
    max-width: 34rem;
}

.hero-note {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

.hero .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.5);
}

.hero .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
}

/* The mock search result card in the hero */
.demo-card {
    background: #fff;
    color: var(--ink);
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: 0 30px 60px -20px rgba(6, 21, 41, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.06);
    transform: rotate(-1deg);
    max-width: 34rem;
    margin-left: auto;
}

@media (max-width: 991.98px) {
    .demo-card {
        transform: none;
        margin: 0 auto;
    }
}

.demo-search {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: var(--surface);
    border: 1px solid #dbe4f0;
    border-radius: 0.75rem;
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    line-height: 1.4;
    margin-bottom: 1rem;
}

.demo-search .bi {
    color: var(--sky-deep);
    font-size: 1.1rem;
    margin-top: 0.1rem;
}

.demo-query {
    color: var(--ink);
}

.demo-result {
    padding: 0.85rem 0.25rem;
    border-top: 1px solid #edf1f7;
}

.demo-result:first-child {
    border-top: 0;
}

.demo-result-main {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 0.4rem;
}

.demo-title {
    font-weight: 600;
}

.demo-meta {
    font-size: 0.8rem;
    color: var(--muted);
    white-space: nowrap;
}

.demo-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.demo-tag {
    font-size: 0.72rem;
    font-weight: 500;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: #e8f2fd;
    color: #1f5da6;
}

.demo-tag.lyric {
    background: #eef9f0;
    color: #1f7a3c;
}

.demo-footer {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #edf1f7;
    font-size: 0.78rem;
    color: var(--muted);
}

/* ---- sections ------------------------------------------------------ */

.section {
    padding: 5rem 0;
}

.section-alt {
    background: var(--surface);
}

.section-heading {
    max-width: 40rem;
    margin: 0 auto 3rem;
    text-align: center;
}

.section-heading h2 {
    font-size: clamp(1.8rem, 3.5vw, 2.4rem);
    margin-bottom: 0.75rem;
}

.section-heading p {
    color: var(--muted);
    font-size: 1.1rem;
    margin-bottom: 0;
}

.feature-card {
    height: 100%;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 1rem;
    padding: 1.75rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px -20px rgba(11, 31, 61, 0.35);
}

.feature-card h3 {
    font-size: 1.15rem;
    margin: 1rem 0 0.5rem;
}

.feature-card p {
    color: var(--muted);
    margin-bottom: 0;
    line-height: 1.6;
}

.feature-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--navy), #1f4f8f);
    color: var(--sky);
    font-size: 1.35rem;
}

.step {
    height: 100%;
    padding: 0 0.5rem;
}

.step h3 {
    font-size: 1.15rem;
    margin: 1rem 0 0.5rem;
}

.step p {
    color: var(--muted);
    margin-bottom: 0;
    line-height: 1.6;
}

.step-number {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--navy);
    color: #fff;
    font-weight: 700;
}

.query-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    max-width: 60rem;
    margin: 0 auto;
}

.query-chip {
    padding: 0.6rem 1.1rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #dbe4f0;
    color: var(--ink);
    font-size: 0.95rem;
    box-shadow: 0 1px 2px rgba(11, 31, 61, 0.05);
}

/* Developer section: copy on the left, a code card on the right */
.dev-copy h2 {
    font-size: clamp(1.8rem, 3.5vw, 2.4rem);
    margin-bottom: 1rem;
}

.dev-copy p {
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.6;
}

.dev-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.dev-list li {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.dev-list .bi {
    color: var(--sky-deep);
    margin-top: 0.15rem;
}

.code-card {
    background: var(--navy-deep);
    border-radius: 1rem;
    box-shadow: 0 30px 60px -25px rgba(6, 21, 41, 0.6);
    overflow: hidden;
}

.code-card-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-family: var(--mono);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.55);
}

.code-card-dots span {
    display: inline-block;
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    margin-right: 0.35rem;
}

.code-card .highlight {
    margin: 0;
    border-radius: 0;
    box-shadow: none;
}

.cta-band {
    background: linear-gradient(135deg, var(--navy) 0%, #123a6b 100%);
    color: #fff;
    padding: 4rem 0;
}

.cta-band h2 {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.cta-band p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.05rem;
    max-width: 40rem;
}

/* ---- content pages (about, contact, legal) ------------------------- */

.content-page {
    max-width: 52rem;
}

.content-page h1 {
    font-size: 2.25rem;
    margin-bottom: 1.5rem;
}

.content-page h2,
.content-page h3 {
    margin-top: 2rem;
}

.content-page h2 {
    font-size: 1.5rem;
}

.content-page h3 {
    font-size: 1.2rem;
}

.content-page p,
.content-page li {
    line-height: 1.7;
}

.content-page .lead {
    color: var(--muted);
    font-size: 1.2rem;
}

.content-page em:first-child {
    color: var(--muted);
}

.contact-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    color: var(--ink);
    text-decoration: none;
    transition: box-shadow 0.15s ease;
}

.contact-card:hover {
    color: var(--ink);
    box-shadow: 0 12px 30px -18px rgba(11, 31, 61, 0.35);
}

.contact-card .bi {
    font-size: 1.5rem;
    color: var(--sky-deep);
}

.contact-card strong {
    display: block;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ---- API documentation --------------------------------------------- */

.docs-shell {
    display: flex;
    flex: 1;
}

.docs-sidebar {
    flex: 0 0 17rem;
    width: 17rem;
    border-right: 1px solid var(--line);
    background: var(--surface);
}

@media (min-width: 768px) {
    .docs-sidebar {
        position: sticky;
        top: 4.05rem;                /* height of the sticky header */
        height: calc(100vh - 4.05rem);
        overflow-y: auto;
    }
}

.docs-sidebar .offcanvas-body {
    padding: 1.5rem 1.25rem 2rem;
}

.docs-nav-title {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--navy);
    margin-bottom: 1rem;
}

.docs-nav-section {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 1.5rem 0 0.5rem;
}

.docs-nav-link {
    display: block;
    padding: 0.4rem 0.75rem;
    margin: 0 -0.75rem 0.15rem;
    border-radius: 0.5rem;
    color: #3c4658;
    text-decoration: none;
    font-size: 0.95rem;
    transition: background 0.15s ease, color 0.15s ease;
}

.docs-nav-link:hover {
    background: #e9f0fa;
    color: var(--navy);
}

.docs-nav-link.active {
    background: var(--navy);
    color: #fff;
    font-weight: 500;
}

.docs-toggle {
    border-bottom: 1px solid var(--line);
    background: #fff;
}

.docs-main {
    flex: 1;
    min-width: 0;
    padding: 2.5rem 1.5rem 4rem;
}

@media (min-width: 992px) {
    .docs-main {
        padding: 3rem 3.5rem 5rem;
    }
}

.docs-content {
    max-width: 58rem;
}

.docs-content h1 {
    font-size: 2.25rem;
    margin-bottom: 0.75rem;
}

.docs-content h1 + p {
    color: var(--muted);
    font-size: 1.1rem;
    line-height: 1.6;
}

.docs-content h2 {
    font-size: 1.5rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--line);
}

.docs-content h3 {
    font-size: 1.2rem;
    margin-top: 2rem;
}

.docs-content h4 {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
}

.docs-content p,
.docs-content li {
    line-height: 1.7;
}

.docs-content li {
    margin-bottom: 0.25rem;
}

/* Endpoint headings, written in markdown as
     ### GET /api/v1/...
     {: .endpoint-header .get-endpoint}                                  */
.docs-content .endpoint-header {
    font-family: var(--mono);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 4px solid var(--navy);
    border-radius: 0.5rem;
    padding: 0.8rem 1rem;
    margin-top: 2.5rem;
    overflow-x: auto;
    white-space: nowrap;
}

.docs-content .get-endpoint    { border-left-color: #3D8FE0; }
.docs-content .post-endpoint   { border-left-color: #1f9d55; }
.docs-content .put-endpoint,
.docs-content .patch-endpoint  { border-left-color: #d98b00; }
.docs-content .delete-endpoint { border-left-color: #d64545; }

/* Inline code */
.docs-content code,
.content-page code {
    font-family: var(--mono);
    font-size: 0.875em;
    color: #1f4f8f;
    background: #eef3fa;
    padding: 0.1em 0.4em;
    border-radius: 0.3rem;
}

.docs-content pre code,
.content-page pre code {
    color: inherit;
    background: none;
    padding: 0;
    font-size: inherit;
}

/* Code blocks: dark navy panels */
.highlight {
    background: var(--navy-deep);
    color: #e6edf7;
    border-radius: 0.75rem;
    margin: 1rem 0 1.5rem;
    overflow: hidden;
    box-shadow: 0 20px 40px -30px rgba(6, 21, 41, 0.8);
}

.highlight pre {
    margin: 0;
    padding: 1.1rem 1.25rem;
    overflow-x: auto;
    font-family: var(--mono);
    font-size: 0.85rem;
    line-height: 1.6;
    color: inherit;
}

/* rouge tokens (a compact palette tuned for JSON and shell samples) */
.highlight .c, .highlight .c1, .highlight .cm { color: #7f93b0; font-style: italic; }
.highlight .p  { color: #a9b8d0; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb { color: #a5e3a1; }
.highlight .nl { color: #86C3FA; }
.highlight .mi, .highlight .mf, .highlight .m { color: #ffb86c; }
.highlight .kc, .highlight .k, .highlight .kd { color: #c792ea; }
.highlight .nb, .highlight .nf { color: #86C3FA; }
.highlight .nv { color: #ffd580; }
.highlight .o  { color: #a9b8d0; }
.highlight .err { color: inherit; background: none; }
.highlight .gp { color: #7f93b0; user-select: none; }   /* shell prompt */
.highlight .go { color: #b8c4d6; }                       /* shell output */

/* Tables produced from markdown */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1rem 0 1.5rem;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
}

.docs-content table,
.content-page table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    font-size: 0.925rem;
}

.docs-content table:not(.table-wrap table),
.content-page table:not(.table-wrap table) {
    margin: 1rem 0 1.5rem;
}

.docs-content th,
.content-page th {
    background: var(--surface);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    text-align: left;
    padding: 0.65rem 0.9rem;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.docs-content td,
.content-page td {
    padding: 0.65rem 0.9rem;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
    line-height: 1.5;
}

.docs-content tbody tr:last-child td,
.content-page tbody tr:last-child td {
    border-bottom: 0;
}

.docs-content tbody tr:hover td {
    background: #fafcff;
}

/* Landing cards on the API index */
.docs-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 1rem;
    margin: 1.5rem 0 2rem;
}

.card-link {
    display: block;
    padding: 1.1rem 1.25rem;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    color: var(--ink);
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card-link:hover {
    color: var(--ink);
    transform: translateY(-2px);
    box-shadow: 0 14px 30px -18px rgba(11, 31, 61, 0.35);
}

.card-link strong {
    display: block;
    margin-bottom: 0.2rem;
    color: var(--navy);
}

.card-link span {
    font-size: 0.9rem;
    color: var(--muted);
}

/* Prev / next footer links on docs pages */
.docs-pager {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 3.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
    font-size: 0.95rem;
}
