/* ==========================================================================
   Nebiatek — Design System
   Tokens, resets, typography, and base element styling.
   Source of truth: /docs/design/design-system.md
   ========================================================================== */

/* --- Google Fonts -------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@400;700&family=Montserrat:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

/* --- Design Tokens ------------------------------------------------------- */
:root {
  /* Brand palette */
  --color-deep-teal:   #194951;
  --color-orange:      #F18618;
  --color-warm-beige:  #E2CEBC;
  --color-bright-teal: #18B3B3;
  --color-soft-teal:   #81CAD2;
  --color-off-white:   #FAFCFF;

  /* Semantic roles */
  --color-text-primary:   var(--color-deep-teal);
  --color-text-secondary: #3a6970;
  --color-text-muted:     #6a8f94;
  --color-text-on-dark:   #f0f4f5;
  --color-text-on-dark-muted: #b0cdd2;
  --color-accent:         var(--color-orange);
  --color-surface:        var(--color-off-white);
  --color-surface-warm:   var(--color-warm-beige);
  --color-background:     #ffffff;
  --color-dark-bg:        var(--color-deep-teal);
  --color-dark-bg-deep:   #112f34;

  /* Typography */
  --font-primary: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-accent:  'Comfortaa', 'Montserrat', sans-serif;

  --fw-regular:  400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;

  /* Type scale (fluid-ish, desktop-first, adjusted via media queries) */
  --text-xs:   0.75rem;   /* 12px */
  --text-sm:   0.875rem;  /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-md:   1.125rem;  /* 18px */
  --text-lg:   1.25rem;   /* 20px */
  --text-xl:   1.5rem;    /* 24px */
  --text-2xl:  1.875rem;  /* 30px */
  --text-3xl:  2.25rem;   /* 36px */
  --text-4xl:  3rem;      /* 48px */
  --text-5xl:  3.5rem;    /* 56px */

  --leading-tight:  1.2;
  --leading-normal: 1.6;
  --leading-relaxed: 1.8;

  /* Spacing scale (4px base) */
  --space-1:  0.25rem;   /* 4px  */
  --space-2:  0.5rem;    /* 8px  */
  --space-3:  0.75rem;   /* 12px */
  --space-4:  1rem;      /* 16px */
  --space-5:  1.25rem;   /* 20px */
  --space-6:  1.5rem;    /* 24px */
  --space-8:  2rem;      /* 32px */
  --space-10: 2.5rem;    /* 40px */
  --space-12: 3rem;      /* 48px */
  --space-16: 4rem;      /* 64px */
  --space-20: 5rem;      /* 80px */
  --space-24: 6rem;      /* 96px */
  --space-30: 7.5rem;    /* 120px */

  /* Layout */
  --container-max: 1200px;
  --container-narrow: 880px;
  --container-wide: 1400px;

  /* Radius — controlled and mature, never bubbly */
  --radius-sm:  4px;
  --radius-md:  6px;
  --radius-lg:  8px;
  --radius-xl:  12px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:   0 1px 3px rgba(25, 73, 81, 0.06), 0 1px 2px rgba(25, 73, 81, 0.04);
  --shadow-md:   0 4px 12px rgba(25, 73, 81, 0.08), 0 2px 4px rgba(25, 73, 81, 0.04);
  --shadow-lg:   0 8px 24px rgba(25, 73, 81, 0.10), 0 4px 8px rgba(25, 73, 81, 0.04);
  --shadow-card: 0 2px 8px rgba(25, 73, 81, 0.06);
  --shadow-card-hover: 0 8px 28px rgba(25, 73, 81, 0.12), 0 4px 10px rgba(25, 73, 81, 0.06);

  /* Transitions — smooth, not theatrical */
  --ease-out:  cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast:   150ms;
  --duration-normal: 250ms;
  --duration-slow:   400ms;
}

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

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary);
  font-weight: var(--fw-regular);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
  background-color: var(--color-background);
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--fw-semibold);
  line-height: var(--leading-tight);
  color: var(--color-text-primary);
}

p {
  max-width: 70ch;
}

/* --- Base Typography ----------------------------------------------------- */
h1 {
  font-size: var(--text-5xl);
  font-weight: var(--fw-bold);
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--text-3xl);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.01em;
}

h3 {
  font-size: var(--text-xl);
  font-weight: var(--fw-semibold);
}

h4 {
  font-size: var(--text-lg);
  font-weight: var(--fw-medium);
}

/* --- Utility Classes ----------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

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

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

.text-accent {
  font-family: var(--font-accent);
}

.text-center {
  text-align: center;
}

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

/* --- Responsive Base Typography ------------------------------------------ */
@media (max-width: 1023px) {
  h1 { font-size: var(--text-4xl); }
  h2 { font-size: var(--text-2xl); }
  h3 { font-size: var(--text-xl); }
}

@media (max-width: 767px) {
  :root {
    --text-5xl: 2.5rem;
    --text-4xl: 2rem;
    --text-3xl: 1.75rem;
    --text-2xl: 1.5rem;
  }

  .container {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
}
