/* ============================================================
   Al Fajr Accounting — Design tokens & base
   Navy + gold, editorial serif display, humanist sans body
   ============================================================ */

:root, [data-theme="light"] {
  /* 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(3rem, 0.5rem + 7vw, 7rem);

  /* Spacing */
  --space-1: .25rem; --space-2: .5rem; --space-3: .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;

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 1040px;
  --content-wide: 1240px;

  /* Radius / shadow / motion */
  --radius-sm: .375rem;
  --radius-md: .5rem;
  --radius-lg: .875rem;
  --radius-xl: 1.25rem;
  --transition-interactive: 200ms cubic-bezier(.16,1,.3,1);
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
  --shadow-md: 0 6px 24px rgba(15,23,42,.08);
  --shadow-lg: 0 20px 60px rgba(15,23,42,.14);

  /* Fonts */
  --font-display: "Cormorant Garamond", "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Inter", "Helvetica Neue", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;

  /* Surfaces */
  --color-bg: #F7F5EF;               /* warm cream */
  --color-surface: #FBFAF6;
  --color-surface-2: #FFFFFF;
  --color-surface-offset: #EFEBE1;
  --color-surface-offset-2: #E4DFD1;
  --color-divider: #D8D2C1;
  --color-border: #C8C1AE;

  /* Text */
  --color-text: #0F2147;             /* Deep navy — brand primary text */
  --color-text-muted: #5A6478;
  --color-text-faint: #9BA3B5;
  --color-text-inverse: #F7F5EF;

  /* Brand */
  --color-primary: #0F2147;          /* Deep navy */
  --color-primary-hover: #0A1936;
  --color-primary-active: #06122A;
  --color-primary-highlight: #E1E3EB;

  --color-accent: #BF953F;           /* Gold */
  --color-accent-hover: #A67C2D;
  --color-accent-active: #8A6520;
  --color-accent-soft: #F1E7CE;

  --color-success: #2E7D5B;
  --color-warning: #B4642A;
  --color-error: #B03A48;
}

[data-theme="dark"] {
  --color-bg: #0A1226;
  --color-surface: #101A34;
  --color-surface-2: #142042;
  --color-surface-offset: #17264F;
  --color-surface-offset-2: #1D2F5F;
  --color-divider: #1E2B4E;
  --color-border: #2A3B65;

  --color-text: #EEEAD9;
  --color-text-muted: #B4B7C4;
  --color-text-faint: #7B8299;
  --color-text-inverse: #0A1226;

  --color-primary: #E9C77B;
  --color-primary-hover: #F1D797;
  --color-primary-active: #F9E4B0;
  --color-primary-highlight: #2A3457;

  --color-accent: #E9C77B;
  --color-accent-hover: #F1D797;
  --color-accent-active: #F9E4B0;
  --color-accent-soft: #253559;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 6px 24px rgba(0,0,0,.45);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.55);
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  hanging-punctuation: first last;
}

body {
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  overflow-x: hidden;
}

img, picture, svg, video { display: block; max-width: 100%; height: auto; }

button { cursor: pointer; background: none; border: none; color: inherit; font: inherit; }
input, textarea, select { font: inherit; color: inherit; }

a { color: var(--color-primary); text-decoration: none; transition: color var(--transition-interactive); }
a:hover { color: var(--color-accent); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--color-text);
  text-wrap: balance;
}
h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); font-weight: 600; }

p, li { text-wrap: pretty; }

::selection { background: var(--color-accent-soft); color: var(--color-primary); }

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

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

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),
    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;
}
