/* ============================================================
   MODERN TYPOGRAPHY & TEXTURES
   ============================================================ */

/* Modern font stack */
:root {
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
}

/* Display headings - modern and bold */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.05;
}

h1 {
  font-size: clamp(2.4rem, 7vw, 5.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  font-weight: 700;
}

h3 {
  font-size: clamp(1.3rem, 2.5vw, 1.7rem);
  font-weight: 700;
}

/* Highlighted text - modern style */
b, strong {
  font-weight: 700;
  color: var(--primary-blue);
}

.accent {
  color: #e8951c;
  font-weight: 700;
}

/* Spec labels - modern monospace */
.spec {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--white);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1rem;
  background: var(--primary-blue);
  border: 2px solid var(--primary-blue);
  border-radius: 8px;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 12px rgba(0, 61, 165, 0.3);
}

.spec:hover {
  background: var(--navy-700);
  border-color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 61, 165, 0.4);
}

.spec::before {
  content: "◆";
  color: var(--white);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.spec::before {
  content: "";
  width: 24px;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-blue), transparent);
  display: inline-block;
  border-radius: 1px;
}

/* Body text - optimized readability */
body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink);
  font-weight: 400;
  letter-spacing: 0.3px;
}

p {
  margin: 0;
  line-height: 1.75;
  font-size: 0.98rem;
}

a {
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Lede paragraph - prominent */
.lede {
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  line-height: 1.8;
  font-weight: 500;
  color: var(--ink-soft);
}

/* Code blocks and mono text */
code, pre {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

/* Modern button typography */
.btn {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: none;
  font-size: 0.95rem;
}

/* Subtle textures */
@layer base {
  /* Noise texture overlay */
  .texture-noise {
    position: relative;
    background-image: 
      repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.015),
        rgba(0, 0, 0, 0.015) 1px,
        transparent 1px,
        transparent 2px
      ),
      repeating-linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.01),
        rgba(0, 0, 0, 0.01) 1px,
        transparent 1px,
        transparent 2px
      );
  }

  /* Grain texture */
  .texture-grain::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><filter id="noise"><feTurbulence baseFrequency="0.9" numOctaves="4" /></filter><rect width="100" height="100" fill="rgba(0,0,0,0.05)" filter="url(%23noise)"/></svg>');
    opacity: 0.5;
    pointer-events: none;
  }

  /* Gradient texture */
  .texture-gradient {
    background: linear-gradient(
      135deg,
      rgba(0, 61, 165, 0.02) 0%,
      transparent 50%,
      rgba(232, 149, 28, 0.02) 100%
    );
  }
}

/* Section header styling */
.section-head {
  margin-bottom: 2.75rem;
}

.section-head .spec {
  display: inline-block;
  margin-bottom: 1rem;
}

.section-head h2 {
  margin: 0.8rem 0 1rem;
  color: var(--navy-800);
}

.section-head p {
  color: var(--ink-soft);
  max-width: 65ch;
}

/* List styling */
ul, ol {
  font-family: var(--font-body);
}

li {
  margin: 0.5rem 0;
  line-height: 1.7;
}

/* Blockquote - modern style */
blockquote {
  font-size: 1.1rem;
  font-style: italic;
  color: var(--primary-blue);
  border-left: 3px solid var(--primary-blue);
  padding-left: 1.5rem;
  margin: 1.5rem 0;
  font-weight: 500;
}

/* Emphasis and marks */
em {
  font-style: italic;
  font-weight: 500;
}

mark {
  background: rgba(245, 179, 51, 0.2);
  color: inherit;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-weight: 600;
}

/* Smooth text selection */
::selection {
  background: linear-gradient(135deg, var(--primary-blue), var(--navy-700));
  color: white;
  text-shadow: none;
}

/* Responsive typography */
@media (max-width: 768px) {
  h1 { font-size: clamp(1.8rem, 5vw, 3rem); }
  h2 { font-size: clamp(1.4rem, 3.5vw, 2rem); }
  h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }
  
  .lede { font-size: clamp(0.95rem, 1.5vw, 1.1rem); }
  p { font-size: 0.95rem; }
}

/* Reduce motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   TEXT COLOR ADJUSTMENTS FOR DARK BACKGROUNDS
   ============================================================ */

/* White text on dark/blue backgrounds */
.hero .spec,
.cta-band .spec,
.navy-bg .spec {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.3);
}

.hero .spec:hover,
.cta-band .spec:hover,
.navy-bg .spec:hover {
  border-color: var(--white);
}

/* White text for headings on blue */
.hero h1,
.hero h2,
.cta-band h2,
.navy-bg h1,
.navy-bg h2 {
  color: var(--white);
}

/* Light blue text on dark backgrounds */
.hero p,
.hero .lede,
.cta-band p,
.navy-bg p {
  color: rgba(255, 255, 255, 0.85);
}

/* White/Light text for all elements on navy backgrounds */
.site-footer {
  color: var(--white);
}

.site-footer h1,
.site-footer h2,
.site-footer h3,
.site-footer h4,
.site-footer h5,
.site-footer h6 {
  color: var(--white);
}

.site-footer p {
  color: rgba(255, 255, 255, 0.9);
}

.site-footer a {
  color: #d4e5f7;
}

.site-footer a:hover {
  color: var(--white);
}

/* White buttons on blue backgrounds */
.hero .btn--ghost {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.4);
}

.hero .btn--ghost:hover {
  border-color: var(--white);
  background: rgba(255, 255, 255, 0.1);
}

/* CTA band text - ensure visibility */
.cta-band {
  color: var(--white);
}

.cta-band h2 {
  color: var(--white);
  font-weight: 800;
}

.cta-band p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1rem;
}

/* Method/process steps on navy */
.steps h4 {
  color: var(--white);
}

.steps p {
  color: rgba(255, 255, 255, 0.8);
}

/* White on blue backgrounds */
[style*="background: var(--navy"], 
[class*="navy-bg"],
[class*="dark-bg"] {
  color: var(--white);
}

[style*="background: var(--navy"] h1,
[style*="background: var(--navy"] h2,
[style*="background: var(--navy"] h3,
[class*="navy-bg"] h1,
[class*="navy-bg"] h2,
[class*="navy-bg"] h3,
[class*="dark-bg"] h1,
[class*="dark-bg"] h2,
[class*="dark-bg"] h3 {
  color: var(--white);
}

/* Footer links enhanced visibility */
.footer-bar {
  color: rgba(255, 255, 255, 0.7);
}

.footer-bar a {
  color: rgba(255, 255, 255, 0.85);
}

.footer-bar a:hover {
  color: var(--white);
}
