"""
Theme constants for the Zero-Click, Old Tricks SCSS 2026 presentation.

Dark terminal palette matches the existing PPT theme and the companion site
(mcs.danielwagner.ro). All fonts are Windows-native to avoid Pango fallbacks.
"""

from manim import ManimColor


class SecurityPalette:
    # Dark terminal base (GitHub dark, matches PPT + site)
    BG          = ManimColor("#0D1117")
    BG_PANEL    = ManimColor("#161B22")  # raised panel / code blocks
    BG_LIGHT    = ManimColor("#F0F0F0")  # rarely used; for hybrid scenes
    FG          = ManimColor("#E6EDF3")  # primary text
    FG_MUTED    = ManimColor("#8B949E")  # secondary text, captions
    FG_DIM      = ManimColor("#6E7681")  # very subtle (footer, citations)
    RULE        = ManimColor("#30363D")  # separator lines, borders

    # Semantic accents
    SAFE        = ManimColor("#39C77E")  # green - buffer intact, safe
    DANGER      = ManimColor("#EF4444")  # red - overflow, corrupt, exploit
    WARN        = ManimColor("#FBB630")  # amber - hijack moment, attention
    INFO        = ManimColor("#58A6FF")  # blue - addresses, pointers, info
    ACCENT      = ManimColor("#C77DFF")  # purple - emphasis, callouts


# Alias used internally so _layout.chrome() can switch on either name.
Palette = SecurityPalette


class Fonts:
    # Titles render clean under Pango with Segoe UI MEDIUM weight.
    # Body text (NORMAL weight) breaks kerning at small sizes with any
    # proportional font (Inter, Segoe UI, ...), so SANS goes monospace.
    # JetBrains Mono is well-tested with Manim and has zero kerning issues.
    SERIF         = "Segoe UI"
    SERIF_DISPLAY = "Segoe UI"
    SANS          = "JetBrains Mono"
    MONO          = "JetBrains Mono"


class Sizes:
    """Tuned for Manim frame_width=14.22 units (1920x1080 at 16:9)."""
    TITLE_HUGE   = 96
    TITLE        = 60
    SUBTITLE     = 34
    BODY         = 26
    SMALL        = 22
    EYEBROW      = 20
    BADGE        = 24
    CAPTION      = 18
    CITATION     = 16
    PULL_QUOTE   = 44
    AUTHORS      = 22
    CODE         = 24


class Layout:
    """Manim frame coordinates (frame_width=14.22, frame_height=8.0)."""
    LEFT_EDGE   = -7.11
    RIGHT_EDGE  =  7.11
    TOP_EDGE    =  4.00
    BOTTOM_EDGE = -4.00

    MARGIN_X = 0.55
    MARGIN_Y = 0.40

    HEADER_Y      =  3.50
    FOOTER_Y      = -3.65
    HEADER_RULE_Y =  3.32
    FOOTER_RULE_Y = -3.50

    # Bottom-right corner for inline citation markers
    CITE_X = RIGHT_EDGE - MARGIN_X
    CITE_Y = BOTTOM_EDGE + 0.20
