/* ============================================================
   BASE — Design tokens, reset, typography, font-face
   Grande Insurance Kft.
   ============================================================ */

/* --- Font face --- */
@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-var-latin-ext.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-024F, U+2000-206F, U+20AC;
}

/* --- Custom properties --- */
:root {
  /* Brand palette — derived from logo */
  --color-primary: #2d5f6e;
  --color-primary-light: #3a7a8c;
  --color-primary-dark: #1e4450;
  --color-primary-muted: #2d5f6e1a;

  /* Warm neutrals — the signature */
  --color-surface: #f0edea;
  --color-surface-alt: #e8e4e0;
  --color-surface-raised: #ffffff;
  --color-surface-sunken: #ddd8d3;

  /* Navy accent — deeper authority */
  --color-accent: #1a2f3a;
  --color-accent-light: #2a4a5a;

  /* Copper/amber warm accent — for CTAs and highlights */
  --color-warm: #b8860b;
  --color-warm-light: #d4a024;
  --color-warm-dark: #946b09;

  /* Text hierarchy */
  --color-text: #1a2a30;
  --color-text-secondary: #4a6068;
  --color-text-muted: #7a8e94;
  --color-text-inverse: #f0edea;

  /* Semantic */
  --color-success: #2d6e4a;
  --color-error: #9b2c2c;
  --color-warning: #8a6d12;
  --color-info: var(--color-primary);

  /* Borders */
  --color-border: #d0cac4;
  --color-border-light: #e0dbd6;
  --color-border-focus: var(--color-primary);

  /* Spacing — 0.5rem base (8px) */
  --space-unit: 0.5rem;
  --space-1: calc(var(--space-unit) * 1);   /* 8px */
  --space-2: calc(var(--space-unit) * 2);   /* 16px */
  --space-3: calc(var(--space-unit) * 3);   /* 24px */
  --space-4: calc(var(--space-unit) * 4);   /* 32px */
  --space-5: calc(var(--space-unit) * 5);   /* 40px */
  --space-6: calc(var(--space-unit) * 6);   /* 48px */
  --space-7: calc(var(--space-unit) * 8);   /* 64px */
  --space-8: calc(var(--space-unit) * 12);  /* 96px */

  /* Typography scale — major third (1.25) */
  --text-xs: 0.75rem;     /* 12px */
  --text-sm: 0.875rem;    /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-lg: 1.125rem;    /* 18px */
  --text-xl: 1.25rem;     /* 20px */
  --text-2xl: 1.5rem;     /* 24px */
  --text-3xl: 1.875rem;   /* 30px */
  --text-4xl: 2.25rem;    /* 36px */
  --text-5xl: 3rem;       /* 48px */
  --text-6xl: 3.75rem;    /* 60px */

  /* Line heights */
  --leading-tight: 1.15;
  --leading-snug: 1.3;
  --leading-normal: 1.6;
  --leading-relaxed: 1.75;

  /* Letter spacing */
  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.02em;
  --tracking-wider: 0.05em;
  --tracking-widest: 0.1em;

  /* Radii */
  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Shadows — warm-tinted */
  --shadow-sm: 0 1px 2px rgba(26, 42, 48, 0.06);
  --shadow-md: 0 2px 8px rgba(26, 42, 48, 0.08), 0 1px 3px rgba(26, 42, 48, 0.04);
  --shadow-lg: 0 8px 24px rgba(26, 42, 48, 0.1), 0 2px 8px rgba(26, 42, 48, 0.04);
  --shadow-xl: 0 16px 48px rgba(26, 42, 48, 0.12), 0 4px 16px rgba(26, 42, 48, 0.06);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;

  /* Layout */
  --header-height: 4rem;
  --container-max: 1200px;
  --container-narrow: 800px;
  --container-wide: 1400px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  hanging-punctuation: first last;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: var(--text-base);
  font-weight: 400;
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv01', 'cv02', 'cv03', 'cv04';
  text-rendering: optimizeLegibility;
}

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

img {
  height: auto;
}

[id] {
  scroll-margin-top: calc(var(--header-height) + 1rem);
}

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

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

a {
  color: var(--color-primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
  transition: color var(--duration-fast) var(--ease-out);
}

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

ul,
ol {
  list-style: none;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-accent);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}

h1 {
  font-size: var(--text-4xl);
  font-weight: 800;
  letter-spacing: -0.03em;
}

h2 {
  font-size: var(--text-3xl);
  font-weight: 700;
}

h3 {
  font-size: var(--text-2xl);
  font-weight: 600;
}

h4 {
  font-size: var(--text-xl);
  font-weight: 600;
}

h5 {
  font-size: var(--text-lg);
  font-weight: 600;
}

h6 {
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

@media (min-width: 768px) {
  h1 { font-size: var(--text-5xl); }
  h2 { font-size: var(--text-4xl); }
  h3 { font-size: var(--text-3xl); }
}

@media (min-width: 1024px) {
  h1 { font-size: var(--text-6xl); }
}

p {
  text-wrap: pretty;
}

p + p {
  margin-top: var(--space-3);
}

strong, b {
  font-weight: 650;
}

small {
  font-size: var(--text-sm);
}

/* Section labels — uppercase teal marker */
.section-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.section-label::before {
  content: '';
  width: 24px;
  height: 2px;
  background: var(--color-primary);
  flex-shrink: 0;
}

/* --- Focus --- */
:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* --- Selection --- */
::selection {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

/* --- Scrollbar (subtle) --- */
@supports (scrollbar-width: thin) {
  html {
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
  }
}
