/* ===== Chat Era Landing: Modern layout & visuals ===== */
/* Signed-out layout: no app shell. In PWA/standalone = welcome-only screen (no header, centered hero). */

.landing {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

html.landing-page-scroll {
    scroll-behavior: smooth;
}

.landing .landing-cta-primary:focus-visible,
.landing .landing-cta-secondary:focus-visible,
.landing-nav a:focus-visible,
.landing-logo:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

/* ----- Header (shown only when NOT in installed PWA; hidden for signed-out app welcome) ----- */
.landing-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: calc(16px + env(safe-area-inset-top, 0px)) calc(24px + env(safe-area-inset-right, 0px)) 16px calc(24px + env(safe-area-inset-left, 0px));
    background: rgba(11, 20, 26, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: background var(--motion-base) ease, border-color var(--motion-base) ease;
}

/* Installed PWA signed-out: viewport-sized body so hero centering is stable */
body.pwa-standalone.landing {
    height: 100dvh;
    height: -webkit-fill-available;
    min-height: 100dvh;
    overflow: hidden;
}

/* Installed PWA signed-out: no top header - welcome screen only */
body.pwa-standalone .landing-header {
    display: none !important;
}


.landing-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.landing-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 0.02em;
    color: var(--white);
    transition: opacity var(--motion-fast) ease, transform var(--motion-fast) var(--ease-out);
}

.landing-logo:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

.landing-logo-img {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    object-fit: contain;
}

.landing-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.landing-nav a {
    padding: 8px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: color var(--motion-fast) ease, background var(--motion-fast) ease;
}

.landing-nav a:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
}

.landing-nav-cta {
    color: var(--white) !important;
    background: var(--primary) !important;
}

.landing-nav-cta:hover {
    background: var(--primary-dark) !important;
    color: var(--white) !important;
}

/* ----- Hero ----- */
.landing-hero {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 24px 80px;
    overflow: hidden;
}

/* Installed PWA signed-out: single welcome screen - hero fills viewport, content centered in usable area */
body.pwa-standalone .landing-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
}

body.pwa-standalone .landing-hero {
    flex: 1;
    min-height: 0;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    padding: calc(24px + env(safe-area-inset-top, 0px)) calc(24px + env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) calc(24px + env(safe-area-inset-left, 0px));
    align-items: center;
    justify-content: center;
}

/* Hide long sections and footer in PWA so only the welcome hero is visible */
body.pwa-standalone .landing-section,
body.pwa-standalone .landing-cta,
body.pwa-standalone .landing-footer {
    display: none !important;
}

.landing-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(31, 111, 95, 0.25) 0%, transparent 55%),
        radial-gradient(ellipse 60% 40% at 80% 60%, rgba(179, 139, 89, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse 50% 30% at 20% 80%, rgba(31, 111, 95, 0.1) 0%, transparent 45%);
    pointer-events: none;
}

.landing-hero-inner {
    position: relative;
    text-align: center;
    max-width: 720px;
}

/* Constrain text width for readability and premium look (especially on large phones) */
body.pwa-standalone .landing-hero-inner {
    max-width: min(420px, 88vw);
}

.landing-hero-logo {
    width: 136px;
    height: 136px;
    border-radius: 32px;
    object-fit: contain;
    margin-bottom: 24px;
    animation: hero-logo-in var(--motion-slow) var(--ease-out) both;
    background: transparent;
}

/* Spacing scale: tight logo-title, slightly more title-tagline, more before buttons */
body.pwa-standalone .landing-hero-logo {
    margin-bottom: 12px;
    width: 100px;
    height: 100px;
}

.landing-product-name {
    font-family: "Playfair Display", Georgia, serif;
    font-size: clamp(2.5rem, 6vw, 3.75rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--white);
    margin-bottom: 16px;
    animation: hero-text-in var(--motion-slow) var(--ease-out) 0.08s both;
}

body.pwa-standalone .landing-product-name {
    margin-bottom: 8px;
}

.landing-hero-headline {
    font-size: clamp(1.15rem, 2.5vw, 1.4rem);
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    margin-bottom: 12px;
    animation: hero-text-in var(--motion-slow) var(--ease-out) 0.16s both;
}

body.pwa-standalone .landing-hero-headline {
    margin-bottom: 10px;
}

.landing-hero-support {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-bottom: 32px;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
    animation: hero-text-in var(--motion-slow) var(--ease-out) 0.24s both;
}

/* Description reads secondary; more space before buttons */
body.pwa-standalone .landing-hero-support {
    opacity: 0.9;
    margin-bottom: 28px;
    max-width: 100%;
}

.landing-hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
    animation: hero-text-in var(--motion-slow) var(--ease-out) 0.32s both;
}

/* Buttons same width and consistent gap (app-first look) */
body.pwa-standalone .landing-hero-actions {
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

body.pwa-standalone .landing-cta-primary,
body.pwa-standalone .landing-cta-secondary {
    width: 100%;
    min-width: 200px;
    max-width: 280px;
    justify-content: center;
}

.landing-cta-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--white);
    background: var(--primary);
    border-radius: var(--radius-sm);
    border: none;
    transition: background var(--motion-fast) ease, transform var(--motion-fast) var(--ease-out), box-shadow var(--motion-fast) ease;
}

.landing-cta-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(31, 111, 95, 0.35);
}

.landing-cta-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: background var(--motion-fast) ease, border-color var(--motion-fast) ease, transform var(--motion-fast) var(--ease-out);
}

.landing-cta-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.landing-cta-primary:active,
.landing-cta-secondary:active {
    transform: scale(0.98);
}

.landing-hero-learn {
    font-size: 0.9rem;
    animation: hero-text-in var(--motion-slow) var(--ease-out) 0.4s both;
}

.landing-hero-learn a {
    color: var(--accent);
    font-weight: 600;
    text-underline-offset: 3px;
    transition: color var(--motion-fast) ease, text-decoration-color var(--motion-fast) ease;
}

.landing-hero-learn a:hover {
    color: #c99d6a;
    text-decoration: underline;
}

/* Signed-out PWA: subtle "Learn more" under buttons, no floating */
body.pwa-standalone .landing-hero-learn {
    font-size: 0.85rem;
    margin-top: 4px;
}

body.pwa-standalone .landing-hero-learn a {
    color: var(--text-secondary);
    font-weight: 500;
}

body.pwa-standalone .landing-hero-learn a:hover {
    color: var(--text);
}

@keyframes hero-logo-in {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes hero-text-in {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ----- Sections ----- */
.landing-section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 72px 24px;
}

body.pwa-standalone .landing-section {
    padding-left: calc(24px + env(safe-area-inset-left, 0px));
    padding-right: calc(24px + env(safe-area-inset-right, 0px));
}

.landing-section--center {
    text-align: center;
}

.landing-section h2 {
    font-family: "Playfair Display", Georgia, serif;
    font-size: clamp(1.6rem, 3.5vw, 2rem);
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--white);
    margin-bottom: 20px;
}

.landing-section--center h2 {
    margin-bottom: 16px;
}

.landing-section p {
    font-size: 1.05rem;
    line-height: 1.65;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.landing-section p:last-child {
    margin-bottom: 0;
}

/* ----- Triple block (different - how it works - trust) ----- */
.landing-section--triple {
    padding: 48px 24px 56px;
}

.landing-section-triple-title {
    font-size: clamp(1.1rem, 2vw, 1.25rem) !important;
    font-weight: 600 !important;
    font-family: "Manrope", sans-serif !important;
    color: var(--text-secondary) !important;
    margin-bottom: 28px !important;
    text-align: center;
}

.landing-triple-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px 32px;
    align-items: start;
}

.landing-triple-col {
    background: rgba(32, 44, 51, 0.5);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 22px;
    scroll-margin-top: 80px;
}

.landing-triple-col h3 {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.landing-triple-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.landing-triple-list li {
    position: relative;
    padding-left: 14px;
    margin-bottom: 10px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.landing-triple-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--primary);
}

.landing-triple-list li:last-child {
    margin-bottom: 0;
}

@media (max-width: 900px) {
    .landing-triple-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .landing-section--triple {
        padding: 40px 24px 48px;
    }
}

@media (max-width: 640px) {
    .landing-section-triple-title {
        font-size: 1rem !important;
        margin-bottom: 20px !important;
    }

    .landing-triple-col {
        padding: 20px 18px;
    }
}

/* ----- Feature grid (3x2) ----- */
.landing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 32px;
}

.landing-card {
    background: rgba(32, 44, 51, 0.6);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: transform var(--motion-base) var(--ease-out), border-color var(--motion-base) ease, box-shadow var(--motion-base) ease;
}

.landing-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
}

.landing-card h3 {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 10px;
}

.landing-card p {
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.landing-card p:last-child {
    margin-bottom: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.55;
}

/* ----- CTA section ----- */
.landing-cta {
    text-align: center;
    padding: 88px 24px 96px;
    background: linear-gradient(180deg, transparent 0%, rgba(31, 111, 95, 0.08) 50%, transparent 100%);
}

body.pwa-standalone .landing-cta {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    padding-left: calc(24px + env(safe-area-inset-left, 0px));
    padding-right: calc(24px + env(safe-area-inset-right, 0px));
}

.landing-cta h2 {
    margin-bottom: 16px;
}

.landing-cta .landing-hero-actions {
    margin-top: 28px;
    margin-bottom: 16px;
}

.landing-cta-note {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ----- Footer ----- */
.landing-footer {
    margin-top: auto;
    padding: 48px 24px 24px;
    border-top: 1px solid var(--border);
    background: rgba(17, 27, 33, 0.5);
}

body.pwa-standalone .landing-footer {
    padding-left: calc(24px + env(safe-area-inset-left, 0px));
    padding-right: calc(24px + env(safe-area-inset-right, 0px));
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

.landing-footer-inner {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 32px;
    margin-bottom: 32px;
}

.landing-footer-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.landing-footer-col-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.landing-footer-col a {
    font-size: 0.95rem;
    color: var(--text-secondary);
    transition: color var(--motion-fast) ease;
}

.landing-footer-col a:hover {
    color: var(--text);
}

.landing-footer-bottom {
    max-width: 1000px;
    margin: 0 auto;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.landing-footer-bottom p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ----- Responsive ----- */
@media (max-width: 640px) {
    .landing-header {
        padding: 12px 16px;
    }

    .landing-hero {
        padding: 100px 16px 60px;
    }

    .landing-hero-logo {
        width: 100px;
        height: 100px;
        margin-bottom: 20px;
    }

    .landing-section {
        padding: 48px 16px;
    }

    .landing-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-top: 24px;
    }

    .landing-cta {
        padding: 56px 16px 64px;
    }
}

@media (min-width: 641px) and (max-width: 900px) {
    .landing-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}
