/* Vigilis Tree Shelters – Typography System */
/* Font: Lexend — self-hosted WOFF2 (v26, latin, weights 300/400/500/700) */

@font-face {
  font-family: 'Lexend';
  src: url('../assets/fonts/lexend-300.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Lexend';
  src: url('../assets/fonts/lexend-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Lexend';
  src: url('../assets/fonts/lexend-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Lexend';
  src: url('../assets/fonts/lexend-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Font Family */
  --font-family-base: "Lexend", system-ui, -apple-system, sans-serif;
  --font-family-mono: "Menlo", "Monaco", "Courier New", monospace;

  /* Font Sizes */
  --font-size-xs: 12px;
  --font-size-sm: 14px;
  --font-size-base: 16px;
  --font-size-lg: 18px;
  --font-size-xl: 20px;
  --font-size-2xl: 24px;
  --font-size-3xl: 32px;
  --font-size-4xl: 40px;
  --font-size-5xl: 48px;
  --font-size-display: 80px;
  --font-size-display-2: 90px;

  /* Font Weights */
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;

  /* Line Heights */
  --line-height-none: 1;
  --line-height-tight: 1.2;
  --line-height-snug: 1.375;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.6;
  --line-height-loose: 2;

  /* Letter Spacing */
  --letter-spacing-normal: 0;
  --letter-spacing-wide: 0.05em;
}

/* Global Font Settings */
html {
  font-family: var(--font-family-base);
  font-size: 16px;
  line-height: var(--line-height-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-primary);
}

/* Heading Styles – Fluid Typography (Responsive scaling) */
h1,
.h1 {
  /* Scales from 36px on mobile to 80px on desktop */
  font-size: clamp(36px, 8vw, 80px);
  font-weight: var(--font-weight-bold);
  line-height: 1.2;
  margin: 0 0 var(--spacing-4) 0;
  letter-spacing: var(--letter-spacing-normal);
}

h2,
.h2 {
  /* Scales from 28px on mobile to 48px on desktop */
  font-size: clamp(28px, 6vw, 48px);
  font-weight: var(--font-weight-bold);
  line-height: 1.2;
  margin: 0 0 var(--spacing-4) 0;
  letter-spacing: var(--letter-spacing-normal);
}

h3,
.h3 {
  /* Scales from 20px on mobile to 32px on desktop */
  font-size: clamp(20px, 4vw, 32px);
  font-weight: var(--font-weight-bold);
  line-height: 1.2;
  margin: 0 0 var(--spacing-4) 0;
  letter-spacing: var(--letter-spacing-normal);
}

h4,
.h4 {
  /* Scales from 18px on mobile to 24px on desktop */
  font-size: clamp(18px, 3vw, 24px);
  font-weight: var(--font-weight-bold);
  line-height: 1.2;
  margin: 0 0 var(--spacing-3) 0;
  letter-spacing: var(--letter-spacing-normal);
}

h5,
.h5 {
  /* Scales from 16px on mobile to 18px on desktop */
  font-size: clamp(16px, 2.5vw, 18px);
  font-weight: var(--font-weight-bold);
  line-height: 1.2;
  margin: 0 0 var(--spacing-3) 0;
  letter-spacing: var(--letter-spacing-normal);
}

h6,
.h6 {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
  line-height: 1.2;
  margin: 0 0 var(--spacing-3) 0;
  letter-spacing: var(--letter-spacing-normal);
}

/* Body Text Styles – Responsive sizing for mobile UX */
p {
  margin: 0 0 var(--spacing-4) 0;
  /* Smaller on small mobile for better line length and readability */
  font-size: 15px;
}

@media (max-width: 479px) {
  p {
    font-size: 14px; /* Better line length on narrow screens (50-75 chars) */
  }
}

@media (min-width: 480px) and (max-width: 639px) {
  p {
    font-size: 15px;
  }
}

@media (min-width: 640px) {
  p {
    font-size: 16px; /* Standard desktop size */
  }
}

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

/* Text Utilities */
.text-xs {
  font-size: var(--font-size-xs);
}

.text-xs-light {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-light);
}

.text-xs-medium {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
}

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

.text-sm-light {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-light);
}

.text-sm-medium {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

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

.text-base-light {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-light);
}

.text-base-medium {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
}

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

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

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

.text-xl-medium {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-medium);
}

.text-3xl {
  font-size: var(--font-size-3xl);
}

.text-3xl-light {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-light);
}

/* Emphasis Styles */
strong,
b {
  font-weight: var(--font-weight-bold);
}

em,
i {
  font-style: italic;
}

small {
  font-size: 0.875em;
}

code {
  font-family: var(--font-family-mono);
  font-size: 0.875em;
  background-color: var(--color-bg-secondary);
  padding: 2px 6px;
  border-radius: 4px;
}

pre {
  font-family: var(--font-family-mono);
  font-size: 0.875em;
  background-color: var(--color-neutral-1000);
  color: var(--color-neutral-white);
  padding: var(--spacing-4);
  border-radius: 8px;
  overflow-x: auto;
  line-height: var(--line-height-relaxed);
}

/* Lists */
ul,
ol {
  margin: 0 0 var(--spacing-4) 0;
  padding-left: var(--spacing-6);
}

li {
  margin-bottom: var(--spacing-3);
}

/* Blockquote */
blockquote {
  border-left: 4px solid var(--color-primary-500);
  padding-left: var(--spacing-4);
  margin: var(--spacing-6) 0;
  font-style: italic;
  color: var(--color-text-secondary);
}

/* Links */
a {
  color: var(--color-primary-800);
  text-decoration: none;
  transition: color 200ms ease-in-out;
}

a:hover {
  color: var(--color-primary-600);
  text-decoration: none;
}

a:active {
  color: var(--color-primary-800);
}

/* Selection */
::selection {
  background-color: var(--color-primary-300);
  color: var(--color-text-primary);
}

::-moz-selection {
  background-color: var(--color-primary-300);
  color: var(--color-text-primary);
}
