/* Base Typography & Layout */
:root {
    color-scheme: light;
    --canvas: #f7f8fa;
    --surface: #ffffff;
    --border-subtle: #e7eaf0;
    --border-strong: #d4dae4;
    --ink-muted: #6b7489;
    --brand: #2573eb;
    --brand-strong: #1d5cd8;
}

html {
    scroll-behavior: smooth;
    text-rendering: optimizeLegibility;
}

body {
    font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
        'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-feature-settings: "cv11", "ss01", "ss03";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.005em;
}

/* Headings get tighter tracking for a modern feel */
h1, h2, h3, h4, h5, h6 {
    letter-spacing: -0.02em;
}

/* Selection color uses the brand */
::selection {
    background-color: rgba(37, 115, 235, 0.18);
    color: #1e418a;
}

/* Smooth, scoped transitions — only on commonly-animated properties */
a, button, [role="button"], input, select, textarea, summary {
    transition-property: color, background-color, border-color, box-shadow,
        transform, opacity;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 160ms;
}

/* Fade-in Animation */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fade-in 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Blob Animation for Hero Section */
@keyframes blob {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -50px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

.animate-blob {
    animation: blob 9s ease-in-out infinite;
}

.animation-delay-2000 {
    animation-delay: 2s;
}

.animation-delay-4000 {
    animation-delay: 4s;
}

/* Subtle "shine" used on primary CTAs */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Rich Text Editor Styling (Action Text) */
.trix-content {
    line-height: 1.65;
}

.trix-content h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.trix-content p {
    margin-bottom: 0.75rem;
}

.trix-content ul,
.trix-content ol {
    margin-left: 1.5rem;
    margin-bottom: 0.75rem;
}

.trix-content a {
    color: var(--brand);
    text-decoration: underline;
    text-decoration-color: rgba(37, 115, 235, 0.35);
    text-underline-offset: 2px;
}

.trix-content a:hover {
    text-decoration-color: currentColor;
}

/* Line Clamp Utilities */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Focus Visible for Better Accessibility */
*:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    border-radius: 0.375rem;
}

button:focus-visible,
a:focus-visible {
    outline-offset: 3px;
}

/* Custom Scrollbar (WebKit browsers) */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 5px;
    border: 2px solid var(--canvas);
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Light-mode logo inversion (for dark-background logos on light sites) */
.logo-light-mode {
    filter: invert(1);
}

/* App-wide surface card: reusable shell for repeating content blocks */
.app-card {
    background-color: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: 1rem;
    box-shadow: 0 1px 2px 0 rgb(17 24 39 / 0.04),
        0 4px 12px -2px rgb(17 24 39 / 0.06);
}

/* Glassy header backdrop (the top nav opts into this via its classes) */
.glass-nav {
    background-color: rgba(255, 255, 255, 0.78);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border-subtle);
}

/* Subtle top-of-page gradient accent, used on some marketing layouts */
.page-glow {
    background-image:
        radial-gradient(1200px 320px at 15% -10%, rgba(59, 145, 246, 0.10), transparent 60%),
        radial-gradient(900px 260px at 90% -20%, rgba(124, 58, 237, 0.08), transparent 60%);
}

/* Print Styles */
@media print {
    nav, aside, footer, .no-print {
        display: none !important;
    }
    .lg\:pl-56, .lg\:pl-64 {
        padding-left: 0 !important;
    }
    body {
        background: #fff !important;
    }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
