package com.anypreta.bountyboard.ui.theme

import androidx.compose.material3.Typography
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.Font
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.em
import androidx.compose.ui.unit.sp
import com.anypreta.bountyboard.R

/** Engraved display serif — headings, brand, stat values, avatar initials. */
val Fraunces = FontFamily(
    Font(R.font.fraunces_regular, FontWeight.Normal),
    Font(R.font.fraunces_semibold, FontWeight.SemiBold),
    Font(R.font.fraunces_bold, FontWeight.Bold),
)

/** Characterful grotesk — body, buttons, labels, nav. */
val Schibsted = FontFamily(
    Font(R.font.schibsted_regular, FontWeight.Normal),
    Font(R.font.schibsted_medium, FontWeight.Medium),
    Font(R.font.schibsted_bold, FontWeight.Bold),
)

/** Tabular mono — badges, numerals, table headers, kickers, code. */
val SplineMono = FontFamily(
    Font(R.font.spline_mono_regular, FontWeight.Normal),
    Font(R.font.spline_mono_medium, FontWeight.Medium),
    Font(R.font.spline_mono_bold, FontWeight.Bold),
)

val BBTypography = Typography(
    // Display / masthead
    displayLarge = TextStyle(
        fontFamily = Fraunces, fontWeight = FontWeight.Bold, fontSize = 40.sp, lineHeight = 44.sp,
    ),
    displayMedium = TextStyle(
        fontFamily = Fraunces, fontWeight = FontWeight.Bold, fontSize = 32.sp, lineHeight = 36.sp,
    ),
    // Headings (h1/h2/h3)
    headlineLarge = TextStyle(
        fontFamily = Fraunces, fontWeight = FontWeight.SemiBold, fontSize = 30.sp, lineHeight = 35.sp,
    ),
    headlineMedium = TextStyle(
        fontFamily = Fraunces, fontWeight = FontWeight.SemiBold, fontSize = 22.sp, lineHeight = 27.sp,
    ),
    headlineSmall = TextStyle(
        fontFamily = Fraunces, fontWeight = FontWeight.SemiBold, fontSize = 18.sp, lineHeight = 23.sp,
    ),
    titleLarge = TextStyle(
        fontFamily = Fraunces, fontWeight = FontWeight.SemiBold, fontSize = 20.sp, lineHeight = 25.sp,
    ),
    titleMedium = TextStyle(
        fontFamily = Schibsted, fontWeight = FontWeight.Bold, fontSize = 16.sp, lineHeight = 22.sp,
    ),
    titleSmall = TextStyle(
        fontFamily = Schibsted, fontWeight = FontWeight.Bold, fontSize = 14.sp, lineHeight = 20.sp,
    ),
    // Body
    bodyLarge = TextStyle(
        fontFamily = Schibsted, fontWeight = FontWeight.Normal, fontSize = 16.sp, lineHeight = 24.sp,
        letterSpacing = 0.005.em,
    ),
    bodyMedium = TextStyle(
        fontFamily = Schibsted, fontWeight = FontWeight.Normal, fontSize = 14.sp, lineHeight = 21.sp,
        letterSpacing = 0.005.em,
    ),
    bodySmall = TextStyle(
        fontFamily = Schibsted, fontWeight = FontWeight.Normal, fontSize = 12.sp, lineHeight = 18.sp,
    ),
    // Labels — buttons use uppercase bold grotesk
    labelLarge = TextStyle(
        fontFamily = Schibsted, fontWeight = FontWeight.Bold, fontSize = 13.sp, lineHeight = 16.sp,
        letterSpacing = 0.06.em,
    ),
    labelMedium = TextStyle(
        fontFamily = SplineMono, fontWeight = FontWeight.Medium, fontSize = 11.sp, lineHeight = 14.sp,
        letterSpacing = 0.09.em,
    ),
    labelSmall = TextStyle(
        fontFamily = SplineMono, fontWeight = FontWeight.Medium, fontSize = 10.sp, lineHeight = 13.sp,
        letterSpacing = 0.12.em,
    ),
)

/** Mono kicker style — uppercase, wide letter-spacing (the masthead kicker). */
val KickerStyle = TextStyle(
    fontFamily = SplineMono,
    fontWeight = FontWeight.Medium,
    fontSize = 11.sp,
    letterSpacing = 0.28.em,
)

/** Big ledger stat number. */
val StatValueStyle = TextStyle(
    fontFamily = Fraunces,
    fontWeight = FontWeight.Bold,
    fontSize = 30.sp,
)
