@import "tailwindcss";

/* Tell Tailwind to scan Craft Twig templates for class names */
@source "../../templates";

/* -------------------------------------------------------------------------- */
/* Brand tokens (Tailwind v4 CSS-first configuration)                         */
/* -------------------------------------------------------------------------- */
@theme {
  --color-bs-green: #3c9c7d;
  --color-bs-red: #ff4a31;
  --color-bs-yellow: #facf15;
  --color-bs-sky: #e1f1f6;

  --color-bs-ink: #0f172a;
  --color-bs-paper: #fffdf5;

  --font-display: "Playwright US Modern", ui-serif, Georgia, serif;
  --font-body: "Agrandir", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;

  --shadow-sticker: 0 10px 0 rgb(0 0 0 / 0.10);
  --radius-bubble: 1.75rem;
}

/* -------------------------------------------------------------------------- */
/* Base tweaks                                                                */
/* -------------------------------------------------------------------------- */
@layer base {
  html {
    scroll-behavior: smooth;
  }

  body {
    font-family: var(--font-body);
    color: var(--color-bs-ink);
  }

  h1, h2, h3, h4 {
    font-family: var(--font-display);
  }
}

/* -------------------------------------------------------------------------- */
/* Utilities                                                                  */
/* -------------------------------------------------------------------------- */
@layer utilities {

  /* Notebook background */
  .bg-paper {
    background-color: var(--color-bs-paper);
    background-image:
      linear-gradient(to right,
        transparent 0,
        transparent 2.25rem,
        rgb(255 74 49 / 0.22) 2.25rem,
        rgb(255 74 49 / 0.22) 2.4rem,
        transparent 2.4rem
      ),
      repeating-linear-gradient(to bottom,
        transparent 0,
        transparent 1.45rem,
        rgb(60 156 125 / 0.10) 1.45rem,
        rgb(60 156 125 / 0.10) 1.5rem
      );
    background-size: 100% 100%, 100% 1.5rem;
  }

  /* Playful underline */
  .squiggle-underline {
    position: relative;
    display: inline-block;
  }

  .squiggle-underline::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -0.35em;
    height: 0.55em;
    opacity: 0.9;
    background: linear-gradient(
      90deg,
      var(--color-bs-yellow),
      var(--color-bs-red)
    );
    border-radius: 9999px;
    transform: rotate(-1deg);
  }
}

/* -------------------------------------------------------------------------- */
/* Components                                                                 */
/* -------------------------------------------------------------------------- */
@layer components {

  .bs-container {
    width: 100%;
    max-width: 72rem;
    margin-inline: auto;
    padding-inline: 1rem;
  }

  .bs-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.85rem;
    background: rgb(255 255 255 / 0.70);
    border: 1px solid rgb(15 23 42 / 0.08);
    backdrop-filter: blur(6px);
  }

  .bs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.2rem;
    border-radius: 9999px;
    font-weight: 800;
    line-height: 1;
    transition: transform 150ms ease,
                box-shadow 150ms ease,
                background-color 150ms ease,
                color 150ms ease,
                border-color 150ms ease;
    box-shadow: var(--shadow-sticker);
  }

  .bs-btn:active {
    transform: translateY(2px);
    box-shadow: 0 8px 0 rgb(0 0 0 / 0.10);
  }

  .bs-btn-primary {
    background: var(--color-bs-red);
    color: white;
  }

  .bs-btn-primary:hover {
    background: color-mix(in srgb, var(--color-bs-red) 88%, black);
  }

  .bs-btn-secondary {
    background: var(--color-bs-green);
    color: white;
  }

  .bs-btn-secondary:hover {
    background: color-mix(in srgb, var(--color-bs-green) 88%, black);
  }

  .bs-btn-ghost {
    background: rgb(255 255 255 / 0.75);
    color: var(--color-bs-ink);
    border: 1px solid rgb(15 23 42 / 0.10);
  }

  .bs-btn-ghost:hover {
    background: white;
  }

  .bs-card {
    border-radius: var(--radius-bubble);
    background: rgb(255 255 255 / 0.75);
    border: 1px solid rgb(15 23 42 / 0.08);
    box-shadow: 0 18px 40px rgb(15 23 42 / 0.08);
    backdrop-filter: blur(10px);
  }

  .bs-paper-card {
    border-radius: var(--radius-bubble);
    border: 1px solid rgb(15 23 42 / 0.10);
    box-shadow: 0 18px 40px rgb(15 23 42 / 0.10);
    padding: 1.25rem;
  }
}