/**
 * Base Styles — NCF Landing Page
 * Reset, normalize, and foundational element styles
 */

/* CSS Reset & Normalize (minimal, modern approach) */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-family);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--ink-700);
  background-color: var(--surface-0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-display: swap;
}

/* Remove list styles on ul, ol elements */
ul, ol {
  list-style: none;
}

/* Set core root defaults */
html:focus-within {
  scroll-behavior: smooth;
}

/* Remove default spacing for common elements */
h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd {
  margin: 0;
}

/* Typography Scale */
h1 { 
  font-size: var(--text-5xl); 
  font-weight: 700; 
  line-height: 1.1;
  color: var(--ink-900);
}

h2 { 
  font-size: var(--text-4xl); 
  font-weight: 600; 
  line-height: 1.2;
  color: var(--ink-900);
}

h3 { 
  font-size: var(--text-3xl); 
  font-weight: 600; 
  line-height: 1.3;
  color: var(--ink-900);
}

h4 { 
  font-size: var(--text-2xl); 
  font-weight: 500; 
  line-height: 1.3;
  color: var(--ink-900);
}

h5 { 
  font-size: var(--text-xl); 
  font-weight: 500; 
  line-height: 1.4;
  color: var(--ink-700);
}

h6 { 
  font-size: var(--text-lg); 
  font-weight: 500; 
  line-height: 1.4;
  color: var(--ink-700);
}

p {
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--ink-700);
}

small {
  font-size: var(--text-sm);
  color: var(--ink-500);
}

/* Links */
a {
  color: var(--brand-600);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--brand-500);
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Images */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

img {
  border-style: none;
}

/* Form elements */
input, button, textarea, select {
  font: inherit;
  color: inherit;
}

input, textarea, select {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--surface-100);
  border-radius: var(--radius-md);
  background-color: var(--surface-0);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(0, 122, 94, 0.1);
}

input[disabled], textarea[disabled], select[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Buttons */
button {
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  transition: all var(--transition-fast);
  text-decoration: none;
  border-radius: var(--radius-md);
}

/* Primary Button */
.btn-primary {
  background-color: var(--brand-600);
  color: var(--surface-0) !important;
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-base);
  font-weight: 600;
  box-shadow: var(--shadow-soft);
  text-decoration: none;
}

.btn-primary:hover {
  background-color: var(--brand-500);
  color: var(--surface-0) !important;
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
  text-decoration: none;
}

.btn-primary:focus-visible {
  outline: 2px solid var(--brand-300);
  outline-offset: 2px;
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-soft);
}

/* Secondary Button */
.btn-secondary {
  background-color: transparent;
  color: var(--brand-600) !important;
  border: 1px solid var(--brand-600);
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-base);
  font-weight: 500;
  text-decoration: none;
}

.btn-secondary:hover {
  background-color: var(--brand-50);
  border-color: var(--brand-500);
  color: var(--brand-500) !important;
  text-decoration: none;
}

.btn-secondary:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
  background-color: var(--brand-50);
}

/* Accent Button */
.btn-accent {
  background-color: var(--accent-500);
  border: none;
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--ink-900);
}

.btn-accent:hover {
  background-color: var(--accent-400);
  color: var(--ink-900);
  text-decoration: none;
}

.btn-accent:focus-visible {
  outline: 2px solid var(--ink-700);
  outline-offset: 2px;
  background-color: var(--accent-400);
}

/* Button Links - Override generic link styles */
a.btn-primary,
a.btn-secondary,
a.btn-accent {
  text-decoration: none;
}

a.btn-primary:hover,
a.btn-secondary:hover,
a.btn-accent:hover {
  text-decoration: none;
}

a.btn-primary:focus,
a.btn-secondary:focus,
a.btn-accent:focus {
  text-decoration: none;
}

/* Ensure button text visibility in all states */
.btn-primary,
.btn-primary:link,
.btn-primary:visited {
  color: var(--surface-0) !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  color: var(--surface-0) !important;
}

.btn-secondary,
.btn-secondary:link,
.btn-secondary:visited {
  color: var(--brand-600) !important;
}

.btn-secondary:hover,
.btn-secondary:focus,
.btn-secondary:active {
  color: var(--brand-500) !important;
}

/* Large Buttons */
.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-lg);
  border-radius: var(--radius-lg);
}

/* Skip Link (Accessibility) */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--ink-900);
  color: var(--surface-0);
  padding: var(--space-2) var(--space-4);
  text-decoration: none;
  border-radius: var(--radius-sm);
  z-index: var(--z-modal);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 6px;
}

/* Focus Visible Utilities */
.focus-visible:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Remove all animations and transitions for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  input, textarea, select {
    border-width: 2px;
  }
  
  .btn-primary, .btn-secondary {
    border-width: 2px;
  }
}
