/* ============================================================
   Crecca B.V. — base.css
   Custom properties, reset, typography, layout primitives
   ============================================================ */

/* ── Custom properties ────────────────────────────────────── */
:root {
  /* Merkkleuren */
  --color-brand:         #e04304;
  --color-brand-hover:   #be3903;
  --color-brand-tint:    #fce8e1;

  /* Basis */
  --color-ink:           #12141a;
  --color-ink-soft:      #2a2e38;
  --color-text:          #1a1d24;
  --color-text-muted:    #5e6573;
  --color-text-on-dark:  #ffffff;

  /* Oppervlakken */
  --color-bg:            #ffffff;
  --color-bg-alt:        #f7f6f4;
  --color-surface:       #ffffff;

  /* Lijnen */
  --color-border:        #e6e4df;
  --color-border-strong: #c9c5bd;

  /* Typografie */
  --font-sans:  "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Source Serif 4", "Georgia", serif;

  /* Maatvoering */
  --container:  1200px;
  --radius:     4px;

  /* Spacing — mobile-first 4px scale */
  --space-3xs: 4px;
  --space-2xs: 8px;
  --space-xs:  12px;
  --space-sm:  16px;
  --space-md:  24px;
  --space-lg:  32px;
  --space-xl:  48px;
  --space-2xl: 64px;
  --space-3xl: 96px;
  --space-4xl: 144px;

  /* Hero — fallback colour (overridden by variant classes in components.css) */
  --hero-bg:      #0d111a;
  --hero-bg-deep: #090e18;

  /* Container side gutter — mobile default */
  --gutter:     16px;

  --ease:       cubic-bezier(0.22, 1, 0.36, 1);
  --transition: 200ms ease;
  --header-h:   60px;
}

@media (min-width: 480px) {
  :root { --gutter: 20px; }
}

@media (min-width: 768px) {
  :root {
    --gutter: 32px;
    --header-h: 68px;
  }
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body, h1, h2, h3, h4, h5, h6, p, ul, ol, figure, blockquote {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

/* ── Body ─────────────────────────────────────────────────── */
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: rgba(224, 67, 4, 0.18);
  overflow-x: hidden;
}

@media (min-width: 768px) {
  body {
    font-size: 17px;
    line-height: 1.65;
  }
}

img, svg  { display: block; max-width: 100%; }
ul        { list-style: none; }
button    { cursor: pointer; border: none; background: none; font: inherit; }
address   { font-style: normal; }
iframe    { border: 0; }

/* ── Typography ───────────────────────────────────────────── */
h1 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.875rem, 6vw, 3.75rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

h2 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.3;
}

p, li { max-width: 68ch; }

/* Body-tekst links (niet nav/btn) */
a {
  color: var(--color-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--color-border-strong);
  transition: color var(--transition), text-decoration-color var(--transition);
}

a:hover {
  color: var(--color-brand);
  text-decoration-color: var(--color-brand);
}

/* ── Layout ───────────────────────────────────────────────── */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
  width: 100%;
}

.section           { padding-block: var(--space-xl); }
@media (min-width: 768px) {
  .section         { padding-block: var(--space-2xl); }
}
@media (min-width: 1024px) {
  .section         { padding-block: var(--space-3xl); }
}
.section--alt      { background: var(--color-bg-alt); }
.section--dark     { background: var(--color-ink); color: var(--color-text-on-dark); }
.section--light    { background: var(--color-surface); }

.section-divider {
  height: 1px;
  background: var(--color-border);
  max-width: var(--container);
  margin-inline: auto;
}

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

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

/* ── Reduced motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Anchor offset for sticky header ──────────────────────── */
:where(main[id], section[id], [id^="anchor-"]) {
  scroll-margin-top: calc(var(--header-h) + 12px);
}
