/* Enhanced Typography and Spacing - Maman Corp Inspired */

/* Improved body text readability */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Enhanced heading hierarchy */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
}

h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

/* Improved paragraph spacing */
p {
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

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

/* Enhanced section spacing */
.section {
  padding: clamp(80px, 10vw, 120px) 0;
}

.section__header {
  margin-bottom: clamp(60px, 8vw, 80px);
}

/* Container improvements */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 24px);
}

/* Improved button typography */
.hero__button,
.overview__link {
  font-size: clamp(0.9rem, 1.5vw, 1rem);
  letter-spacing: 0.02em;
}

/* Enhanced section labels */
.section__label {
  font-size: clamp(0.75rem, 1.2vw, 0.875rem);
  padding: clamp(8px, 1.5vw, 10px) clamp(18px, 3vw, 24px);
  font-weight: 600;
}

/* Section title improvements */
.section__title {
  font-size: clamp(2rem, 4vw, 3.5rem);
  margin-bottom: clamp(20px, 3vw, 24px);
  line-height: 1.15;
}

.section__subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.7;
}

/* Hero section typography refinements */
.hero__title-main {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.1;
  letter-spacing: clamp(1px, 0.2vw, 2px);
}

.hero__title-accent {
  font-size: clamp(1.2rem, 2.5vw, 1.75rem);
  margin-top: clamp(12px, 2vw, 16px);
}

.hero__subtitle {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  margin-bottom: clamp(36px, 5vw, 48px);
  line-height: 1.7;
}

/* Enhanced card typography */
.overview__title,
.process__title {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  line-height: 1.3;
}

.overview__description,
.process__description {
  font-size: clamp(0.95rem, 1.5vw, 1rem);
  line-height: 1.7;
}

/* Footer typography */
.footer__link {
  font-size: clamp(0.9rem, 1.5vw, 1rem);
  line-height: 1.6;
}

/* Improved link styling */
a {
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

/* Enhanced list spacing */
ul, ol {
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

/* Better blockquote styling */
blockquote {
  border-left: 4px solid #1a365d;
  padding-left: 24px;
  margin: 32px 0;
  font-style: italic;
  color: #4a5568;
  font-size: 1.1rem;
  line-height: 1.7;
}

/* Enhanced code and pre blocks */
code {
  background: #f7fafc;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.9em;
  color: #1a365d;
}

pre {
  background: #f7fafc;
  padding: 20px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 24px 0;
}

pre code {
  background: none;
  padding: 0;
}

/* Improved whitespace for better readability */
.section + .section {
  position: relative;
}

/* Enhanced grid gaps */
.overview__container {
  gap: clamp(30px, 5vw, 40px);
}

.featured-projects__container {
  gap: clamp(30px, 5vw, 40px);
}

/* Better button spacing */
.hero__buttons {
  gap: clamp(16px, 3vw, 24px);
}

.cta__buttons {
  gap: clamp(16px, 3vw, 24px);
}

/* Improved navigation spacing */
.nav__list {
  gap: clamp(20px, 3vw, 32px);
}

.nav {
  height: clamp(70px, 10vw, 80px);
}

/* Enhanced stat counter spacing */
.stats__container {
  gap: clamp(40px, 6vw, 60px);
}

/* Process section spacing improvements */
.process__container {
  gap: clamp(30px, 5vw, 40px);
  margin-top: clamp(50px, 7vw, 60px);
}

/* Footer spacing */
.footer {
  padding: clamp(60px, 8vw, 80px) 0 clamp(30px, 4vw, 40px);
}

.footer__links {
  gap: clamp(20px, 3vw, 30px);
}

/* Improved focus states for accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #1a365d;
  outline-offset: 2px;
}

/* Better selection styling */
::selection {
  background: #1a365d;
  color: #ffffff;
}

::-moz-selection {
  background: #1a365d;
  color: #ffffff;
}

/* Improved text contrast */
.text-high-contrast {
  color: #1a202c;
}

.text-medium-contrast {
  color: #4a5568;
}

.text-low-contrast {
  color: #718096;
}

/* Enhanced icon sizing */
.overview__icon i,
.process__icon i {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
}

/* Better mobile typography */
@media (max-width: 768px) {
  body {
    font-size: 15px;
  }

  h1 {
    line-height: 1.15;
  }

  h2 {
    line-height: 1.2;
  }

  .section {
    padding: 60px 0;
  }

  .section__header {
    margin-bottom: 50px;
  }

  .hero__buttons {
    flex-direction: column;
    width: 100%;
  }

  .hero__button {
    width: 100%;
    justify-content: center;
  }

  blockquote {
    padding-left: 16px;
    margin: 24px 0;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 14px;
  }

  .section {
    padding: 50px 0;
  }

  .section__header {
    margin-bottom: 40px;
  }

  .container {
    padding: 0 16px;
  }
}

/* Enhanced animation performance */
* {
  -webkit-backface-visibility: hidden;
  -webkit-perspective: 1000;
  backface-visibility: hidden;
  perspective: 1000;
}

/* Smooth font rendering */
@media screen and (-webkit-min-device-pixel-ratio: 2),
       screen and (min-resolution: 2dppx) {
  body {
    -webkit-font-smoothing: subpixel-antialiased;
  }
}

/* Improved loading states */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Better disabled states */
[disabled],
.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Enhanced accessibility for screen readers */
.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;
}

/* Improved print styles */
@media print {
  * {
    background: transparent !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }

  h2,
  h3 {
    page-break-after: avoid;
  }

  img {
    page-break-inside: avoid;
  }

  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3;
  }
}

/* Enhanced scrollbar styling */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: #f7fafc;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a0aec0;
}

/* Better reduced motion support */
@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;
  }
}
