/* =============================================
   BASE STYLES
   Reset, Custom Properties, Typography, Layout
   Theme colours & fonts are in theme.css
   ============================================= */

/* --- Custom Properties (non-theme) --- */
:root {
  --text-xs: 0.8125rem;
  --text-sm: 1rem;
  --text-base: 1.0625rem;
  --text-md: 1.1875rem;
  --text-lg: 1.375rem;
  --text-xl: 1.625rem;
  --text-2xl: 2rem;
  --text-3xl: 2.375rem;
  --text-4xl: 3rem;

  /* Heading sizes (overridable per font pairing in theme.css) */
  --text-h1: var(--text-3xl);          /* mobile: 38px */
  --text-h1-desktop: var(--text-4xl);  /* desktop: 48px */
  --text-h2: var(--text-2xl);          /* mobile: 32px */
  --text-h2-desktop: var(--text-3xl);  /* desktop: 38px */
  --text-h3: var(--text-xl);           /* mobile: 26px */
  --text-h3-desktop: 1.75rem;          /* desktop: 28px */

  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  --line-height-tight: 1.2;
  --line-height-normal: 1.6;
  --line-height-relaxed: 1.8;

  /* Spacing */
  --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 */
  --container-max: 1200px;
  --container-narrow: 800px;
  --container-wide: 1400px;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 12px 40px rgba(0, 0, 0, 0.12);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-normal: 300ms ease;
  --transition-slow: 400ms ease;
}

/* --- Reset --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-md);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
picture,
video,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-text-heading);
  line-height: var(--line-height-tight);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-md);
}

/* --- Typography --- */
h1 {
  font-size: var(--text-h1);
}

h2 {
  font-size: var(--text-h2);
}

h3 {
  font-size: var(--text-h3);
}

h4 {
  font-size: var(--text-lg);
}

h5 {
  font-size: var(--text-md);
}

h6 {
  font-size: var(--text-base);
}

p {
  margin-bottom: var(--space-md);
}

p:last-child:not(.section-subtitle) {
  margin-bottom: 0;
}

strong {
  font-weight: var(--font-weight-semibold);
}

/* --- Layout Utilities --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-lg);
  padding-right: var(--space-lg);
}

.container--narrow {
  max-width: var(--container-narrow);
}

.section {
  padding-top: var(--space-3xl);
  padding-bottom: var(--space-3xl);
}

.section--alt {
  background-color: var(--color-bg-alt);
}

/* Icons inside alt sections: swap bg-alt → surface so they remain visible */
.section--alt .card__icon,
.section--alt .icon-box__icon,
.section--alt .contact-info__icon,
.section--alt .service-detail__icon {
  background-color: var(--color-surface);
}

.section--dark {
  background-color: var(--color-bg-dark);
  color: var(--color-text-inverse);
}

.section--dark h2,
.section--dark h3,
.section--dark h4 {
  color: var(--color-text-inverse);
}

/* Grid */
.grid {
  display: grid;
  gap: var(--space-xl);
}

.grid--2 {
  grid-template-columns: 1fr;
}

.grid--3 {
  grid-template-columns: 1fr;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--font-weight-medium);
  line-height: 1;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  text-decoration: none;
  border: 2px solid transparent;
  white-space: nowrap;
}

.btn--primary {
  background-color: var(--color-primary);
  color: var(--color-text-inverse);
  border-color: var(--color-primary);
}

.btn--primary:hover {
  background-color: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
}

.btn--secondary {
  background-color: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn--secondary:hover {
  background-color: var(--color-primary);
  color: var(--color-text-inverse);
}

.btn--accent {
  background-color: var(--color-secondary);
  color: var(--color-text-inverse);
  border-color: var(--color-secondary);
}

.btn--accent:hover {
  background-color: var(--color-secondary-dark);
  border-color: var(--color-secondary-dark);
}

.btn--block {
  width: 100%;
}

/* --- Links --- */
.link {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition-fast);
}

.link:hover {
  color: var(--color-primary-dark);
}

/* --- Text Utilities --- */
.text-center {
  text-align: center;
}

.text-center h2 {
  margin-bottom: var(--space-xl);
}

.text-balance {
  text-wrap: balance;
}

.section-subtitle {
  font-size: var(--text-md);
  color: var(--color-text-light);
  max-width: 600px;
  margin-bottom: var(--space-2xl);
  line-height: var(--line-height-relaxed);
}

.text-center .section-subtitle {
  margin-left: auto;
  margin-right: auto;
}

.section-footer {
  margin-top: var(--space-2xl);
}

.section-label {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-secondary-dark);
  margin-bottom: var(--space-sm);
}

/* --- Responsive Typography --- */
@media (min-width: 768px) {
  h1 {
    font-size: var(--text-h1-desktop);
  }

  h2 {
    font-size: var(--text-h2-desktop);
  }

  h3 {
    font-size: var(--text-h3-desktop);
  }

  .section {
    padding-top: var(--space-4xl);
    padding-bottom: var(--space-4xl);
  }
}

/* --- Responsive Grid --- */
@media (min-width: 768px) {
  .grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* --- Screen Reader Only --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}