/* TrawlingWeb shared design system — base
 * Reset + tokens + typography. Each site overrides only --primary in its own CSS.
 */

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

html { -webkit-text-size-adjust: 100%; -moz-tab-size: 4; tab-size: 4; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-main);
  background: var(--bg-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:root {
  --bg-main: #ffffff;
  --bg-soft: #f7f8fa;
  --bg-dark: #0f1419;
  --text-main: #0f1419;
  --text-muted: #5b6470;
  --text-soft: #8a93a0;
  --text-inverse: #ffffff;
  --border: #e6e8ec;
  --border-strong: #cfd4dc;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff4ff;
  --primary-on-dark: #93b6ff;
  --accent: #0ea5e9;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 20, 25, 0.05);
  --shadow: 0 4px 16px rgba(15, 20, 25, 0.08);
  --shadow-lg: 0 16px 48px rgba(15, 20, 25, 0.12);
  --container: 1200px;
  --container-narrow: 880px;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 0.6em;
  color: var(--text-main);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.4rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.6rem); }
h4 { font-size: 1.15rem; }

p { margin: 0 0 1em; }
p.lead { font-size: 1.2rem; color: var(--text-muted); line-height: 1.6; }

a { color: var(--primary); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--primary-hover); }
a.underline { text-decoration: underline; text-underline-offset: 3px; }

ul, ol { padding-left: 1.4em; margin: 0 0 1em; }
li + li { margin-top: 0.4em; }

code, pre, kbd, samp {
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, Menlo, monospace;
  font-size: 0.92em;
}
code { background: var(--bg-soft); padding: 0.1em 0.4em; border-radius: var(--radius-sm); }
pre {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1em 1.2em;
  overflow-x: auto;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.5em 0;
}

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

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

::selection { background: var(--primary-soft); color: var(--primary-hover); }

/* Container */
.container { max-width: var(--container); margin: 0 auto; padding: 0 1.5rem; }
.container-narrow { max-width: var(--container-narrow); margin: 0 auto; padding: 0 1.5rem; }

/* Spacing utilities */
.section { padding: 5rem 0; }
.section-sm { padding: 3rem 0; }
.section-lg { padding: 7rem 0; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-soft { color: var(--text-soft); }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

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

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