/* ============================================
   DESIGN SYSTEM — Scandinavian Minimalist Portfolio
   Foundation: Reset, Tokens, Typography, Base
   ============================================ */

/* ---------- CSS Reset (Modern, Minimal) ---------- */

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

html {
  scroll-behavior: smooth;
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

ul,
ol {
  list-style: none;
}

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

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

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

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

table {
  border-collapse: collapse;
}

/* ---------- Design Tokens ---------- */

:root {
  /* Colors */
  --bg-primary: #FAFAF8;
  --bg-secondary: #F0EFEB;
  --bg-tertiary: #E8E7E2;
  --text-primary: #1A1A1A;
  --text-secondary: #6B6B6B;
  --text-muted: #9B9B9B;
  --accent: #5B92E5;
  --accent-hover: #3C78D8;
  --accent-light: rgba(91, 146, 229, 0.1);
  --border: #E5E4E0;
  --surface-glass: rgba(250, 250, 248, 0.72);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.08);

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 24px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 300ms ease;
  --transition-slow: 600ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Typography */
  --font-heading: 'Outfit', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', 'Fira Code', monospace;

  /* Spacing Scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 2rem;
  --space-xl: 4rem;
  --space-2xl: 8rem;
}

/* ---------- Typography Scale ---------- */

.heading-xl {
  font-family: var(--font-heading);
  font-size: 4rem;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.heading-lg {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.heading-md {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  line-height: 1.25;
  font-weight: 600;
  color: var(--text-primary);
}

.heading-sm {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  line-height: 1.3;
  font-weight: 600;
  color: var(--text-primary);
}

.body-lg {
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.7;
  font-weight: 400;
}

.body-md {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  font-weight: 400;
}

.body-sm {
  font-family: var(--font-body);
  font-size: 0.875rem;
  line-height: 1.5;
  font-weight: 400;
}

.caption {
  font-family: var(--font-body);
  font-size: 0.75rem;
  line-height: 1.4;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

/* ---------- Base Styles ---------- */

body {
  background-color: var(--bg-primary);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text-primary);
  font-family: var(--font-heading);
}

h1 {
  font-size: 4rem;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-lg);
}

h2 {
  font-size: 2.5rem;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-md);
}

h3 {
  font-size: 1.75rem;
  line-height: 1.25;
  font-weight: 600;
  margin-bottom: var(--space-md);
}

h4 {
  font-size: 1.25rem;
  line-height: 1.3;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

h5 {
  font-size: 1rem;
  line-height: 1.4;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

h6 {
  font-size: 0.875rem;
  line-height: 1.4;
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

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

::selection {
  background-color: var(--accent-light);
  color: var(--accent);
}

p {
  margin-bottom: var(--space-md);
}

p:last-child {
  margin-bottom: 0;
}

img {
  max-width: 100%;
  display: block;
  height: auto;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background-color: var(--bg-secondary);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-lg) 0;
}
