import 'package:flutter/material.dart';

/// Design tokens for the HaloBestie warm palette.
///
/// Mirrors `requirement/Figma/handoff/tokens.json`. Three palettes
/// (warm/calm/playful) exist in the source-of-truth JSON; only `warm`
/// ships in code today — the others are stubbed for phase 5.
///
/// Naming convention: every token prefixed with `Halo*` and grouped into
/// purpose classes (`HaloTokens` for colors, `HaloSpacing`, `HaloRadius`,
/// `HaloMotion`, `HaloShadows`).
class HaloTokens {
  const HaloTokens._();

  // Warm palette — default.
  static const Color bg = Color(0xFFFDF7F4);
  static const Color surface = Color(0xFFFFFFFF);
  static const Color ink = Color(0xFF2A1820);
  static const Color inkSoft = Color(0xFF6B5560);
  static const Color inkMuted = Color(0xFF9C8590);
  static const Color brand = Color(0xFFE17A9D);
  static const Color brandDark = Color(0xFF8C3255);
  static const Color brandSoft = Color(0xFFF7E4E9);
  static const Color brandSofter = Color(0xFFFBEFF3);
  static const Color accent = Color(0xFFF7B26A);
  static const Color accentSoft = Color(0xFFFCEAD3);
  static const Color mint = Color(0xFFB8DBC8);
  static const Color lilac = Color(0xFFD4C5E8);
  static const Color success = Color(0xFF5BA67F);
  static const Color danger = Color(0xFFD86B6B);
  static const Color border = Color(0xFFF0E4E8);

  // Font family names — must match the `family:` entries in pubspec.yaml.
  // Falls back to system fonts when the .ttf assets are not bundled.
  static const String fontDisplay = 'BricolageGrotesque';
  static const String fontBody = 'Poppins';
  static const String fontMono = 'JetBrainsMono';

  // TODO: phase5 — calm palette
  // static const Color calmBg = Color(0xFFF6F4F8);
  // static const Color calmBrand = Color(0xFF9B8BC4);
  // ...

  // TODO: phase5 — playful palette
  // static const Color playfulBg = Color(0xFFFFF5F8);
  // static const Color playfulBrand = Color(0xFFFF69A0);
  // ...
}

class HaloSpacing {
  const HaloSpacing._();

  static const double s0 = 0;
  static const double s4 = 4;
  static const double s8 = 8;
  static const double s12 = 12;
  static const double s16 = 16;
  static const double s20 = 20;
  static const double s24 = 24;
  static const double s32 = 32;
  static const double s40 = 40;
  static const double s48 = 48;
  static const double s64 = 64;
  static const double s80 = 80;
}

class HaloRadius {
  const HaloRadius._();

  static const Radius _sm = Radius.circular(8);
  static const Radius _md = Radius.circular(12);
  static const Radius _lg = Radius.circular(16);
  static const Radius _xl = Radius.circular(22);
  static const Radius _pill = Radius.circular(9999);

  static const BorderRadius sm = BorderRadius.all(_sm);
  static const BorderRadius md = BorderRadius.all(_md);
  static const BorderRadius lg = BorderRadius.all(_lg);
  static const BorderRadius xl = BorderRadius.all(_xl);
  static const BorderRadius pill = BorderRadius.all(_pill);
}

class HaloMotion {
  const HaloMotion._();

  static const Duration fast = Duration(milliseconds: 180);
  static const Duration normal = Duration(milliseconds: 280);
  static const Duration slow = Duration(milliseconds: 420);

  static const Cubic ease = Cubic(0.2, 0.8, 0.2, 1);
}

class HaloShadows {
  const HaloShadows._();

  static const List<BoxShadow> soft = [
    BoxShadow(
      color: Color(0x0A8C3255),
      offset: Offset(0, 1),
      blurRadius: 2,
    ),
    BoxShadow(
      color: Color(0x0F8C3255),
      offset: Offset(0, 8),
      blurRadius: 24,
    ),
  ];

  static const List<BoxShadow> card = [
    BoxShadow(
      color: Color(0x0D8C3255),
      offset: Offset(0, 2),
      blurRadius: 6,
    ),
    BoxShadow(
      color: Color(0x1A8C3255),
      offset: Offset(0, 18),
      blurRadius: 40,
    ),
  ];

  static const List<BoxShadow> button = [
    BoxShadow(
      color: Color(0x59E17A9D),
      offset: Offset(0, 4),
      blurRadius: 14,
    ),
  ];
}
