/* =====================================================
   BASE.CSS — Azure Crest Enterprises
   Brand palette: Azure Blue, Navy, Magenta, Steel Gray
   ===================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* ── Type Scale ── */
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);
  --text-3xl:  clamp(2.5rem,   1rem    + 4vw,    5rem);
  --text-hero: clamp(2.8rem,   0.5rem  + 6vw,    6rem);

  /* ── Spacing ── */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* ── Fonts ── */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'DM Sans', 'Helvetica Neue', sans-serif;

  /* ── Radius / Transition ── */
  --radius-sm:   0.375rem;
  --radius-md:   0.5rem;
  --radius-lg:   0.75rem;
  --radius-xl:   1rem;
  --radius-full: 9999px;
  --transition-interactive: 200ms cubic-bezier(0.16, 1, 0.3, 1);

  /* ── Content widths ── */
  --content-narrow:  640px;
  --content-default: 1000px;
  --content-wide:    1260px;
}

/* ── Light Mode (Brand Palette) ── */
:root,
[data-theme='light'] {
  --color-bg:             #f4f6fb;
  --color-surface:        #ffffff;
  --color-surface-2:      #f8f9fd;
  --color-surface-offset: #eaecf5;
  --color-divider:        #dde1ef;
  --color-border:         #cdd2e8;

  --color-text:           #0f1324;
  --color-text-muted:     #5a6080;
  --color-text-faint:     #a0a8c0;
  --color-text-inverse:   #ffffff;

  /* Azure Blue — primary brand */
  --color-primary:        #1e90d6;
  --color-primary-dark:   #1467a8;
  --color-primary-light:  #dbeeff;
  --color-primary-hover:  #1878c0;

  /* Navy — secondary / deep */
  --color-navy:           #1e2f7a;
  --color-navy-dark:      #131e52;
  --color-navy-light:     #e0e5f8;

  /* Magenta — accent / highlight */
  --color-accent:         #e0186c;
  --color-accent-hover:   #c01059;
  --color-accent-light:   #fce4ef;

  /* Steel gray */
  --color-gray:           #8a8fa8;
  --color-gray-light:     #f0f1f6;

  --color-success:        #1a7a45;
  --color-error:          #c0192a;

  --shadow-sm: 0 1px 4px rgba(30,47,122,0.07);
  --shadow-md: 0 4px 20px rgba(30,47,122,0.10);
  --shadow-lg: 0 12px 48px rgba(30,47,122,0.14);
}

/* ── Dark Mode ── */
[data-theme='dark'] {
  --color-bg:             #0c0f1e;
  --color-surface:        #12172e;
  --color-surface-2:      #171d38;
  --color-surface-offset: #1a2040;
  --color-divider:        #252d50;
  --color-border:         #2e3860;

  --color-text:           #e2e6f5;
  --color-text-muted:     #8892b8;
  --color-text-faint:     #4e5878;
  --color-text-inverse:   #0c0f1e;

  --color-primary:        #4db0f0;
  --color-primary-dark:   #1e90d6;
  --color-primary-light:  #1a2e48;
  --color-primary-hover:  #6ec4f5;

  --color-navy:           #6b83e0;
  --color-navy-dark:      #4a60c8;
  --color-navy-light:     #1a2040;

  --color-accent:         #f04090;
  --color-accent-hover:   #f565a8;
  --color-accent-light:   #2a0e20;

  --color-gray:           #7a80a0;
  --color-gray-light:     #1e2540;

  --color-success:        #3fba72;
  --color-error:          #f05060;

  --shadow-sm: 0 1px 4px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.55);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #0c0f1e; --color-surface: #12172e; --color-surface-2: #171d38;
    --color-surface-offset: #1a2040; --color-divider: #252d50; --color-border: #2e3860;
    --color-text: #e2e6f5; --color-text-muted: #8892b8; --color-text-faint: #4e5878;
    --color-text-inverse: #0c0f1e;
    --color-primary: #4db0f0; --color-primary-dark: #1e90d6; --color-primary-light: #1a2e48; --color-primary-hover: #6ec4f5;
    --color-navy: #6b83e0; --color-navy-dark: #4a60c8; --color-navy-light: #1a2040;
    --color-accent: #f04090; --color-accent-hover: #f565a8; --color-accent-light: #2a0e20;
    --color-gray: #7a80a0; --color-gray-light: #1e2540;
    --color-success: #3fba72; --color-error: #f05060;
    --shadow-sm: 0 1px 4px rgba(0,0,0,0.3); --shadow-md: 0 4px 20px rgba(0,0,0,0.4); --shadow-lg: 0 12px 48px rgba(0,0,0,0.55);
  }
}

/* ── Reset & Base ── */
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-bg);
  transition: background-color 0.25s ease, color 0.25s ease;
}

img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }
ul[role='list'], ol[role='list'] { list-style: none; }
input, button, textarea, select { font: inherit; color: inherit; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  text-wrap: balance;
  line-height: 1.15;
  color: var(--color-text);
}

p, li, figcaption { text-wrap: pretty; max-width: 72ch; }

::selection { background: rgba(30,144,214,0.2); color: var(--color-text); }

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

button { cursor: pointer; background: none; border: none; }

a, button, [role='button'], input, textarea, select {
  transition: color var(--transition-interactive), background var(--transition-interactive),
    border-color var(--transition-interactive), box-shadow var(--transition-interactive),
    opacity var(--transition-interactive), transform var(--transition-interactive);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border-width: 0;
}
