/* ============================================
   JIG — Just International Group Ltd
   Base CSS — Design Tokens + Reset
   Palette: Deep Navy + Gold (Trust / Private Banking)
   ============================================ */

/* --- Google Fonts preconnect handled in HTML --- */

:root,
[data-theme='light'] {
  /* Surfaces */
  --color-bg: #f5f4f0;
  --color-surface: #fafaf8;
  --color-surface-2: #ffffff;
  --color-surface-offset: #eeece7;
  --color-surface-offset-2: #e5e2db;
  --color-surface-dynamic: #dedad2;
  --color-divider: #d4d0c8;
  --color-border: #c8c4bb;

  /* Text */
  --color-text: #1a1a2e;
  --color-text-muted: #6b6b7a;
  --color-text-faint: #b0b0bc;
  --color-text-inverse: #f5f4f0;

  /* Primary — Deep Navy */
  --color-primary: #1a2a5e;
  --color-primary-hover: #0f1d47;
  --color-primary-active: #091230;
  --color-primary-highlight: #d0d5e8;

  /* Accent — Gold */
  --color-accent: #b8942a;
  --color-accent-hover: #9a7a20;
  --color-accent-active: #7c6118;
  --color-accent-highlight: #f0e8cf;

  /* Functional */
  --color-success: #2d6a2d;
  --color-error: #a12c2c;
  --color-warning: #8a5a00;

  /* Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(26, 42, 94, 0.08);
  --shadow-md: 0 4px 16px rgba(26, 42, 94, 0.10);
  --shadow-lg: 0 12px 40px rgba(26, 42, 94, 0.14);

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
  --content-full: 100%;

  /* 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,    8rem);

  /* 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;
}

[data-theme='dark'] {
  --color-bg: #0e1020;
  --color-surface: #131526;
  --color-surface-2: #171a2e;
  --color-surface-offset: #111320;
  --color-surface-offset-2: #191c30;
  --color-surface-dynamic: #1f2238;
  --color-divider: #252840;
  --color-border: #2e3150;
  --color-text: #e4e4ee;
  --color-text-muted: #8a8a9e;
  --color-text-faint: #5a5a70;
  --color-text-inverse: #0e1020;
  --color-primary: #7b8fd4;
  --color-primary-hover: #9aaae0;
  --color-primary-active: #b8c4eb;
  --color-primary-highlight: #1e2244;
  --color-accent: #d4aa44;
  --color-accent-hover: #e0be60;
  --color-accent-active: #ecd07c;
  --color-accent-highlight: #2e2410;
  --color-success: #4a9e4a;
  --color-error: #d45a5a;
  --color-warning: #c49020;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.25);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.35);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.45);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #0e1020;
    --color-surface: #131526;
    --color-surface-2: #171a2e;
    --color-surface-offset: #111320;
    --color-surface-offset-2: #191c30;
    --color-surface-dynamic: #1f2238;
    --color-divider: #252840;
    --color-border: #2e3150;
    --color-text: #e4e4ee;
    --color-text-muted: #8a8a9e;
    --color-text-faint: #5a5a70;
    --color-text-inverse: #0e1020;
    --color-primary: #7b8fd4;
    --color-primary-hover: #9aaae0;
    --color-primary-active: #b8c4eb;
    --color-primary-highlight: #1e2244;
    --color-accent: #d4aa44;
    --color-accent-hover: #e0be60;
    --color-accent-active: #ecd07c;
    --color-accent-highlight: #2e2410;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.25);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.35);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.45);
  }
}

/* === 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: var(--space-16);
}
body {
  min-height: 100dvh;
  line-height: 1.65;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
}
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 {
  text-wrap: balance;
  line-height: 1.2;
  font-family: var(--font-display);
}
p, li, figcaption {
  text-wrap: pretty;
  max-width: 72ch;
}
::selection {
  background: rgba(26, 42, 94, 0.2);
  color: var(--color-text);
}
: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: 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 { color: inherit; text-decoration: none; }
