/* Prism - Public pages (index.php, ai-privacy.php, demo.php)
   Layered on top of landing.css. landing.css is shared with the
   authenticated app shell, so anything only the public pages need lives
   here. Navbar and footer styling stays in landing.css. */

:root {
    --home-mint: #DCEFE7;
    --home-border: #E3EAE6;
    --home-muted: #5E6E68;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* ---------- Shared building blocks ---------- */

.home-skip-link {
    position: absolute;
    top: .5rem;
    left: .5rem;
    z-index: 2000;
    padding: .5rem 1rem;
    border-radius: .5rem;
    color: #fff;
    background: var(--prism-primary);
}

body.home :focus-visible {
    outline: 3px solid #1B6FD8;
    outline-offset: 2px;
}

.home-section {
    position: relative;
    padding: 5rem 0;
}

.home-section-head {
    margin-bottom: 3rem;
}

.home-h2 {
    font-size: clamp(1.75rem, 3vw, 2.4rem);
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.2;
}

.home-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--prism-primary);
    background: rgba(0, 103, 71, .09);
}

.home-icon-sm {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 1.2rem;
}

.home-icon-light {
    color: #fff;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .2);
}

.home-link {
    font-weight: 700;
    color: var(--prism-primary);
    text-decoration: none;
}

.home-link:hover {
    text-decoration: underline;
}

.btn-home-light {
    --bs-btn-bg: #fff;
    --bs-btn-color: var(--prism-primary);
    --bs-btn-border-color: #fff;
    --bs-btn-hover-bg: var(--home-mint);
    --bs-btn-hover-color: var(--prism-dark);
    --bs-btn-hover-border-color: var(--home-mint);
    --bs-btn-active-bg: #C7E3D7;
    --bs-btn-active-color: var(--prism-dark);
    --bs-btn-active-border-color: #C7E3D7;
    --bs-btn-focus-shadow-rgb: 255, 255, 255;
    font-weight: 700;
}

.btn-home-ghost {
    --bs-btn-bg: transparent;
    --bs-btn-color: #fff;
    --bs-btn-border-color: rgba(255, 255, 255, .5);
    --bs-btn-hover-bg: rgba(255, 255, 255, .12);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-border-color: #fff;
    --bs-btn-active-bg: rgba(255, 255, 255, .18);
    --bs-btn-active-color: #fff;
    --bs-btn-active-border-color: #fff;
    --bs-btn-focus-shadow-rgb: 255, 255, 255;
    font-weight: 600;
}

/* Availability labels - always icon + text, never color alone. */
.home-status {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .2rem .65rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: .8rem;
    font-weight: 700;
    white-space: nowrap;
}

.home-status-sm {
    font-size: .75rem;
    padding: .15rem .55rem;
}

.home-status-available {
    color: #0B5D3B;
    background: #E3F3EA;
    border-color: #BFE3CF;
}

.home-status-partial {
    color: #1D4F7C;
    background: #E8F1FA;
    border-color: #C5DAEE;
}

.home-status-development {
    color: #4A4F66;
    background: #EEF0F5;
    border-color: #D6DAE5;
}

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

.home-hero {
    color: #fff;
    padding: 4.5rem 0 5rem;
    background: linear-gradient(170deg, var(--prism-dark) 0%, #014532 100%);
}

.home-hero-brand {
    display: block;
    font-size: clamp(2.75rem, 6vw, 4rem);
    font-weight: 700;
    letter-spacing: .06em;
    line-height: 1;
    margin-bottom: .75rem;
}

.home-hero-headline {
    display: block;
    font-size: clamp(1.4rem, 2.6vw, 2rem);
    font-weight: 600;
    line-height: 1.25;
    color: var(--home-mint);
}

body.home .home-hero-sub {
    max-width: 46ch;
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
}

body.home .home-hero-lead {
    max-width: 58ch;
    font-size: 1.02rem;
    color: rgba(255, 255, 255, .8);
}

.home-hero-mockup {
    border-color: rgba(255, 255, 255, .15);
    box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, .3);
}

/* Smaller hero used by secondary public pages. */
.home-page-hero {
    color: #fff;
    padding: 3.5rem 0;
    background: linear-gradient(170deg, var(--prism-dark) 0%, #014532 100%);
}

.home-page-hero h1 {
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 700;
    letter-spacing: -.02em;
}

body.home .home-page-hero p {
    max-width: 62ch;
    color: rgba(255, 255, 255, .82);
}

.home-page-hero .breadcrumb {
    --bs-breadcrumb-divider-color: rgba(255, 255, 255, .6);
    --bs-breadcrumb-item-active-color: rgba(255, 255, 255, .85);
}

.home-page-hero .breadcrumb a {
    color: #fff;
}

/* ---------- Product Preview ---------- */

.home-preview-tabs {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.home-preview-tab {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: .9rem;
    width: 100%;
    padding: .85rem 1rem;
    text-align: left;
    color: inherit;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 12px;
    overflow: hidden;
    transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.home-preview-tab:hover {
    background: rgba(0, 103, 71, .05);
}

.home-preview-tab.active {
    background: #fff;
    border-color: var(--home-border);
    box-shadow: 0 .5rem 1.25rem rgba(1, 51, 37, .08);
}

.home-preview-tab-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
    color: var(--prism-primary);
    background: var(--prism-light-gray);
}

.home-preview-tab.active .home-preview-tab-icon {
    color: #fff;
    background: var(--prism-primary);
}

.home-preview-tab-text strong {
    display: block;
    font-size: 1rem;
    padding-top: .45rem;
}

.home-preview-tab-text small {
    display: block;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    color: var(--home-muted);
    font-size: .875rem;
    line-height: 1.45;
    transition: max-height .3s ease, opacity .3s ease, margin-top .3s ease;
}

.home-preview-tab.active .home-preview-tab-text small {
    max-height: 5rem;
    opacity: 1;
    margin-top: .25rem;
}

.home-preview-tab-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 0;
    background: var(--prism-primary);
}

/* Matches the carousel's data-bs-interval (7000ms) in index.php. */
@media (prefers-reduced-motion: no-preference) {
    .home-preview-tab.active .home-preview-tab-progress {
        animation: homeProgress 7s linear forwards;
    }

    .home-preview-tabs.is-paused .home-preview-tab-progress {
        animation: none;
    }
}

@keyframes homeProgress {
    from { width: 0; }
    to { width: 100%; }
}

.home-carousel-toggle {
    color: var(--prism-primary);
    font-weight: 600;
    text-decoration: none;
}

.home-preview-mockup {
    box-shadow: 0 1.5rem 3rem rgba(1, 51, 37, .14);
}

.home-preview-mockup .carousel-control-prev,
.home-preview-mockup .carousel-control-next {
    top: 50%;
    bottom: auto;
    width: 44px;
    height: 44px;
    margin: 0 .75rem;
    border-radius: 50%;
    transform: translateY(-50%);
    background: rgba(1, 51, 37, .65);
    opacity: .85;
}

.home-preview-mockup .carousel-control-prev:hover,
.home-preview-mockup .carousel-control-next:hover,
.home-preview-mockup .carousel-control-prev:focus-visible,
.home-preview-mockup .carousel-control-next:focus-visible {
    opacity: 1;
    background: var(--prism-primary);
}

.home-preview-mockup .carousel-control-prev-icon,
.home-preview-mockup .carousel-control-next-icon {
    width: 1.1rem;
    height: 1.1rem;
}

@media (max-width: 991.98px) {
    .home-preview-tabs {
        flex-direction: row;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-bottom: .5rem;
    }

    .home-preview-tab {
        flex: 0 0 auto;
        width: auto;
        align-items: center;
        scroll-snap-align: start;
        padding: .6rem .9rem;
        min-height: 44px;
    }

    .home-preview-tab-icon {
        width: 32px;
        height: 32px;
        font-size: .95rem;
    }

    .home-preview-tab-text strong {
        padding-top: 0;
        white-space: nowrap;
    }

    .home-preview-tab-text small {
        display: none;
    }
}

/* ---------- Feature cards ---------- */

.home-feature {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--home-border);
    border-radius: 1rem;
    transition: box-shadow .2s ease, border-color .2s ease;
}

.home-feature:hover {
    border-color: rgba(0, 103, 71, .3);
    box-shadow: 0 .75rem 1.75rem rgba(1, 51, 37, .08);
}

.home-feature-preview {
    height: 150px;
    overflow: hidden;
    border-bottom: 1px solid var(--home-border);
    background: var(--prism-light-gray);
}

.home-feature-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top left;
}

.home-feature-placeholder {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    color: rgba(0, 103, 71, .25);
    background:
        repeating-linear-gradient(135deg, transparent 0 14px, rgba(0, 103, 71, .035) 14px 28px),
        var(--prism-light-gray);
}

.home-feature-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 1.5rem;
}

body.home .home-feature-today,
body.home .home-role-today {
    margin-top: auto;
    padding-top: 1rem;
    font-size: .9rem;
    color: var(--home-muted);
}

.home-feature-body > .text-secondary,
.home-role > .text-secondary {
    margin-bottom: 1rem !important;
}

/* ---------- Process ---------- */

.home-process {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    counter-reset: none;
}

@media (min-width: 768px) {
    .home-process {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .home-process {
        grid-template-columns: repeat(4, 1fr);
    }
}

.home-process-step {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: #fff;
    border: 1px solid var(--home-border);
    border-radius: 1rem;
}

.home-process-num {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    background: var(--prism-primary);
    border-radius: 50%;
}

body.home .home-process-body p {
    font-size: .95rem;
}

.home-modes {
    padding: 1.5rem;
    background: var(--prism-light-gray);
    border: 1px solid var(--home-border);
    border-radius: 1rem;
}

.home-modes-table {
    --bs-table-bg: #fff;
    border: 1px solid var(--home-border);
    border-radius: .75rem;
    overflow: hidden;
    min-width: 560px;
}

.home-modes-table thead th {
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--home-muted);
    background: #fff;
}

/* ---------- Roles ---------- */

.home-role {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    background: #fff;
    border: 1px solid var(--home-border);
    border-radius: 1rem;
}

.home-role-ai {
    border-style: dashed;
    border-color: rgba(0, 103, 71, .35);
    background: #FBFDFC;
}

/* ---------- Dark band ---------- */

.home-dark {
    color: rgba(255, 255, 255, .8);
    background: var(--prism-dark);
}

.home-eyebrow-light {
    color: var(--home-mint);
}

body.home .home-ai-statement {
    font-size: 1.15rem;
    color: #fff;
    border-left: 3px solid var(--home-mint);
    padding-left: 1rem;
}

.home-glass {
    padding: 1.25rem;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 1rem;
}

/* ---------- CTA ---------- */

.home-cta {
    padding: 4rem 2rem;
    border-radius: 1.5rem;
    color: rgba(255, 255, 255, .85);
    background: linear-gradient(135deg, var(--prism-primary), var(--prism-dark));
}

body.home .home-cta-note {
    color: rgba(255, 255, 255, .72);
}

/* ---------- Back to top ---------- */

.home-to-top {
    position: fixed;
    right: 1.25rem;
    bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
    z-index: 1030;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: #fff;
    background: var(--prism-primary);
    border-radius: 50%;
    box-shadow: 0 .5rem 1rem rgba(1, 51, 37, .3);
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s;
}

.home-to-top.show {
    opacity: 1;
    visibility: visible;
}

.home-to-top:hover {
    color: #fff;
    background: var(--prism-dark);
}

/* ---------- Scroll reveal (subtle) ---------- */

html.js .reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .5s ease, transform .5s ease;
}

html.js .reveal.is-visible {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    html.js .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ---------- AI & Privacy page ---------- */

.home-toc {
    position: sticky;
    top: 1.5rem;
}

.home-toc .nav-link {
    padding: .35rem .75rem;
    color: var(--home-muted);
    border-left: 2px solid var(--home-border);
    border-radius: 0;
}

.home-toc .nav-link:hover,
.home-toc .nav-link.active {
    color: var(--prism-primary);
    border-left-color: var(--prism-primary);
}

.home-doc section {
    padding-bottom: 2rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--home-border);
}

.home-doc section:last-child {
    border-bottom: 0;
}

.home-doc h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.home-doc li + li {
    margin-top: .35rem;
}

.home-pending {
    margin-top: 1rem;
    padding: 1rem 1.25rem;
    border: 1px dashed #8D93AB;
    border-radius: .75rem;
    background: #F6F7FA;
}

.home-pending-label {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin-bottom: .35rem;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: #4A4F66;
}

body.home .home-pending p {
    font-size: .95rem;
}

.home-draft-banner {
    padding: .85rem 1.25rem;
    border-radius: .75rem;
    border: 1px solid #C5DAEE;
    background: #E8F1FA;
    color: #1D4F7C;
}

/* ---------- Demo page ---------- */

.demo-banner {
    padding: .75rem 1rem;
    border-radius: .75rem;
    background: #E8F1FA;
    border: 1px solid #C5DAEE;
    color: #1D4F7C;
    font-weight: 600;
}

.demo-steps {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.demo-step-btn {
    display: flex;
    align-items: center;
    gap: .75rem;
    width: 100%;
    min-height: 44px;
    padding: .55rem .75rem;
    text-align: left;
    color: inherit;
    background: transparent;
    border: 1px solid transparent;
    border-radius: .75rem;
}

.demo-step-btn:hover {
    background: rgba(0, 103, 71, .05);
}

.demo-step-btn[aria-current="step"] {
    background: #fff;
    border-color: var(--home-border);
    box-shadow: 0 .5rem 1rem rgba(1, 51, 37, .07);
    font-weight: 700;
}

.demo-step-num {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    font-weight: 700;
    color: var(--prism-primary);
    background: var(--prism-light-gray);
    border-radius: 50%;
}

.demo-step-btn[aria-current="step"] .demo-step-num,
.demo-step-btn.is-done .demo-step-num {
    color: #fff;
    background: var(--prism-primary);
}

.demo-step-role {
    display: block;
    font-size: .8rem;
    font-weight: 500;
    color: var(--home-muted);
}

@media (max-width: 991.98px) {
    .demo-steps {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: .5rem;
        /* Keeps the step strip's own sideways scroll from widening the page. */
        contain: paint;
    }

    .demo-step-btn {
        flex: 0 0 auto;
        width: auto;
    }

    .demo-step-label {
        display: none;
    }
}

.demo-progress {
    height: 6px;
    border-radius: 3px;
    background: var(--home-border);
    overflow: hidden;
}

.demo-progress-bar {
    height: 100%;
    background: var(--prism-primary);
    transition: width .3s ease;
}

.demo-screen {
    background: #fff;
}

.demo-screen-body {
    padding: 1.5rem;
}

@media (max-width: 575.98px) {
    .demo-screen-body {
        padding: 1rem;
    }
}

.demo-screen-title {
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--home-muted);
}

.demo-video {
    position: relative;
    aspect-ratio: 16 / 9;
    max-width: 100%;
    border-radius: .75rem;
    background: linear-gradient(160deg, #22302B, #0F1714);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, .85);
    font-size: 3rem;
}

.demo-video-label {
    position: absolute;
    left: .75rem;
    top: .6rem;
    font-size: .75rem;
    color: rgba(255, 255, 255, .7);
}

.demo-timeline {
    position: absolute;
    left: .75rem;
    right: .75rem;
    bottom: .75rem;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, .25);
}

.demo-timeline-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 38%;
    border-radius: 3px;
    background: #fff;
}

.demo-marker {
    position: absolute;
    top: -4px;
    width: 4px;
    height: 14px;
    border-radius: 2px;
    background: var(--home-mint);
}

.demo-comment {
    padding: .75rem;
    border: 1px solid var(--home-border);
    border-radius: .75rem;
    background: #fff;
}

.demo-time {
    display: inline-block;
    padding: .1rem .45rem;
    border-radius: .4rem;
    font-size: .8rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--prism-primary);
    background: rgba(0, 103, 71, .09);
}

.demo-rubric {
    min-width: 560px;
}

.demo-rubric td,
.demo-rubric th {
    vertical-align: top;
    font-size: .875rem;
}

.demo-cell-selected {
    background: #E3F3EA !important;
    box-shadow: inset 0 0 0 2px var(--prism-primary);
    font-weight: 600;
}

.demo-diff {
    background: #E8F1FA !important;
}

.demo-bar {
    height: 10px;
    border-radius: 5px;
    background: var(--prism-primary);
}

.demo-bar-track {
    height: 10px;
    border-radius: 5px;
    background: var(--home-border);
    overflow: hidden;
}

.demo-metric {
    padding: 1rem;
    border: 1px solid var(--home-border);
    border-radius: .75rem;
    background: #fff;
}

.demo-metric-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
}

body.home .demo-narration p {
    font-size: 1rem;
}

.demo-available {
    padding: .85rem 1rem;
    border-radius: .75rem;
    background: var(--prism-light-gray);
    border: 1px solid var(--home-border);
}

body.home .demo-available p {
    font-size: .925rem;
}

/* ---------- Small screens ---------- */

@media (max-width: 767.98px) {
    .home-hero {
        padding: 3rem 0 3.5rem;
    }

    .home-section {
        padding: 3.5rem 0;
    }

    .home-section-head {
        margin-bottom: 2rem;
    }

    .home-cta {
        padding: 2.5rem 1.25rem;
    }
}
