/* ==================================================================
   BASE — Reset, tokens, typography
   ================================================================== */

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

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -moz-tab-size: 4;
  tab-size: 4;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-family: 'General Sans', system-ui, -apple-system, Segoe UI, sans-serif;
  font-weight: 400;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

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

img {
  height: auto;
}

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

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

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

h1, h2, h3, h4, h5, h6 {
  font-family: 'General Sans', system-ui, sans-serif;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
}

ul, ol {
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background: var(--text);
  color: var(--bg);
}

/* -----------------------------------------------
   DESIGN TOKENS — Steel industrial palette
   ----------------------------------------------- */

:root {
  /* Palette — LIGHT MODE */
  --bg: #ffffff;
  --bg-alt: #f5f5f5;
  --bg-dark: #1a1a1a;
  --bg-dark-alt: #2b2b2b;

  --text: #1a1a1a;
  --text-muted: #666666;
  --text-on-dark: #ffffff;
  --text-on-dark-muted: #b0b0b0;

  --border: #e0e0e0;
  --border-dark: #333333;

  --accent: #c0c0c0;  /* silver */
  --card: #ffffff;
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  --card-shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.12);

  /* Typography scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.5rem;
  --text-4xl: 3.5rem;
  --text-hero: clamp(2.5rem, 6vw, 5rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Layout */
  --container: 1280px;
  --container-narrow: 960px;
  --radius: 2px;
  --radius-md: 6px;
  --radius-lg: 12px;

  --nav-height: 72px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* DARK MODE */
[data-theme="dark"] {
  --bg: #1a1a1a;
  --bg-alt: #2b2b2b;
  --bg-dark: #0f0f0f;
  --bg-dark-alt: #1a1a1a;

  --text: #ffffff;
  --text-muted: #b0b0b0;

  --border: #333333;
  --border-dark: #444444;

  --card: #2b2b2b;
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  --card-shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.5);
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

@media (min-width: 768px) {
  .container {
    padding-inline: var(--space-8);
  }
}

/* Utility classes */
.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;
}
