/* ==========================================================================
   DALIA IA v2 – Base Stylesheet
   Reset, Custom Properties, Typography, Dark/Light Mode
   ========================================================================== */

/* --- Fontshare Imports --- */
@import url('https://api.fontshare.com/v2/css?f[]=cabinet-grotesk@400,500,700,800&f[]=satoshi@400,500,700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap');

/* --- CSS Custom Properties --- */
:root {
  /* Brand Colors */
  --color-primary:       #0a7ea4;
  --color-primary-light: #0d9fc8;
  --color-primary-dark:  #066a8a;
  --color-secondary:     #1a3a5c;
  --color-accent:        #2d7d4f;
  --color-accent-light:  #3a9d64;
  --color-petrol:        #003153;
  --color-graphite:      #333333;
  --color-ivory:         #FDFCF0;
  --color-copper:        #B57A59;

  /* Semantic Colors – Light Mode (default) */
  --bg:                  #f4f6f9;
  --bg-alt:              #ffffff;
  --bg-card:             #ffffff;
  --bg-hero:             #003153;
  --text:                #0f1e35;
  --text-muted:          #5a6a7e;
  --text-inverse:        #ffffff;
  --border:              #dce3eb;
  --border-light:        #e8edf2;

  /* Typography */
  --font-display: 'Cabinet Grotesk', 'Inter', sans-serif;
  --font-body:    'Satoshi', 'Inter', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  /* Type Scale */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;
  --text-hero: 3.75rem;

  /* Spacing */
  --space-xs:  0.25rem;
  --space-sm:  0.5rem;
  --space-md:  1rem;
  --space-lg:  1.5rem;
  --space-xl:  2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;
  --space-5xl: 8rem;

  /* Layout */
  --container-max: 1200px;
  --container-narrow: 800px;
  --header-height: 72px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.06);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg:  0 8px 30px rgba(0,0,0,0.12);
  --shadow-xl:  0 20px 60px rgba(0,0,0,0.15);

  /* Transitions */
  --transition-fast:   150ms ease;
  --transition-base:   250ms ease;
  --transition-slow:   400ms ease;
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-index */
  --z-header: 100;
  --z-overlay: 200;
  --z-modal: 300;
}

/* --- Dark Mode --- */
[data-theme="dark"] {
  --bg:          #0b1120;
  --bg-alt:      #111827;
  --bg-card:     #1a2332;
  --bg-hero:     #0b1120;
  --text:        #e8edf2;
  --text-muted:  #8899aa;
  --text-inverse:#0f1e35;
  --border:      #1e2d3d;
  --border-light:#253545;
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.2);
  --shadow-md:   0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg:   0 8px 30px rgba(0,0,0,0.4);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-padding-top: var(--header-height);
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  transition: background-color var(--transition-slow), color var(--transition-slow);
  overflow-x: hidden;
}

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

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-dark);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  letter-spacing: -0.02em;
}

h1 { font-size: var(--text-hero); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); font-weight: 600; }

p { margin-bottom: var(--space-md); }
p:last-child { margin-bottom: 0; }

/* --- Layout Utilities --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-lg);
  padding-right: var(--space-lg);
}

.container--narrow {
  max-width: var(--container-narrow);
}

.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;
}

/* --- Selection --- */
::selection {
  background-color: var(--color-primary);
  color: #fff;
}

/* --- Scrollbar (subtle) --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* --- Responsive --- */
@media (max-width: 768px) {
  :root {
    --text-hero: 2.25rem;
    --text-5xl:  2rem;
    --text-4xl:  1.75rem;
    --text-3xl:  1.5rem;
    --header-height: 60px;
  }
  .container {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }
}
