@import 'tailwindcss';
@import '@fontsource-variable/fraunces';
@import '@fontsource-variable/manrope';
@import 'swiper/css';
@import 'swiper/css/pagination';
@import 'swiper/css/navigation';
@import 'swiper/css/effect-fade';

@source '../../vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php';
@source '../../storage/framework/views/*.php';
@source '../**/*.blade.php';
@source '../**/*.js';

@custom-variant dark (&:where(.dark, .dark *));

@theme {
    --font-sans: 'Manrope Variable', ui-sans-serif, system-ui, sans-serif;
    --font-display: 'Fraunces Variable', ui-serif, Georgia, serif;

    --color-bamboo-50: #f3f7f0;
    --color-bamboo-100: #e4eddd;
    --color-bamboo-200: #c9dbbc;
    --color-bamboo-300: #a5c392;
    --color-bamboo-400: #7ea866;
    --color-bamboo-500: #5e8c47;
    --color-bamboo-600: #496f37;
    --color-bamboo-700: #3a5730;
    --color-bamboo-800: #31472b;
    --color-bamboo-900: #2a3b26;
    --color-bamboo-950: #131f12;

    --color-sand-50: #faf7f0;
    --color-sand-100: #f3ede0;
    --color-sand-200: #e7decb;
    --color-sand-300: #d5c5a7;
    --color-sand-400: #bfa77e;
    --color-sand-500: #a4885b;

    --color-clay-400: #d98a5b;
    --color-clay-500: #c2703d;
    --color-clay-600: #a65a2d;

    --shadow-soft: 0 1px 2px rgb(31 42 30 / 0.04), 0 8px 24px -8px rgb(31 42 30 / 0.10);
    --shadow-lift: 0 2px 4px rgb(31 42 30 / 0.05), 0 18px 40px -12px rgb(31 42 30 / 0.22);

    --animate-fade-up: fade-up 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
    --animate-marquee: marquee 38s linear infinite;
    --animate-pop: pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;

    @keyframes fade-up {
        from { opacity: 0; transform: translateY(18px); }
        to { opacity: 1; transform: translateY(0); }
    }
    @keyframes marquee {
        from { transform: translateX(0); }
        to { transform: translateX(-50%); }
    }
    @keyframes pop {
        from { opacity: 0; transform: scale(0.85); }
        to { opacity: 1; transform: scale(1); }
    }
}

@layer base {
    html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
    body {
        @apply bg-sand-50 font-sans text-bamboo-950 antialiased;
        font-feature-settings: 'ss01', 'cv11';
    }
    h1, h2, h3, .font-display { font-family: var(--font-display); font-optical-sizing: auto; letter-spacing: -0.01em; }
    [x-cloak] { display: none !important; }
    ::selection { background: var(--color-bamboo-200); color: var(--color-bamboo-950); }
    :focus-visible { outline: 2px solid var(--color-bamboo-500); outline-offset: 2px; border-radius: 4px; }
    button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
    img { @apply bg-sand-100; }
    @media (prefers-reduced-motion: reduce) {
        *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
    }
}

@layer components {
    .container-x { @apply mx-auto w-full max-w-[1320px] px-4 sm:px-6 lg:px-8; }

    /* Buttons */
    .btn {
        @apply inline-flex items-center justify-center gap-2 rounded-full px-6 py-3 text-sm font-semibold tracking-wide transition duration-200 select-none disabled:cursor-not-allowed disabled:opacity-50 active:scale-[0.98];
    }
    .btn-primary { @apply bg-bamboo-700 text-white shadow-soft hover:bg-bamboo-800 hover:shadow-lift; }
    .btn-dark { @apply bg-bamboo-950 text-white hover:bg-bamboo-800; }
    .btn-clay { @apply bg-clay-500 text-white hover:bg-clay-600; }
    .btn-outline { @apply border border-bamboo-900/20 bg-white/60 text-bamboo-900 backdrop-blur hover:border-bamboo-700 hover:bg-bamboo-700 hover:text-white; }
    .btn-ghost { @apply text-bamboo-800 hover:bg-bamboo-100; }
    .btn-danger { @apply bg-rose-600 text-white hover:bg-rose-700; }
    .btn-sm { @apply px-4 py-2 text-xs; }
    .btn-lg { @apply px-8 py-4 text-base; }
    .btn-block { @apply w-full; }

    /* Forms */
    .label { @apply mb-1.5 block text-xs font-semibold uppercase tracking-wider text-bamboo-800/80; }
    .input, .select, .textarea {
        @apply w-full rounded-xl border border-sand-300 bg-white px-4 py-3 text-sm text-bamboo-950 placeholder:text-bamboo-900/35 shadow-sm transition focus:border-bamboo-500 focus:ring-4 focus:ring-bamboo-500/15 focus:outline-none disabled:bg-sand-100;
    }
    .input-error { @apply border-rose-400 focus:border-rose-500 focus:ring-rose-500/15; }
    .field-error { @apply mt-1.5 text-xs font-medium text-rose-600; }
    .checkbox { @apply size-4 rounded border-sand-300 text-bamboo-700 focus:ring-bamboo-500; }

    /* Surfaces */
    .card { @apply rounded-2xl border border-sand-200 bg-white shadow-soft; }
    .card-pad { @apply p-5 sm:p-6; }
    .badge { @apply inline-flex items-center gap-1 rounded-full px-2.5 py-1 text-[11px] font-bold uppercase tracking-wider; }

    .eyebrow { @apply text-xs font-bold uppercase tracking-[0.22em] text-bamboo-600; }
    .section-title { @apply font-display text-3xl font-medium leading-tight text-bamboo-950 sm:text-4xl lg:text-[2.75rem]; }

    .prose-bn { @apply max-w-none text-[15px] leading-relaxed text-bamboo-900/90; }
    .prose-bn h2 { @apply mt-8 mb-3 text-2xl font-medium; }
    .prose-bn h3 { @apply mt-6 mb-2 text-xl font-medium; }
    .prose-bn p { @apply mb-4; }
    .prose-bn ul { @apply mb-4 list-disc space-y-1.5 pl-6; }
    .prose-bn ol { @apply mb-4 list-decimal space-y-1.5 pl-6; }
    .prose-bn a { @apply text-bamboo-700 underline underline-offset-2; }
    .prose-bn img { @apply my-4 rounded-xl; }
    .prose-bn blockquote { @apply my-4 border-l-4 border-bamboo-300 pl-4 italic; }
    .prose-bn table { @apply my-4 w-full text-sm; }
    .prose-bn th, .prose-bn td { @apply border border-sand-200 px-3 py-2 text-left; }

    .scrollbar-none { scrollbar-width: none; }
    .scrollbar-none::-webkit-scrollbar { display: none; }

    .skeleton { @apply animate-pulse rounded-lg bg-sand-200; }

    /* Subtle bamboo-stripe & woven organic linen texture */
    .bamboo-texture {
        background-image:
            radial-gradient(circle at 18% 20%, rgb(165 195 146 / 0.14), transparent 45%),
            radial-gradient(circle at 85% 80%, rgb(193 170 132 / 0.14), transparent 45%),
            repeating-linear-gradient(90deg, rgb(94 140 71 / 0.04) 0 2px, transparent 2px 38px);
    }
    .organic-paper {
        background-color: var(--color-sand-50);
        background-image:
            radial-gradient(at 10% 10%, rgb(228 237 221 / 0.55) 0, transparent 50%),
            radial-gradient(at 90% 85%, rgb(233 224 207 / 0.55) 0, transparent 50%);
    }
    .glass { @apply bg-white/75 backdrop-blur-xl; }
}

/* Swiper theming */
.swiper-pagination-bullet { background: #fff !important; opacity: 0.55 !important; width: 8px; height: 8px; transition: all .25s; }
.swiper-pagination-bullet-active { opacity: 1 !important; width: 28px; border-radius: 99px !important; }
.swiper-button-prev, .swiper-button-next {
    color: var(--color-bamboo-900) !important;
    background: rgb(255 255 255 / 0.92);
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    border-radius: 9999px;
    border: 1px solid rgb(213 197 167 / 0.75);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(8px);
    transition: transform .2s ease, background-color .2s ease;
}
.swiper-button-prev:hover, .swiper-button-next:hover { background: #fff; transform: scale(1.06); }
.swiper-button-prev svg, .swiper-button-next svg, .swiper-navigation-icon {
    width: 14px !important;
    height: 14px !important;
}
.swiper-button-prev::after, .swiper-button-next::after { font-size: 14px !important; font-weight: 800; }
.swiper-button-disabled { opacity: 0 !important; }

/* Range slider */
input[type='range'].range { @apply h-1.5 w-full cursor-pointer appearance-none rounded-full bg-sand-200 accent-bamboo-700; }
