@import 'tailwindcss';

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

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

@font-face {
    font-family: 'Inter';
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    src: url('../fonts/inter-latin-400-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-weight: 600;
    font-style: normal;
    font-display: swap;
    src: url('../fonts/inter-latin-600-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-weight: 700;
    font-style: normal;
    font-display: swap;
    src: url('../fonts/plus-jakarta-sans-latin-700-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-weight: 800;
    font-style: normal;
    font-display: swap;
    src: url('../fonts/plus-jakarta-sans-latin-800-normal.woff2') format('woff2');
}

/* Brand palette (BWC charter) */
@theme {
    --font-sans: 'Inter', 'Segoe UI', ui-sans-serif, system-ui, sans-serif;
    --font-display: 'Plus Jakarta Sans', 'Segoe UI', ui-sans-serif, system-ui, sans-serif;

    --color-navy: #002d62;
    --color-turquoise: #00c4cc;
    --color-turquoise-text: #007a80;
    --color-mist: #eef3f8;
    --color-ok: #c6efce;
    --color-warn: #ffeb9c;
    --color-bad: #ffc7cE;
}

/* Semantic tokens, switched by the .dark class on <html> */
:root {
    --page: #ffffff;
    --surface: #ffffff;
    --surface-alt: #eef3f8;
    --ink: #0b2447;
    --ink-soft: #4b5f7a;
    --line: #d6e0ec;
    --field-border: #7b8da6;
    --link: #007a80;
    --on-state-ok: #0b4a1c;
    --on-state-warn: #5c4300;
    --on-state-bad: #7a1020;
}
.dark {
    --page: #061226;
    --surface: #0c2144;
    --surface-alt: #0a1b38;
    --ink: #eef3f8;
    --ink-soft: #a9bbd1;
    --line: #1d3a63;
    --field-border: #5f7ba3;
    --link: #4fdce2;
    color-scheme: dark;
}

@theme inline {
    --color-page: var(--page);
    --color-surface: var(--surface);
    --color-surface-alt: var(--surface-alt);
    --color-ink: var(--ink);
    --color-ink-soft: var(--ink-soft);
    --color-line: var(--line);
    --color-field: var(--field-border);
    --color-link: var(--link);
}

@layer base {
    html {
        font-family: var(--font-sans);
        background: var(--page);
        color: var(--ink);
        -webkit-text-size-adjust: 100%;
    }
    body {
        min-height: 100dvh;
        background: var(--page);
    }
    h1, h2, h3, .font-display {
        font-family: var(--font-display);
        font-weight: 800;
        letter-spacing: -0.01em;
    }
    :focus-visible {
        outline: 3px solid var(--link);
        outline-offset: 2px;
    }
    a {
        color: var(--link);
    }
}

@layer components {
    /* Subtle dot grid */
    .bg-dots {
        background-image: radial-gradient(var(--line) 1px, transparent 1px);
        background-size: 22px 22px;
    }
    /* Blurred halo behind hero areas */
    .halo {
        position: absolute;
        border-radius: 9999px;
        /* A soft radial mask instead of a blur filter: far cheaper on low-end phones */
        -webkit-mask-image: radial-gradient(closest-side, #000 0%, transparent 100%);
        mask-image: radial-gradient(closest-side, #000 0%, transparent 100%);
        transform: scale(1.7);
        opacity: 0.35;
        pointer-events: none;
    }
    .dark .halo {
        opacity: 0.25;
    }
    .brand-gradient {
        background-image: linear-gradient(135deg, var(--color-navy) 0%, #0a4a8c 60%, #00a3ab 120%);
    }
    .card-depth {
        box-shadow: 0 1px 2px rgb(0 45 98 / 0.06), 0 8px 24px -12px rgb(0 45 98 / 0.18);
    }
    .dark .card-depth {
        box-shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px -12px rgb(0 0 0 / 0.6);
    }
    .touch {
        min-height: 44px;
        min-width: 44px;
    }
    /* Body of a blog article (HTML produced by the rich editor, already sanitised). */
    .article {
        font-size: 1.0625rem;
        line-height: 1.75;
        overflow-wrap: anywhere;
    }
    .article > * + * {
        margin-top: 1.1em;
    }
    .article h2 {
        font-size: 1.5rem;
        line-height: 1.3;
        margin-top: 1.8em;
    }
    .article h3 {
        font-size: 1.25rem;
        line-height: 1.35;
        margin-top: 1.5em;
    }
    .article ul,
    .article ol {
        padding-left: 1.4em;
    }
    .article ul {
        list-style: disc;
    }
    .article ol {
        list-style: decimal;
    }
    .article li + li {
        margin-top: 0.35em;
    }
    .article a {
        color: var(--link);
        text-decoration: underline;
    }
    .article img {
        max-width: 100%;
        height: auto;
        border-radius: 0.75rem;
    }
    .article blockquote {
        border-left: 4px solid var(--color-turquoise);
        padding-left: 1rem;
        color: var(--ink-soft);
    }
    .article pre,
    .article code {
        font-size: 0.9em;
    }
    .article pre {
        overflow-x: auto;
        border-radius: 0.75rem;
        background: var(--surface-alt);
        padding: 0.9rem 1rem;
    }
    .article table {
        width: 100%;
        min-width: 28rem;
        border-collapse: collapse;
        font-size: 0.95rem;
        line-height: 1.5;
    }
    .article th,
    .article td {
        border-bottom: 1px solid var(--line);
        padding: 0.5rem 0.6rem;
        text-align: left;
        vertical-align: top;
    }
    .article th {
        background: var(--surface-alt);
    }
    .article img {
        border: 1px solid var(--line);
        margin-inline: auto;
    }
    .article h3 {
        font-weight: 800;
    }
    .article code {
        border-radius: 0.375rem;
        background: var(--surface-alt);
        padding: 0.1em 0.35em;
    }
    .article hr {
        border-color: var(--line);
    }
    /* Phone screenshots in the user guide stay phone-sized on wide screens. */
    .guide img {
        display: block;
        max-width: min(100%, 22rem);
    }
    .fade-up {
        animation: fade-up 0.35s ease-out both;
    }
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* Printing always uses the light palette on white paper, whatever the theme on screen. */
@media print {
    :root,
    .dark {
        --page: #ffffff;
        --surface: #ffffff;
        --surface-alt: #f4f7fb;
        --ink: #0b2447;
        --ink-soft: #4b5f7a;
        --line: #d6e0ec;
        --link: #007a80;
        color-scheme: light;
    }
    .halo,
    .bg-dots {
        display: none !important;
    }
    .card-depth {
        box-shadow: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fade-up {
        animation: none;
    }
    *,
    ::before,
    ::after {
        transition-duration: 0.01ms !important;
        scale: none !important;
    }
}

[x-cloak] {
    display: none !important;
}
