@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;1,400&family=Open+Sans:wght@400;600;700&display=swap');

/* ================================================
   CSS Custom Properties — Brand Tokens
   All colour, type, and spacing values live here.
   Never hardcode hex values outside this block.
   ================================================ */
:root {
  /* Brand Colours */
  --c-primary:        #105580;
  --c-primary-dark:   #0d3f60;
  --c-primary-light:  #e8f2f8;
  --c-accent:         #f95758;
  --c-accent-dark:    #e04445;
  --c-steel:          #809eb1;
  --c-charcoal:       #4a4a4a;
  --c-ivory:          #f5f5f0;
  --c-teal:           #3a6f75;
  --c-slate:          #6c7a89;
  --c-white:          #ffffff;
  --c-dark:           #1a1a1a;

  /* Typography */
  --font-heading: 'Open Sans', Arial, sans-serif;
  --font-body:    'EB Garamond', Georgia, 'Times New Roman', serif;

  /* Font Sizes — digital scale */
  --text-xs:   0.75rem;   /* 12px */
  --text-sm:   0.875rem;  /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-lg:   1.125rem;  /* 18px */
  --text-xl:   1.25rem;   /* 20px */
  --text-2xl:  1.375rem;  /* 22px */
  --text-3xl:  1.75rem;   /* 28px */
  --text-4xl:  2rem;      /* 32px */
  --text-5xl:  2.5rem;    /* 40px */
  --text-6xl:  3.5rem;    /* 56px */

  /* Font Weights */
  --fw-regular:  400;
  --fw-semibold: 600;
  --fw-bold:     700;

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

  /* Layout — fluid: ~1152px laptop → ~1440px+ large screens */
  --container-max:  clamp(72rem, 90vw, 90rem);
  --container-wide: clamp(76rem, 94vw, 96rem);
  --nav-height:     80px;

  /* Borders */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;

  /* Shadows */
  --shadow-sm: 0 1px 4px rgba(16, 85, 128, 0.08);
  --shadow-md: 0 4px 16px rgba(16, 85, 128, 0.12);
  --shadow-lg: 0 8px 32px rgba(16, 85, 128, 0.18);

  /* Transitions */
  --t-fast: 0.15s ease;
  --t:      0.25s ease;
  --t-slow: 0.4s ease;
}

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

html {
  font-size: 18px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.75;
  color: var(--c-charcoal);
  background-color: var(--c-white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a {
  color: var(--c-primary);
  text-decoration: none;
  transition: color var(--t-fast);
}

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

ul,
ol {
  list-style: none;
}

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

input,
textarea,
select {
  font-family: var(--font-body);
  font-size: var(--text-base);
}

address {
  font-style: normal;
}

/* ================================================
   Typography
   ================================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  color: var(--c-primary);
  line-height: 1.2;
  font-weight: var(--fw-bold);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); font-weight: var(--fw-semibold); }
h3 { font-size: var(--text-xl);  font-weight: var(--fw-semibold); }
h4 { font-size: var(--text-lg);  font-weight: var(--fw-semibold); }

p {
  margin-bottom: var(--sp-4);
}

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

strong {
  font-weight: var(--fw-bold);
}

em {
  font-style: italic;
}

.lead {
  font-size: var(--text-xl);
  line-height: 1.65;
  color: var(--c-charcoal);
}

.text-sm      { font-size: var(--text-sm); }
.text-lg      { font-size: var(--text-lg); }
.text-center  { text-align: center; }
.text-primary { color: var(--c-primary); }
.text-accent  { color: var(--c-accent); }
.text-white   { color: var(--c-white); }
.text-muted   { color: var(--c-slate); }

/* ================================================
   Layout — Container & Grid
   ================================================ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--sp-6);
}

.container--wide {
  max-width: var(--container-wide);
}

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

.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-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); }
.gap-8 { gap: var(--sp-8); }

/* ================================================
   Section Spacing
   ================================================ */
.section    { padding-block: var(--sp-20); }
.section--sm { padding-block: var(--sp-12); }
.section--lg { padding-block: var(--sp-24); }

.section-header {
  margin-bottom: var(--sp-12);
  text-align: center;
}

.section-header .label {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: var(--sp-3);
}

.section-header h2 {
  margin-bottom: var(--sp-4);
}

.section-header p {
  max-width: 600px;
  margin-inline: auto;
  color: var(--c-slate);
  font-size: var(--text-lg);
}

/* ================================================
   Backgrounds
   ================================================ */
.bg-primary { background-color: var(--c-primary); color: var(--c-white); }
.bg-ivory   { background-color: var(--c-ivory); }
.bg-white   { background-color: var(--c-white); }
.bg-dark    { background-color: var(--c-dark);    color: var(--c-white); }

.bg-primary h1,
.bg-primary h2,
.bg-primary h3,
.bg-primary h4,
.bg-dark h1,
.bg-dark h2,
.bg-dark h3,
.bg-dark h4 {
  color: var(--c-white);
}

/* ================================================
   Utility
   ================================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.divider {
  width: 60px;
  height: 3px;
  background-color: var(--c-accent);
  margin-bottom: var(--sp-6);
  border-radius: 2px;
}

.divider--center {
  margin-inline: auto;
}

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

@media (max-width: 768px) {
  :root {
    --nav-height: 72px;
  }

  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }

  .grid-2,
  .grid-3,
  .grid-4 { grid-template-columns: 1fr; }

  .section    { padding-block: var(--sp-12); }
  .section--lg { padding-block: var(--sp-16); }

  .section-header {
    margin-bottom: var(--sp-8);
  }

  .lead {
    font-size: var(--text-lg);
  }
}

@media (max-width: 480px) {
  .container { padding-inline: var(--sp-4); }
  h1 { font-size: var(--text-2xl); }
  h2 { font-size: var(--text-xl); }

  .btn--lg {
    width: 100%;
    justify-content: center;
  }
}

/* ================================================
   Scroll Reveal
   Elements with [data-reveal] slide and fade up
   when they enter the viewport.
   ================================================ */
[data-reveal] {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-reveal].visible {
  opacity: 1;
  transform: translateY(0);
}

/* ================================================
   Mouse-Parallax Grid Background
   Very subtle dot grid that shifts with the cursor.
   --grid-x / --grid-y are set by main.js.
   ================================================ */
.bg-white,
.bg-ivory {
  background-image:
    radial-gradient(circle, rgba(16, 85, 128, 0.06) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: var(--grid-x, 0px) var(--grid-y, 0px);
}
