/* ========================================
   UNIFIED TYPOGRAPHY SYSTEM
   Font Hierarchy & Text Rendering
   ======================================== */

/* ========================================
   FONT IMPORTS & SETUP
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  font-size: 1rem;
  line-height: var(--lh-normal);
  color: var(--text-secondary);
  background-color: var(--bg-white);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   HEADING STYLES
   ======================================== */

/* H1 - Page Titles */
h1,
.h1 {
  font-size: 3.5rem;
  line-height: var(--lh-tight);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-dark);
  margin-bottom: var(--spacing-xl);
  margin-top: 0;
}

/* H2 - Section Titles */
h2,
.h2 {
  font-size: 2.75rem;
  line-height: var(--lh-snug);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-dark);
  margin-bottom: var(--spacing-lg);
  margin-top: 0;
}

/* H3 - Subsection Titles */
h3,
.h3 {
  font-size: 1.875rem;
  line-height: var(--lh-snug);
  font-weight: 700;
  letter-spacing: -0.005em;
  color: var(--text-dark);
  margin-bottom: var(--spacing-md);
  margin-top: 0;
}

/* H4 - Component Titles */
h4,
.h4 {
  font-size: 1.375rem;
  line-height: var(--lh-normal);
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text-dark);
  margin-bottom: var(--spacing-md);
  margin-top: 0;
}

/* H5 - Small Titles */
h5,
.h5 {
  font-size: 1.125rem;
  line-height: var(--lh-normal);
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text-dark);
  margin-bottom: var(--spacing-sm);
  margin-top: 0;
}

/* H6 - Minimal Titles */
h6,
.h6 {
  font-size: 1rem;
  line-height: var(--lh-normal);
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text-dark);
  margin-bottom: var(--spacing-sm);
  margin-top: 0;
}

/* ========================================
   BODY TEXT STYLES
   ======================================== */

/* Body - Main Text */
.body,
.body-base,
p {
  font-size: 1rem;
  line-height: var(--lh-normal);
  font-weight: 400;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-lg);
  margin-top: 0;
}

/* Body Large */
.body-large,
.body-lg {
  font-size: 1.125rem;
  line-height: var(--lh-relaxed);
  font-weight: 400;
  color: var(--text-secondary);
}

/* Body Small */
.body-small,
.body-sm {
  font-size: 0.875rem;
  line-height: var(--lh-normal);
  font-weight: 400;
  color: var(--text-light);
}

/* Body Extra Small */
.body-xs {
  font-size: 0.75rem;
  line-height: var(--lh-tight);
  font-weight: 400;
  color: var(--text-lighter);
}

/* ========================================
   CAPTION & LABEL STYLES
   ======================================== */

/* Caption */
.caption,
.text-caption {
  font-size: 0.875rem;
  line-height: var(--lh-normal);
  font-weight: 500;
  color: var(--text-light);
  letter-spacing: 0.01em;
}

/* Label */
label,
.label {
  font-size: 0.875rem;
  line-height: var(--lh-tight);
  font-weight: 600;
  color: var(--text-dark);
  display: block;
  margin-bottom: var(--spacing-sm);
}

/* Helper Text */
.helper-text,
.text-helper {
  font-size: 0.75rem;
  line-height: var(--lh-tight);
  font-weight: 400;
  color: var(--text-lighter);
}

/* ========================================
   SEMANTIC TEXT STYLES
   ======================================== */

/* Strong / Bold */
strong,
.font-bold,
.fw-bold {
  font-weight: 700;
  color: var(--text-dark);
}

/* Emphasis / Italic */
em,
.font-italic,
.fw-italic {
  font-style: italic;
  color: var(--text-secondary);
}

/* Monospace / Code */
code,
.code,
.font-mono,
pre {
  font-family: 'Courier New', 'Monaco', monospace;
  background: var(--bg-lighter);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  font-size: 0.875em;
  color: var(--color-error);
}

pre {
  padding: var(--spacing-lg);
  overflow-x: auto;
  margin-bottom: var(--spacing-lg);
}

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

/* ========================================
   LINK STYLES
   ======================================== */

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: var(--transition-fast);
  cursor: pointer;
  font-weight: 500;
}

a:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

a:active,
a:focus {
  color: var(--color-primary-dark);
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Disabled Link */
a[disabled],
a.disabled {
  color: var(--text-lighter);
  cursor: not-allowed;
  opacity: 0.5;
}

a.text-light {
  color: inherit;
}

a.text-light:hover {
  color: var(--color-primary);
}

/* ========================================
   LIST STYLES
   ======================================== */

ul,
ol {
  margin-bottom: var(--spacing-lg);
  padding-left: var(--spacing-xl);
}

li {
  margin-bottom: var(--spacing-sm);
  line-height: var(--lh-relaxed);
}

ul ul,
ol ol,
ul ol,
ol ul {
  margin-bottom: 0;
  margin-top: var(--spacing-sm);
}

/* ========================================
   BLOCKQUOTE & QUOTE STYLES
   ======================================== */

blockquote {
  border-left: 4px solid var(--color-primary);
  padding: var(--spacing-lg);
  margin: var(--spacing-xl) 0;
  background: var(--bg-lighter);
  font-style: italic;
  color: var(--text-light);
}

blockquote p {
  margin-bottom: 0;
}

/* ========================================
   FORM TEXT STYLES
   ======================================== */

/* Form Labels */
.form-label,
.form-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: var(--spacing-sm);
  display: block;
}

/* Form Input Text */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="url"],
textarea,
select {
  font-family: inherit;
  font-size: 1rem;
  line-height: var(--lh-normal);
  color: var(--text-dark);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-lighter);
  font-weight: 400;
}

/* ========================================
   SPECIAL TEXT STYLES
   ======================================== */

/* Highlight */
mark,
.highlight {
  background: linear-gradient(120deg, rgba(56, 189, 240, 0.3), rgba(56, 189, 240, 0.1));
  padding: 0 var(--spacing-xs);
  border-radius: var(--radius-sm);
  font-weight: 600;
  color: var(--color-primary);
}

/* Delete / Strikethrough */
del,
.text-strikethrough {
  text-decoration: line-through;
  color: var(--text-light);
}

/* Abbreviation */
abbr {
  border-bottom: 1px dotted var(--border-gray);
  cursor: help;
  text-decoration: none;
}

/* ========================================
   RESPONSIVE TYPOGRAPHY
   ======================================== */

/* Tablet (768px and up) */
@media (max-width: 1199px) {
  h1,
  .h1 {
    font-size: 3rem;
  }

  h2,
  .h2 {
    font-size: 2.25rem;
  }

  h3,
  .h3 {
    font-size: 1.625rem;
  }

  h4,
  .h4 {
    font-size: 1.25rem;
  }
}

/* Mobile (less than 768px) */
@media (max-width: 767px) {
  h1,
  .h1 {
    font-size: 2.25rem;
    line-height: 1.2;
  }

  h2,
  .h2 {
    font-size: 1.875rem;
    line-height: 1.3;
  }

  h3,
  .h3 {
    font-size: 1.375rem;
  }

  h4,
  .h4 {
    font-size: 1.125rem;
  }

  h5,
  .h5 {
    font-size: 1rem;
  }

  body,
  p {
    font-size: 0.9375rem;
  }

  .body-large,
  .body-lg {
    font-size: 1rem;
  }

  .body-small,
  .body-sm {
    font-size: 0.8125rem;
  }
}

/* ========================================
   TEXT UTILITY CLASSES
   ======================================== */

/* Font Weight */
.font-light {
  font-weight: 300;
}

.font-normal {
  font-weight: 400;
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

.font-extrabold {
  font-weight: 800;
}

/* Text Transform */
.text-uppercase {
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.text-lowercase {
  text-transform: lowercase;
}

.text-capitalize {
  text-transform: capitalize;
}

/* Text Align */
.text-left {
  text-align: left;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-justify {
  text-align: justify;
}

/* Line Height */
.lh-1 {
  line-height: 1;
}

.lh-tight {
  line-height: 1.25;
}

.lh-normal {
  line-height: 1.5;
}

.lh-relaxed {
  line-height: 1.625;
}

.lh-loose {
  line-height: 2;
}

/* Letter Spacing */
.tracking-tight {
  letter-spacing: -0.02em;
}

.tracking-normal {
  letter-spacing: 0;
}

.tracking-wide {
  letter-spacing: 0.05em;
}

/* Word Break */
.break-words {
  word-break: break-word;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ========================================
   DARK MODE SUPPORT (Optional)
   ======================================== */

@media (prefers-color-scheme: dark) {
  body {
    background-color: var(--color-dark);
    color: var(--bg-light);
  }

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

  p {
    color: var(--bg-lighter);
  }
}
