/* ============================================================
   AtLaS – main.css
   Global styles, CSS custom properties, typography, layout
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

/* ── Custom Properties ───────────────────────────────────── */
:root {
  /* Colours */
  --color-primary:      #0d1117;
  --color-bg:           #ffffff;
  --color-surface:      #f5f5f3;
  --color-surface-2:    #ebebea;
  --color-accent:       #1D9E75;
  --color-accent-dark:  #157a5b;
  --color-accent-light: #e8f7f2;
  --color-border:       rgba(13, 17, 23, 0.12);
  --color-border-strong:rgba(13, 17, 23, 0.25);
  --color-muted:        #6b7280;
  --color-error:        #dc2626;

  /* Typography */
  --font-heading: 'DM Serif Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, -apple-system, sans-serif;

  /* Font sizes */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;
  --text-6xl:  3.75rem;

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

  /* Layout */
  --max-width:        1200px;
  --content-width:    720px;
  --nav-height:       68px;
  --border-radius:    6px;
  --border-radius-lg: 12px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
}

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

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--color-primary);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

ul, ol { list-style: none; }

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

input, textarea, select { font: inherit; }

/* ── Typography ───────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(var(--text-3xl), 5vw, var(--text-6xl)); }
h2 { font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl)); }
h3 { font-size: clamp(var(--text-xl),  3vw, var(--text-3xl)); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p { max-width: 68ch; }

.text-muted  { color: var(--color-muted); }
.text-accent { color: var(--color-accent); }
.text-sm     { font-size: var(--text-sm); }
.text-lg     { font-size: var(--text-lg); }

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

.section      { padding-block: var(--space-20); }
.section--sm  { padding-block: var(--space-12); }
.section--lg  { padding-block: var(--space-32); }

.section--surface { background: var(--color-surface); }
.section--surface-2 { background: var(--color-surface-2); }

.section--dark {
  background: var(--color-primary);
  color: var(--color-bg);
}

/* ── Grid utilities ───────────────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-8);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
}

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .grid-2,
  .grid-3,
  .grid-4 { grid-template-columns: 1fr; }
  .container { padding-inline: var(--space-4); }
}

/* ── Section header ───────────────────────────────────────── */
.section-header { margin-bottom: var(--space-12); }

.section-header--center { text-align: center; }
.section-header--center p { margin-inline: auto; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-3);
}

.section-header h2 { margin-bottom: var(--space-4); }
.section-header p {
  color: var(--color-muted);
  font-size: var(--text-lg);
}

/* ── Page header ──────────────────────────────────────────── */
.page-header {
  padding-block: var(--space-20) var(--space-16);
  border-bottom: 0.5px solid var(--color-border);
}

.page-header h1 { margin-bottom: var(--space-5); }

.page-header p {
  font-size: var(--text-lg);
  color: var(--color-muted);
  max-width: 60ch;
}

/* ── Breadcrumb ───────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-muted);
  margin-bottom: var(--space-8);
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--color-muted);
  transition: color var(--transition-fast);
}
.breadcrumb a:hover { color: var(--color-accent); }
.breadcrumb .sep { color: var(--color-border-strong); }
.breadcrumb .current { color: var(--color-primary); }

/* ── Divider ──────────────────────────────────────────────── */
hr {
  border: none;
  border-top: 0.5px solid var(--color-border);
  margin-block: var(--space-8);
}

/* ── Utilities ────────────────────────────────────────────── */
.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;
}

.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2  { gap: var(--space-2); }
.gap-4  { gap: var(--space-4); }
.gap-6  { gap: var(--space-6); }
.gap-8  { gap: var(--space-8); }
.mt-auto { margin-top: auto; }

@media print {
  nav, footer, .cta-banner { display: none; }
  body { font-size: 11pt; }
}
