/* ============================================================================
   1. Primitive Tokens — Typography
   ============================================================================ */

:root {
    /* Font Families */
    --font-family-display: "Radio Canada Big", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-family-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-family-mono: "SF Mono", "Menlo", "DejaVu Sans Mono", monospace;

    /* Font Sizes */
    --font-size-3xs: 0.575rem;   /* ~9px  */
    --font-size-2xs: 0.675rem;   /* ~11px */
    --font-size-xs: 0.75rem;     /* 12px  */
    --font-size-sm: 0.875rem;    /* 14px  */
    --font-size-md: 1rem;        /* 16px  */
    --font-size-lg: 1.125rem;    /* 18px  */
    --font-size-xl: 1.25rem;     /* 20px  */
    --font-size-2xl: 1.375rem;   /* 22px  */
    --font-size-3xl: 1.75rem;    /* 28px  */
    --font-size-4xl: 2.375rem;   /* 38px  */
    --font-size-5xl: 3.875rem;   /* 62px  */

    /* Font Weights */
    --font-weight-light: 300;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* Line Heights */
    --font-height-tighter: 0.97;
    --font-height-tight: 1.1;
    --font-height-snug: 1.375;
    --font-height-normal: 1.5;
    --font-height-relaxed: 1.6;

    /* Letter Spacing */
    --letter-tracking-tighter: -0.025em;
    --letter-tracking-tight: -0.01em;
    --letter-tracking-normal: 0;
    --letter-tracking-wide: 0.025em;
    --letter-tracking-wider: 0.071em;   /* ~1.12px at 16px */
    --letter-tracking-widest: 0.16em;   /* meta uppercase */


/* ============================================================================
   1.1 Semantic Tokens — Typography
   ============================================================================ */

    /* Hero — landing title */
    --text-hero-font: var(--font-family-display);
    --text-hero-size: var(--font-size-5xl);
    --text-hero-weight: var(--font-weight-regular);
    --text-hero-height: var(--font-height-tight);
    --text-hero-tracking: var(--letter-tracking-tight);

    /* Display — takeout / seção destaque */
    --text-display-font: var(--font-family-display);
    --text-display-size: var(--font-size-4xl);
    --text-display-weight: var(--font-weight-regular);
    --text-display-height: var(--font-height-tighter);
    --text-display-tracking: var(--letter-tracking-normal);

    /* Title — section eyebrow / favorites heading */
    --text-title-font: var(--font-family-display);
    --text-title-size: var(--font-size-3xl);
    --text-title-weight: var(--font-weight-regular);
    --text-title-height: var(--font-height-tighter);
    --text-title-tracking: var(--letter-tracking-normal);

    /* Heading — card title */
    --text-heading-font: var(--font-family-display);
    --text-heading-size: var(--font-size-2xl);
    --text-heading-weight: var(--font-weight-regular);
    --text-heading-height: var(--font-height-normal);
    --text-heading-tracking: var(--letter-tracking-normal);

    /* Subtitle — takeout body / body-lg */
    --text-subtitle-font: var(--font-family-display);
    --text-subtitle-size: var(--font-size-xl);
    --text-subtitle-weight: var(--font-weight-regular);
    --text-subtitle-height: var(--font-height-normal);
    --text-subtitle-tracking: var(--letter-tracking-normal);

    /* Body */
    --text-body-font: var(--font-family-sans);
    --text-body-size: var(--font-size-lg);
    --text-body-weight: var(--font-weight-regular);
    --text-body-height: var(--font-height-relaxed);
    --text-body-tracking: var(--letter-tracking-normal);

    /* Body Small */
    --text-body-sm-font: var(--font-family-sans);
    --text-body-sm-size: var(--font-size-md);
    --text-body-sm-weight: var(--font-weight-regular);
    --text-body-sm-height: var(--font-height-relaxed);
    --text-body-sm-tracking: var(--letter-tracking-normal);

    /* Label */
    --text-label-font: var(--font-family-sans);
    --text-label-size: var(--font-size-sm);
    --text-label-weight: var(--font-weight-regular);
    --text-label-height: var(--font-height-snug);
    --text-label-tracking: var(--letter-tracking-normal);

    /* Action — CTAs, nav links, takeout link */
    --text-action-font: var(--font-family-display);
    --text-action-size: var(--font-size-sm);
    --text-action-weight: var(--font-weight-semibold);
    --text-action-height: var(--font-height-snug);
    --text-action-tracking: var(--letter-tracking-wider);

    /* Caption — meta, schedule day, footer */
    --text-caption-font: var(--font-family-display);
    --text-caption-size: var(--font-size-xs);
    --text-caption-weight: var(--font-weight-regular);
    --text-caption-height: var(--font-height-normal);
    --text-caption-tracking: var(--letter-tracking-widest);
}


/* ============================================================================
   2. Primitive Tokens — Colors
   ============================================================================ */

:root {
    /* Neutral */
    --color-neutral-0: #ffffff;
    --color-neutral-50: #fafafa;
    --color-neutral-100: #f5f5f5;
    --color-neutral-200: #e5e5e5;
    --color-neutral-300: #d4d4d4;
    --color-neutral-400: #b0b0b0;
    --color-neutral-500: #737373;
    --color-neutral-600: #525252;
    --color-neutral-700: #2a2a2a;
    --color-neutral-800: #1a1a1a;
    --color-neutral-900: #0d0d0d;
    --color-neutral-950: #070707;

    /* Cream — superfícies brand quentes */
    --color-cream-50: #fff3e3;
    --color-cream-100: #ede5d8;
    --color-cream-200: #f3f1ee;
    --color-cream-300: #e8e0d5;

    /* Gold — accent brand */
    --color-gold-300: #e3c79e;
    --color-gold-500: #c9a227;
    --color-gold-700: #a07a1a;

    /* Green — sucesso */
    --color-green-50: #f2fbf4;
    --color-green-100: #e1f7e6;
    --color-green-400: #63c579;
    --color-green-500: #009b3a;
    --color-green-600: #2e8b43;
    --color-green-900: #1f4829;

    /* Red — perigo */
    --color-red-50: #fef2f2;
    --color-red-100: #fee3e2;
    --color-red-400: #f87571;
    --color-red-500: #ed4c5c;
    --color-red-600: #db2c27;
    --color-red-900: #7f201d;

    /* Blue — informação */
    --color-blue-50: #edfcff;
    --color-blue-100: #d6f6ff;
    --color-blue-400: #48deff;
    --color-blue-500: #428bc1;
    --color-blue-700: #0095ff;

    /* Yellow — aviso */
    --color-yellow-50: #fffdea;
    --color-yellow-100: #fff6c5;
    --color-yellow-400: #ffcc1b;
    --color-yellow-500: #fde000;
    --color-yellow-600: #e28100;


/* ============================================================================
   2.1 Semantic Tokens — Colors (dark theme)
   ============================================================================ */

    /* Background */
    --color-bg-base: var(--color-neutral-950);
    --color-bg-secondary: var(--color-neutral-800);
    --color-bg-card: var(--color-neutral-800);
    --color-bg-sidebar: var(--color-neutral-800);
    --color-bg-overlay: var(--color-neutral-950);
    --color-bg-surface: var(--color-cream-50);
    --color-bg-panel: var(--color-cream-100);

    --color-bg-info: var(--color-blue-50);
    --color-bg-success: var(--color-green-50);
    --color-bg-warning: var(--color-yellow-50);
    --color-bg-danger: var(--color-red-50);

    /* Border */
    --color-border: var(--color-neutral-800);
    --color-border-card: var(--color-neutral-700);
    --color-border-accent: var(--color-gold-300);
    --color-border-success: var(--color-green-100);
    --color-border-danger: var(--color-red-100);
    --color-border-info: var(--color-blue-100);
    --color-border-warning: var(--color-yellow-100);

    /* Text */
    --color-text-primary: var(--color-cream-50);       /* texto sobre fundo escuro (hero) */
    --color-text-base: var(--color-cream-200);          /* texto padrão sobre fundo escuro */
    --color-text-secondary: var(--color-neutral-400);   /* texto atenuado */
    --color-text-dark: var(--color-neutral-950);        /* texto sobre superfícies claras */
    --color-text-on-surface: var(--color-neutral-900);  /* texto sobre cream/panel */
    --color-text-muted: rgba(243, 241, 238, 0.72);      /* muted com opacidade */
    --color-text-placeholder: var(--color-neutral-500);
    --color-text-inverse: var(--color-neutral-950);

    --color-text-success: var(--color-green-500);
    --color-text-danger: var(--color-red-500);
    --color-text-warning: var(--color-yellow-500);
    --color-text-info: var(--color-blue-500);

    /* Icon */
    --color-icon-primary: var(--color-cream-50);
    --color-icon-secondary: var(--color-neutral-400);

    /* Accent */
    --color-accent: var(--color-gold-300);
    --color-accent-strong: var(--color-gold-500);

    /* Button */
    --color-button-primary: var(--color-cream-50);
    --color-button-primary-hover: #fff8ec;
    --color-button-secondary: transparent;
    --color-button-secondary-hover: var(--color-neutral-800);
    --color-button-tertiary: transparent;
    --color-button-tertiary-hover: var(--color-neutral-800);
    
    --color-button-light-bg-primary: var(--color-neutral-950);
    --color-button-light-bg-primary-hover: var(--color-neutral-800);
    --color-button-light-bg-secondary: transparent;
    --color-button-light-bg-secondary-hover: transparent;

    --color-button-danger: var(--color-red-500);
    --color-button-danger-hover: var(--color-neutral-200);
}


/* ============================================================================
   3. Other Tokens
   ============================================================================ */

/* Spacing */
:root {
    --space-3xs: 0.125rem;   /*  2px */
    --space-2xs: 0.25rem;    /*  4px */
    --space-xs: 0.5rem;      /*  8px */
    --space-sm: 0.75rem;     /* 12px */
    --space-md: 1rem;        /* 16px */
    --space-lg: 1.5rem;      /* 24px */
    --space-xl: 2rem;        /* 32px */
    --space-2xl: 3rem;       /* 48px */
    --space-3xl: 4rem;       /* 64px */
    --space-4xl: 4.5rem;     /* 72px */
}

/* Borders */
:root {
    --border-thin: 0.0625rem;    /* 1px  */
    --border-base: 0.125rem;     /* 2px  */
    --border-thick: 0.25rem;     /* 4px  */
    --border-thickest: 0.5rem;   /* 8px  */
}

/* Shadows */
:root {
    --shadow-2xs: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow-xs: 0 4px 8px 0 rgba(0, 0, 0, 0.25);
    --shadow-sm: 0 8px 16px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.65);
}

/* Z-index */
:root {
    --zindex-dropdown: 100;
    --zindex-drawer: 400;
    --zindex-dialog: 500;
    --zindex-toast: 600;
    --zindex-tooltip: 700;
}

/* Radius */
:root {
    --radius-sm: 0.25rem;    /* 4px  */
    --radius-md: 0.5rem;     /* 8px  */
    --radius-lg: 0.75rem;    /* 12px */
    --radius-xl: 1rem;       /* 16px */
    --radius-circle: 50%;
    --radius-pill: 9999px;
}
