/**
 * BRAKEMATIC, LDA — Base Styles & Global Reset
 */

/* Box sizing and margin resets */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--leading-normal);
  color: var(--text);
  background-color: var(--surface);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--surface);
  color: var(--text);
  overflow-x: hidden;
}

main {
  flex: 1 0 auto;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  color: var(--brand-blue);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: -0.015em;
}

h1 {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-4);
}

@media (min-width: 768px) {
  h1 {
    font-size: var(--text-4xl);
  }
}

@media (min-width: 1024px) {
  h1 {
    font-size: var(--text-5xl);
  }
}

h2 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-3);
}

@media (min-width: 768px) {
  h2 {
    font-size: var(--text-3xl);
  }
}

h3 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-2);
}

h4 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
}

p {
  color: var(--text);
  margin-bottom: var(--space-4);
  line-height: var(--leading-relaxed);
}

p.lead {
  font-size: var(--text-lg);
  color: var(--text-muted);
  line-height: var(--leading-relaxed);
}

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

/* Links */
a {
  color: var(--brand-blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

a:hover {
  color: var(--brand-blue-hover);
  text-decoration-thickness: 2px;
}

/* Buttons (Industrial Minimalist — strict adherence to brand rules) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.625rem 1.25rem;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
  white-space: nowrap;
}

/* Primary Yellow Button: Mandatory dark blue text on yellow background for WCAG AA compliance */
.btn-primary {
  background-color: var(--brand-yellow);
  color: var(--brand-blue);
  border-color: var(--brand-yellow);
}

.btn-primary:hover {
  background-color: var(--brand-yellow-hover);
  border-color: var(--brand-yellow-hover);
  color: #001A3D;
  text-decoration: none;
}

/* Secondary Brand Blue Button */
.btn-secondary {
  background-color: var(--brand-blue);
  color: #FFFFFF;
  border-color: var(--brand-blue);
}

.btn-secondary:hover {
  background-color: var(--brand-blue-hover);
  border-color: var(--brand-blue-hover);
  color: #FFFFFF;
  text-decoration: none;
}

/* Outline Button */
.btn-outline {
  background-color: transparent;
  color: var(--brand-blue);
  border-color: var(--border);
}

.btn-outline:hover {
  background-color: var(--surface-muted);
  border-color: var(--brand-blue);
  color: var(--brand-blue);
  text-decoration: none;
}

/* Secondary Button Small */
.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: var(--text-xs);
}

/* Button Large */
.btn-lg {
  padding: 0.875rem 1.75rem;
  font-size: var(--text-base);
}

/* Full Width Button */
.btn-block {
  display: flex;
  width: 100%;
}

/* Focus States (Accessible keyboard navigation) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Accessibility: 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;
}

.sr-only-focusable:focus,
.sr-only-focusable:active {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background-color: var(--brand-blue);
  color: #FFFFFF;
  padding: 0.75rem 1.25rem;
  z-index: 1000;
  font-weight: 700;
  text-decoration: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0;
}

/* Images & Media */
img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Layout Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

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

/* Section Spacing */
.section {
  padding-top: var(--space-12);
  padding-bottom: var(--space-12);
}

@media (min-width: 768px) {
  .section {
    padding-top: var(--space-16);
    padding-bottom: var(--space-16);
  }
}

.section-muted {
  background-color: var(--surface-muted);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

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

.section-header.text-center {
  text-align: center;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

.section-subtitle {
  font-size: var(--text-base);
  color: var(--text-muted);
  margin-top: var(--space-2);
}

@media (min-width: 768px) {
  .section-subtitle {
    font-size: var(--text-lg);
  }
}

/* Utility Helpers */
.text-muted { color: var(--text-muted); }
.text-blue { color: var(--brand-blue); }
.text-yellow { color: var(--brand-yellow); }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.font-mono { font-family: var(--font-mono); }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
