/*
 * Heartsong Design System
 * Extracted from the Remix of Heartsong Website reference.
 * All colors are HSL. Light-first with dark mode variant.
 */

/* ── Design Tokens ─────────────────────────────────────────────────────── */

:root {
    /* Calming blue-purple palette inspired by meditation apps */
    --hs-background: 220 25% 98%;
    --hs-foreground: 230 20% 15%;

    --hs-card: 0 0% 100%;
    --hs-card-foreground: 230 20% 15%;

    /* Soft blue-purple for primary actions */
    --hs-primary: 245 60% 65%;
    --hs-primary-foreground: 0 0% 100%;

    /* Gentle teal for secondary elements */
    --hs-secondary: 180 35% 88%;
    --hs-secondary-foreground: 230 20% 15%;

    /* Muted backgrounds and text */
    --hs-muted: 220 20% 94%;
    --hs-muted-foreground: 230 15% 45%;

    /* Soft coral accent for warmth */
    --hs-accent: 15 75% 70%;
    --hs-accent-foreground: 0 0% 100%;

    /* Success states */
    --hs-success: 145 64% 32%;
    --hs-success-soft: 145 58% 95%;
    --hs-success-border: 145 40% 78%;

    /* Destructive / error */
    --hs-destructive: 0 84% 60%;
    --hs-destructive-foreground: 0 0% 100%;

    /* Borders and inputs */
    --hs-border: 220 15% 88%;
    --hs-input: 220 15% 88%;
    --hs-ring: 245 60% 65%;

    /* Brand navy — the signature Heartsong color */
    --hs-brand-navy: 224 76% 29%;
    --hs-brand-navy-hover: 224 70% 36%;

    /* Radius */
    --hs-radius: 0.75rem;

    /* Gradient tokens */
    --gradient-hero: linear-gradient(135deg, hsl(245 60% 65%) 0%, hsl(260 50% 70%) 100%);
    --gradient-soft: linear-gradient(180deg, hsl(220 25% 98%) 0%, hsl(240 30% 96%) 100%);

    /* Animation tokens */
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}


/* ── Global Reset & Base ───────────────────────────────────────────────── */

* {
    border-color: hsl(var(--hs-border));
}

html {
    scroll-behavior: smooth;
}

body {
    background: hsl(var(--hs-background));
    color: hsl(var(--hs-foreground));
    font-feature-settings: "kern" 1, "liga" 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}


/* ── Gradient Utilities ────────────────────────────────────────────────── */

.bg-gradient-hero {
    background: var(--gradient-hero);
}

.bg-gradient-soft {
    background: var(--gradient-soft);
}

.text-gradient {
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}


/* ── Color Utilities ───────────────────────────────────────────────────── */

.text-foreground { color: hsl(var(--hs-foreground)); }
.text-muted-foreground { color: hsl(var(--hs-muted-foreground)); }
.text-primary { color: hsl(var(--hs-primary)); }
.text-primary-foreground { color: hsl(var(--hs-primary-foreground)); }
.text-accent { color: hsl(var(--hs-accent)); }
.text-success { color: hsl(var(--hs-success)); }
.text-destructive { color: hsl(var(--hs-destructive)); }
.text-brand-navy { color: hsl(var(--hs-brand-navy)); }

.bg-card { background-color: hsl(var(--hs-card)); }
.bg-muted { background-color: hsl(var(--hs-muted)); }
.bg-primary { background-color: hsl(var(--hs-primary)); }
.bg-brand-navy { background-color: hsl(var(--hs-brand-navy)); }

.border-border { border-color: hsl(var(--hs-border)); }
.border-input { border-color: hsl(var(--hs-input)); }


/* ── Card Component ────────────────────────────────────────────────────── */

.hs-card {
    background: hsl(var(--hs-card));
    color: hsl(var(--hs-card-foreground));
    border: 1px solid hsl(var(--hs-border));
    border-radius: var(--hs-radius);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
}

.hs-card-interactive {
    transition: var(--transition-smooth);
    border-width: 2px;
}
.hs-card-interactive:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    border-color: hsl(var(--hs-primary));
}


/* ── Button Component ──────────────────────────────────────────────────── */

.hs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
    border-radius: calc(var(--hs-radius) - 2px);
    font-weight: 500;
    font-size: 0.875rem;
    transition: var(--transition-smooth);
    cursor: pointer;
    border: none;
    outline: none;
    text-decoration: none;
}
.hs-btn:focus-visible {
    outline: 2px solid hsl(var(--hs-ring));
    outline-offset: 2px;
}
.hs-btn:disabled {
    pointer-events: none;
    opacity: 0.5;
}

.hs-btn-primary {
    background: var(--gradient-hero);
    color: hsl(var(--hs-primary-foreground));
    padding: 0.75rem 2rem;
    font-size: 1.125rem;
    font-weight: 700;
    border-radius: 9999px;
}
.hs-btn-primary:hover {
    opacity: 0.9;
}

.hs-btn-secondary {
    background: hsl(var(--hs-secondary));
    color: hsl(var(--hs-secondary-foreground));
    padding: 0.625rem 1.5rem;
}
.hs-btn-secondary:hover {
    background: hsl(var(--hs-secondary) / 0.8);
}

.hs-btn-outline {
    border: 1px solid hsl(var(--hs-input));
    background: hsl(var(--hs-background));
    color: hsl(var(--hs-foreground));
    padding: 0.625rem 1.5rem;
}
.hs-btn-outline:hover {
    background: hsl(var(--hs-muted));
}

.hs-btn-lg {
    height: 2.75rem;
    padding: 0 2rem;
    font-size: 1.125rem;
}

.hs-btn-sm {
    height: 2.25rem;
    padding: 0 0.75rem;
    font-size: 0.875rem;
}


/* ── Form Inputs ───────────────────────────────────────────────────────── */

.hs-input {
    width: 100%;
    padding: 0.625rem 1rem;
    background: hsl(var(--hs-background));
    border: 1px solid hsl(var(--hs-input));
    border-radius: var(--hs-radius);
    font-size: 0.875rem;
    color: hsl(var(--hs-foreground));
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.hs-input:focus {
    border-color: hsl(var(--hs-primary));
    box-shadow: 0 0 0 1px hsl(var(--hs-primary));
}
.hs-input::placeholder {
    color: hsl(var(--hs-muted-foreground));
}

.hs-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(var(--hs-foreground));
    margin-bottom: 0.375rem;
}

.hs-checkbox {
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
    border: 1px solid hsl(var(--hs-input));
    accent-color: hsl(var(--hs-primary));
}


/* ── Badge ─────────────────────────────────────────────────────────────── */

.hs-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: hsl(var(--hs-primary) / 0.1);
    color: hsl(var(--hs-primary));
}

.hs-badge-success {
    background: hsl(var(--hs-success) / 0.1);
    color: hsl(var(--hs-success));
    border: 1px solid hsl(var(--hs-success-border));
}


/* ── Icon Badge (for feature cards) ────────────────────────────────────── */

.hs-icon-badge {
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.3s;
}
.group:hover .hs-icon-badge {
    transform: scale(1.1);
}

.hs-icon-badge-primary {
    background: hsl(var(--hs-primary) / 0.1);
    color: hsl(var(--hs-primary));
}

.hs-icon-badge-accent {
    background: hsl(var(--hs-accent) / 0.1);
    color: hsl(var(--hs-accent));
}

.hs-icon-badge-teal {
    background: #2596be;
    color: white;
}


/* ── Alert / Notification ──────────────────────────────────────────────── */

.hs-alert {
    padding: 0.75rem 1rem;
    border-radius: var(--hs-radius);
    font-size: 0.875rem;
}

.hs-alert-error {
    background: hsl(var(--hs-destructive) / 0.1);
    border: 1px solid hsl(var(--hs-destructive) / 0.3);
    color: hsl(var(--hs-destructive));
}

.hs-alert-success {
    background: hsl(var(--hs-success-soft));
    border: 1px solid hsl(var(--hs-success-border));
    color: hsl(var(--hs-success));
}


/* ── Navigation ────────────────────────────────────────────────────────── */

.hs-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    transition: var(--transition-smooth);
}

.hs-nav.scrolled {
    background: hsl(var(--hs-card) / 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
}

.hs-nav-link {
    font-size: 1rem;
    font-weight: 500;
    color: hsl(var(--hs-muted-foreground));
    text-decoration: none;
    transition: color 0.2s;
}
.hs-nav-link:hover {
    color: hsl(var(--hs-foreground));
}
.hs-nav-link-active {
    color: hsl(var(--hs-primary));
    font-weight: 600;
}


/* ── Section Backgrounds (alternating rhythm) ──────────────────────────── */

.hs-section-soft {
    background: var(--gradient-soft);
}

.hs-section-muted {
    background: hsl(var(--hs-muted) / 0.3);
}

.hs-section-navy {
    background: hsl(var(--hs-brand-navy));
    color: white;
}

.hs-section-cta {
    background: var(--gradient-hero);
    color: hsl(var(--hs-primary-foreground));
    position: relative;
    overflow: hidden;
}

.hs-section-cta::before,
.hs-section-cta::after {
    content: "";
    position: absolute;
    width: 24rem;
    height: 24rem;
    background: white;
    border-radius: 9999px;
    filter: blur(80px);
    opacity: 0.1;
}
.hs-section-cta::before {
    top: 25%;
    left: 25%;
}
.hs-section-cta::after {
    bottom: 25%;
    right: 25%;
}


/* ── Animations ────────────────────────────────────────────────────────── */

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes breathingGlow {
    0%, 100% { box-shadow: 0 6px 20px -10px hsl(var(--hs-primary) / 0.35); }
    50%      { box-shadow: 0 8px 24px -8px  hsl(var(--hs-primary) / 0.45); }
}

.animate-fade-in  { animation: fadeIn 0.8s ease-in-out; }
.animate-slide-up { animation: slideUp 0.6s ease-out; }
.animate-breathing-glow { animation: breathingGlow 6s ease-in-out infinite; }


/* ── Custom Scrollbar ──────────────────────────────────────────────────── */

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: hsl(var(--hs-background)); }
::-webkit-scrollbar-thumb { background: hsl(var(--hs-border)); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: hsl(var(--hs-muted-foreground) / 0.3); }


/* ── Responsive Helpers ────────────────────────────────────────────────── */

.hs-container {
    width: 100%;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 640px) {
    .hs-container { padding-left: 1.5rem; padding-right: 1.5rem; }
}
@media (min-width: 1024px) {
    .hs-container { padding-left: 2rem; padding-right: 2rem; }
}
