@import "tailwindcss";
@import "@fontsource-variable/fraunces";
@import "@fontsource-variable/outfit";
@import "@fortawesome/fontawesome-free/css/fontawesome.css";
@import "@fortawesome/fontawesome-free/css/solid.css";
@import "@fortawesome/fontawesome-free/css/brands.css";

@source "../views";
@source "../../addons/vnc/*/resources/views";
/* Colour and column classes chosen in the control panel, so they never appear literally in templates */
@source inline("bg-{leaf,clay,lavender,sand,white,ink}");
@source inline("lg:grid-cols-{2,3,4}");

/* ---------------------------------------------------------------------------
   Design tokens (carried over from the original vncindia.org)
   --------------------------------------------------------------------------- */
@theme {
    --color-ink: #052e16;
    --color-ink-soft: #14532d;
    --color-clay: #fdba74;
    --color-clay-deep: #c2410c;
    --color-leaf: #d9f99d;
    --color-lime: #bef264;
    --color-lavender: #e9d5ff;
    --color-sand: #f5f5f4;
    --color-soft: #fdfcf8;
    --color-muted: #4b5563;

    --font-display: "Fraunces Variable", Georgia, "Times New Roman", serif;
    --font-sans: "Outfit Variable", ui-sans-serif, system-ui, sans-serif;

    --shadow-pop: 4px 4px 0 0 var(--color-ink);
    --shadow-pop-sm: 2px 2px 0 0 var(--color-ink);
    --shadow-pop-lg: 8px 8px 0 0 var(--color-ink);

    --animate-marquee: marquee 35s linear infinite;
    --animate-spin-slow: spin 18s linear infinite;
    --animate-float: float 4s ease-in-out infinite;

    @keyframes marquee {
        to { transform: translateX(-50%); }
    }
    @keyframes float {
        0%, 100% { transform: translateY(0); }
        50% { transform: translateY(-8px); }
    }
}

@layer base {
    html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
    body { @apply bg-soft text-ink font-sans antialiased; text-rendering: optimizeLegibility; }
    ::selection { @apply bg-leaf text-ink; }
    h1, h2, h3, h4 { @apply font-display text-balance; font-optical-sizing: auto; }
    p { text-wrap: pretty; }
    :focus-visible { outline: 3px solid var(--color-clay-deep); outline-offset: 3px; border-radius: 6px; }
    [x-cloak], [hidden] { display: none !important; }

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

@layer components {
    /* Buttons: hard offset shadow that "presses" on hover */
    .btn {
        @apply inline-flex items-center justify-center gap-2 rounded-2xl border-[1.5px] border-ink px-7 py-3.5
               font-bold text-base leading-tight transition duration-200 select-none;
    }
    .btn:hover { transform: translate(2px, 2px); }
    .btn-primary { @apply bg-ink text-white; box-shadow: 4px 4px 0 0 #9ca3af; }
    .btn-primary:hover { box-shadow: 1px 1px 0 0 #9ca3af; }
    .btn-secondary { @apply bg-white text-ink shadow-pop; }
    .btn-secondary:hover { @apply bg-leaf shadow-pop-sm; }
    .btn-accent { @apply bg-clay text-ink shadow-pop; }
    .btn-accent:hover { @apply shadow-pop-sm; }
    .btn-lg { @apply px-8 py-4 text-lg; }
    .btn-sm { @apply px-5 py-2.5 text-sm rounded-xl; }

    /* Framed card */
    .frame { @apply bg-white border-[1.5px] border-ink rounded-3xl shadow-pop; }
    .frame-hover { @apply transition duration-200; }
    .frame-hover:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 0 var(--color-ink); }

    .pill {
        @apply inline-flex items-center gap-2 rounded-full border-[1.5px] border-ink px-4 py-1.5 text-sm font-bold;
    }

    .section { @apply px-5 py-20 md:px-6 md:py-28; }
    .container-site { @apply mx-auto w-full max-w-7xl; }
    .section-heading { @apply font-display font-bold text-4xl md:text-5xl leading-[1.05] tracking-tight; }
    .section-intro { @apply mt-5 max-w-2xl text-lg font-medium leading-relaxed text-muted; }

    .link-underline { @apply underline decoration-clay decoration-2 underline-offset-4 hover:decoration-ink; }

    /* Long-form text from the editor */
    .prose-vnc { @apply text-lg leading-[1.75] text-ink/85; }
    .prose-vnc > * + * { margin-top: 1.1em; }
    .prose-vnc h2 { @apply mt-12 font-bold text-3xl md:text-4xl leading-tight text-ink; }
    .prose-vnc h3 { @apply mt-10 font-bold text-2xl leading-snug text-ink; }
    .prose-vnc a { @apply font-semibold text-ink underline decoration-clay decoration-2 underline-offset-4 hover:decoration-ink; }
    .prose-vnc strong { @apply font-bold text-ink; }
    .prose-vnc ul { @apply list-disc pl-6 space-y-2 marker:text-clay-deep; }
    .prose-vnc ol { @apply list-decimal pl-6 space-y-2 marker:font-bold; }
    .prose-vnc blockquote {
        @apply my-10 rounded-3xl border-[1.5px] border-ink bg-lavender px-8 py-7 font-display text-2xl leading-snug
               text-ink shadow-pop;
    }
    .on-dark .prose-vnc, .on-dark .prose-vnc h2, .on-dark .prose-vnc h3, .on-dark .prose-vnc strong { @apply text-white; }

    /* Hand-drawn underline under the hero's second line */
    .scribble { position: relative; display: inline-block; isolation: isolate; }
    .scribble svg { position: absolute; left: 0; bottom: -0.12em; width: 100%; height: 0.35em; z-index: -1; color: var(--color-clay); }

    /* Section backgrounds chosen per block in the control panel */
    .bg-section-soft { @apply bg-soft text-ink; }
    .bg-section-sand { @apply bg-sand text-ink border-y-[1.5px] border-ink; }
    .bg-section-white { @apply bg-white text-ink border-y-[1.5px] border-ink; }
    .bg-section-leaf { @apply bg-leaf text-ink border-y-[1.5px] border-ink; }
    .bg-section-ink { @apply bg-ink text-white border-y-[1.5px] border-ink; }
    .bg-section-ink .section-intro, .bg-section-ink .text-muted { color: rgb(255 255 255 / 0.75); }
    .bg-section-ink .prose-vnc, .bg-section-ink .prose-vnc :is(h2, h3, strong, a) { color: #fff; }
    /* Bordered sections touching each other share one border */
    .page-blocks > :is(section, header, div) + :is(section, header, div) { margin-top: -1.5px; }

    /* Form inputs */
    .form-input {
        @apply block w-full rounded-xl border-[1.5px] border-ink/30 bg-soft px-4 py-3 font-medium text-ink
               transition placeholder:text-ink/40 focus:border-ink focus:bg-white focus:outline-none;
    }
    .form-input:focus-visible { outline: 3px solid var(--color-lime); outline-offset: 1px; }
    .form-input[aria-invalid="true"] { @apply border-clay-deep bg-clay/10; }

    .marquee-track { @apply flex w-max animate-marquee; }
    .marquee-track:hover { animation-play-state: paused; }
}
