﻿/* ==========================================================================
   Elmet Aesthetics — design tokens
   --------------------------------------------------------------------------
   THE single source of truth for the brand. Colours were sampled from the
   logo (gold gradient, near-black disc) and the price-list flyer (dusty rose).

   AppTheme.cs mirrors these values into the MudBlazor light/dark themes, so
   bespoke components and Mud components stay in step. Change a value here and
   in AppTheme.cs together.

   Contrast (verified, WCAG 2.1):
     gold fill + ink text ......... 8.51:1   primary buttons
     --gold-text on white ......... 6.37:1   gold as text on light
     --blush-text on white ........ 5.57:1
     --ink on white ............... 17.43:1  body
     --fg on dark surface ......... 14.22:1  body, dark theme
   Raw --gold on white is 2.05:1 and must NEVER be used for text or icons on a
   light background. Use --gold-text for that.
   ========================================================================== */

:root {
  /* ---- brand constants (identical in both themes) ---------------------- */
  --gold: #DFAE3C;
  --gold-bright: #FFE180;
  --gold-deep: #C08A22;
  /* Button fill. A touch deeper than --gold: a large block of --gold reads
     brighter and yellower than the same colour as small text, so this is
     what makes buttons match the gold eyebrow text. Ink on it: 7.6:1. */
  --gold-fill: #CCA13F;
  --gold-fill-hover: #B38A30;
  --gold-gradient: linear-gradient(135deg, var(--gold-bright), var(--gold) 45%, var(--gold-deep));
  --ink: #1A1A18;
  --ink-soft: #24241F;
  --ink-deep: #0E0E0D;   /* the footer base panel, a shade under --ink */
  --blush: #D6AEA6;

  /* Text placed on the ink panel. Theme-independent, because the ink panel
     itself is theme-independent — see .section--inverse. */
  --on-ink: #EDEAE5;
  --on-ink-muted: #A8A29B;

  /* ---- type ------------------------------------------------------------ */
  --font-display: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --text-3xl: 4rem;     /* 64 */
  --text-2xl: 2.75rem;  /* 44 */
  --text-xl: 2rem;      /* 32 */
  --text-lg: 1.5rem;    /* 24 */
  --text-md: 1.25rem;   /* 20 */
  --text-base: 1rem;    /* 16 */
  --text-sm: 0.875rem;  /* 14 */
  --text-xs: 0.75rem;   /* 12 */

  --tracking-display: -0.02em;
  --tracking-eyebrow: 0.14em;
  --leading-body: 1.6;
  --leading-display: 1.08;
  --measure: 68ch;

  /* ---- spacing (4px base) ---------------------------------------------- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;

  /* ---- shape ------------------------------------------------------------ */
  --radius: 2px;
  --radius-card: 4px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 8px 24px rgb(0 0 0 / 0.06);

  /* ---- layout ----------------------------------------------------------- */
  --page-max: 1200px;
  --page-gutter: 1rem;
  --header-height: 72px;

  /* ---- motion ------------------------------------------------------------ */
  --ease: cubic-bezier(0.2, 0, 0.2, 1);
  --dur-fast: 120ms;
  --dur: 180ms;
}

@media (min-width: 640px) {
  :root { --page-gutter: 2rem; }
}

/* ==========================================================================
   Light theme (default)
   ========================================================================== */

:root,
:root[data-theme='light'] {
  color-scheme: light;

  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --surface-alt: #FAF7F6;
  --surface-inverse: var(--ink);

  --fg: #1A1A18;
  --fg-muted: #5A5652;
  --fg-on-inverse: #EDEAE5;
  --fg-muted-on-inverse: #A8A29B;

  --accent: var(--gold);
  --accent-text: #7A5A12;       /* gold as TEXT on light — 6.37:1 */
  --accent-contrast: var(--ink); /* text placed on a gold fill */

  --blush-tint: #F4E8E5;
  --blush-text: #8A5D53;

  --line: #E6DEDB;
  --line-strong: #CFC5C1;

  --success: #1F6B4A;
  --warning: #8A5D0F;
  --danger: #9B2C2C;
}

/* ==========================================================================
   Dark theme — the logo's natural state
   ========================================================================== */

:root[data-theme='dark'] {
  color-scheme: dark;

  --bg: #141412;
  --surface: #1C1C1A;
  --surface-alt: #232320;
  --surface-inverse: #EDEAE5;

  --fg: #EDEAE5;
  --fg-muted: #A8A29B;
  --fg-on-inverse: #1A1A18;
  --fg-muted-on-inverse: #5A5652;

  --accent: var(--gold);
  --accent-text: var(--gold);   /* 8.51:1 on dark surfaces — safe as text here */
  --accent-contrast: var(--ink);

  --blush-tint: #2E2724;
  --blush-text: #C8A49B;

  --line: #35352F;
  --line-strong: #4A4A42;

  --success: #5BBF8F;
  --warning: #E0B454;
  --danger: #E08585;

  --shadow: 0 1px 2px rgb(0 0 0 / 0.5), 0 8px 24px rgb(0 0 0 / 0.4);
}

/* Follow the OS when the visitor has not chosen a theme. The guard means an
   explicit data-theme="light" always wins. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;

    --bg: #141412;
    --surface: #1C1C1A;
    --surface-alt: #232320;
    --surface-inverse: #EDEAE5;

    --fg: #EDEAE5;
    --fg-muted: #A8A29B;
    --fg-on-inverse: #1A1A18;
    --fg-muted-on-inverse: #5A5652;

    --accent-text: var(--gold);

    --blush-tint: #2E2724;
    --blush-text: #C8A49B;

    --line: #35352F;
    --line-strong: #4A4A42;

    --success: #5BBF8F;
    --warning: #E0B454;
    --danger: #E08585;

    --shadow: 0 1px 2px rgb(0 0 0 / 0.5), 0 8px 24px rgb(0 0 0 / 0.4);
  }
}

/* MudBlazor's stylesheet sets body { font-family: var(--mud-typography-default-family) },
   and that variable is only defined by MudThemeProvider — which static pages don't render.
   Left undefined, the body font falls back to the browser's serif. Defining it here, ahead
   of Mud's stylesheet, keeps static pages on the site font; the provider overrides it on
   interactive pages. */
:root {
  --mud-typography-default-family: var(--font-body);
}
