/* ============================================================
   THE EXETER — Design System Foundation
   ============================================================
   Fonts: FS Me (headings, local), Inter (body, Google Fonts)
   Palette: Exeter Yellow #FFED00, Charcoal #525251,
            Near-black #1D1D1B, Warm greys #FCFCFB → #6C6967
   ============================================================ */

/* ----- @font-face: FS Me ----- */
@font-face {
  font-family: 'FS Me';
  src: url('../assets/fonts/FSMe-Light.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'FS Me';
  src: url('../assets/fonts/FSMe-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'FS Me';
  src: url('../assets/fonts/FSMe-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'FS Me';
  src: url('../assets/fonts/FSMe-Heavy.otf') format('opentype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'FS Me';
  src: url('../assets/fonts/FSMe-Italic.otf') format('opentype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'FS Me';
  src: url('../assets/fonts/FSMe-BoldItalic.otf') format('opentype');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

/* ----- CSS Custom Properties ----- */
:root {
  /* Brand colours */
  --exeter-yellow: #FFED00;
  --charcoal: #525251;
  --near-black: #1D1D1B;
  --white: #FFFFFF;

  /* Warm greys (light → dark) */
  --grey-50: #FCFCFB;
  --grey-100: #F5F4F2;
  --grey-200: #EDECEA;
  --grey-300: #D6D4D1;
  --grey-400: #B0ADA9;
  --grey-500: #8A8784;
  --grey-600: #6C6967;

  /* Semantic aliases */
  --text-primary: var(--near-black);
  --text-secondary: var(--charcoal);
  --text-muted: var(--grey-500);
  --text-inverse: var(--white);
  --accent: var(--exeter-yellow);
  --bg-white: var(--white);
  --bg-light: var(--grey-50);
  --bg-alt: var(--grey-100);
  --bg-dark: var(--near-black);
  --border-light: var(--grey-200);
  --border-dark: var(--grey-300);

  /* Typography */
  --font-heading: 'FS Me', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;

  /* Spacing scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;
  --space-5xl: 8rem;

  /* Layout */
  --max-width: 1200px;
  --max-width-narrow: 800px;
  --max-width-text: 680px;
  --header-height: 64px;

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

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(29, 29, 27, 0.06);
  --shadow-md: 0 4px 12px rgba(29, 29, 27, 0.08);
  --shadow-lg: 0 8px 30px rgba(29, 29, 27, 0.12);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--bg-white);
}

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

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

/* ----- Typography ----- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.05em; }

p {
  max-width: 70ch;
  margin-bottom: 1em;
}

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

.lead {
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--text-secondary);
  font-weight: 300;
}

.overline {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.text-large {
  font-size: 1.125rem;
  line-height: 1.7;
}

.text-small {
  font-size: 0.875rem;
  line-height: 1.6;
}

.text-xs {
  font-size: 0.75rem;
  line-height: 1.5;
}

/* ----- Layout Containers ----- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

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

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

/* ----- Sections ----- */
.section {
  padding: var(--space-5xl) 0;
  position: relative;
}

.section--white { background-color: var(--bg-white); }
.section--light { background-color: var(--bg-light); }
.section--alt   { background-color: var(--bg-alt); }
.section--dark  {
  background-color: var(--bg-dark);
  color: var(--text-inverse);
}
.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4,
.section--dark h5,
.section--dark h6 {
  color: var(--text-inverse);
}
.section--dark .lead,
.section--dark p {
  color: var(--grey-300);
}
.section--dark .overline {
  color: var(--grey-400);
}

/* Compact section variant */
.section--compact {
  padding: var(--space-3xl) 0;
}

/* ----- Grid Systems ----- */
.grid {
  display: grid;
  gap: var(--space-xl);
}

.grid--2     { grid-template-columns: repeat(2, 1fr); }
.grid--3     { grid-template-columns: repeat(3, 1fr); }
.grid--4     { grid-template-columns: repeat(4, 1fr); }
.grid--60-40 { grid-template-columns: 3fr 2fr; }
.grid--40-60 { grid-template-columns: 2fr 3fr; }

.grid--gap-sm { gap: var(--space-md); }
.grid--gap-lg { gap: var(--space-3xl); }

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

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

/* ----- Full-Height Split Panels ----- */
.split-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

.split-panel__left,
.split-panel__right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3xl);
}

.split-panel__left--dark {
  background-color: var(--bg-dark);
  color: var(--text-inverse);
}

.split-panel__right--light {
  background-color: var(--bg-light);
}

@media (max-width: 768px) {
  .split-panel {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .split-panel__left,
  .split-panel__right {
    padding: var(--space-3xl) var(--space-xl);
    min-height: 60vh;
  }
}

/* ----- Utility: Colour ----- */
.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.text-inverse   { color: var(--text-inverse); }
.text-accent    { color: var(--accent); }

.bg-white { background-color: var(--bg-white); }
.bg-light { background-color: var(--bg-light); }
.bg-alt   { background-color: var(--bg-alt); }
.bg-dark  { background-color: var(--bg-dark); }

/* ----- Utility: Spacing ----- */
.mt-0  { margin-top: 0; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }
.mt-3xl { margin-top: var(--space-3xl); }

.mb-0  { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }
.mb-3xl { margin-bottom: var(--space-3xl); }

/* ----- Utility: Flex ----- */
.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.flex-wrap    { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* ----- Utility: Text ----- */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }
.font-light  { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-bold   { font-weight: 700; }
.font-heavy  { font-weight: 900; }
.uppercase   { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.05em; }
.tracking-wider { letter-spacing: 0.12em; }

/* ----- Utility: Display ----- */
.block  { display: block; }
.hidden { display: none; }

@media (max-width: 768px) {
  .hide-mobile { display: none; }
}

@media (min-width: 769px) {
  .hide-desktop { display: none; }
}

/* ----- Utility: Misc ----- */
.relative { position: relative; }
.overflow-hidden { overflow: hidden; }
.rounded { border-radius: 4px; }
.rounded-lg { border-radius: 8px; }

/* ----- Selection ----- */
::selection {
  background-color: var(--exeter-yellow);
  color: var(--near-black);
}
