/* ==========================================================
   Parkify Enterprise Design System
   File: assets/css/typography.css
   Purpose: Global typography system for Parkify
   Depends on: variables.css
   ========================================================== */

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

/* ------------------------------
   Base document typography
   ------------------------------ */
html {
  font-size: 16px;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body, 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
  font-size: var(--text-base, 1rem);
  line-height: var(--leading-normal, 1.65);
  font-weight: 400;
  color: var(--text-primary, #f8fafc);
  background: var(--bg-body, #070b14);
  letter-spacing: var(--tracking-normal, -0.01em);
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ------------------------------
   Headings
   ------------------------------ */
h1,
h2,
h3,
h4,
h5,
h6,
.heading {
  font-family: var(--font-heading, 'Manrope', 'Inter', system-ui, sans-serif);
  color: var(--text-heading, #ffffff);
  font-weight: 800;
  line-height: var(--leading-tight, 1.08);
  letter-spacing: var(--tracking-tight, -0.045em);
  margin: 0;
  text-wrap: balance;
}

h1,
.h1 {
  font-size: clamp(2.6rem, 7vw, 5.8rem);
  line-height: 0.98;
  letter-spacing: -0.07em;
}

h2,
.h2 {
  font-size: clamp(2.05rem, 4.6vw, 4.25rem);
  line-height: 1.02;
  letter-spacing: -0.06em;
}

h3,
.h3 {
  font-size: clamp(1.65rem, 3.3vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.05em;
}

h4,
.h4 {
  font-size: clamp(1.35rem, 2.3vw, 2.15rem);
  line-height: 1.16;
  letter-spacing: -0.04em;
}

h5,
.h5 {
  font-size: clamp(1.12rem, 1.7vw, 1.45rem);
  line-height: 1.24;
  letter-spacing: -0.025em;
}

h6,
.h6 {
  font-size: clamp(0.98rem, 1.2vw, 1.12rem);
  line-height: 1.35;
  letter-spacing: -0.015em;
  font-weight: 750;
}

/* ------------------------------
   Paragraphs and rich text
   ------------------------------ */
p {
  margin: 0;
  color: var(--text-secondary, #b9c2d3);
  line-height: var(--leading-relaxed, 1.75);
  text-wrap: pretty;
}

p + p {
  margin-top: var(--space-4, 1rem);
}

.lead {
  font-size: clamp(1.05rem, 1.7vw, 1.35rem);
  line-height: 1.75;
  color: var(--text-secondary, #cbd5e1);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.subtitle {
  font-size: clamp(0.98rem, 1.35vw, 1.12rem);
  line-height: 1.7;
  color: var(--text-muted, #94a3b8);
  font-weight: 500;
}

.caption {
  font-size: var(--text-xs, 0.78rem);
  line-height: 1.45;
  color: var(--text-muted, #94a3b8);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.small,
small {
  font-size: var(--text-sm, 0.875rem);
  line-height: 1.55;
  color: var(--text-muted, #94a3b8);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--text-xs, 0.78rem);
  line-height: 1;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--color-primary, #22c55e);
}

.kicker {
  font-size: var(--text-sm, 0.875rem);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent, #38bdf8);
}

/* ------------------------------
   Links
   ------------------------------ */
a {
  color: var(--link-color, #38bdf8);
  text-decoration: none;
  text-underline-offset: 0.22em;
  transition: color var(--transition-fast, 180ms ease), opacity var(--transition-fast, 180ms ease), text-decoration-color var(--transition-fast, 180ms ease);
}

a:hover {
  color: var(--link-hover, #67e8f9);
}

a:focus-visible {
  outline: 2px solid var(--focus-ring, #38bdf8);
  outline-offset: 3px;
  border-radius: 0.35rem;
}

.link-muted {
  color: var(--text-muted, #94a3b8);
}

.link-muted:hover {
  color: var(--text-primary, #f8fafc);
}

.link-underline {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
}

/* ------------------------------
   Text utilities
   ------------------------------ */
.text-balance { text-wrap: balance; }
.text-pretty { text-wrap: pretty; }
.text-uppercase { text-transform: uppercase; }
.text-lowercase { text-transform: lowercase; }
.text-capitalize { text-transform: capitalize; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-nowrap { white-space: nowrap; }
.text-break { overflow-wrap: anywhere; word-break: break-word; }

.text-primary { color: var(--text-primary, #f8fafc) !important; }
.text-secondary { color: var(--text-secondary, #cbd5e1) !important; }
.text-muted { color: var(--text-muted, #94a3b8) !important; }
.text-soft { color: var(--text-soft, #64748b) !important; }
.text-success { color: var(--color-success, #22c55e) !important; }
.text-warning { color: var(--color-warning, #f59e0b) !important; }
.text-danger { color: var(--color-danger, #ef4444) !important; }
.text-info { color: var(--color-info, #38bdf8) !important; }
.text-accent { color: var(--color-accent, #38bdf8) !important; }

.text-gradient {
  background: var(--gradient-text, linear-gradient(135deg, #ffffff 0%, #67e8f9 45%, #22c55e 100%));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.text-gradient-primary {
  background: linear-gradient(135deg, var(--color-primary, #22c55e), var(--color-accent, #38bdf8));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ------------------------------
   Font weights
   ------------------------------ */
.fw-400 { font-weight: 400 !important; }
.fw-500 { font-weight: 500 !important; }
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }
.fw-800 { font-weight: 800 !important; }
.fw-900 { font-weight: 900 !important; }

/* ------------------------------
   Label system
   ------------------------------ */
.label,
.form-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-secondary, #cbd5e1);
  font-size: var(--text-sm, 0.875rem);
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 0.55rem;
}

.label-required::after,
.form-label.required::after {
  content: '*';
  color: var(--color-danger, #ef4444);
  margin-left: 0.15rem;
}

.label-hint {
  color: var(--text-muted, #94a3b8);
  font-size: var(--text-xs, 0.78rem);
  font-weight: 600;
}

/* ------------------------------
   Lists
   ------------------------------ */
ul,
ol {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text-secondary, #cbd5e1);
}

li {
  margin: 0.35rem 0;
  line-height: 1.65;
}

.list-clean {
  list-style: none;
  padding-left: 0;
}

.list-check {
  list-style: none;
  padding-left: 0;
}

.list-check li {
  position: relative;
  padding-left: 1.75rem;
}

.list-check li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0.02rem;
  color: var(--color-success, #22c55e);
  font-weight: 900;
}

/* ------------------------------
   Code and technical text
   ------------------------------ */
code,
kbd,
pre,
samp {
  font-family: var(--font-mono, 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace);
}

code {
  font-size: 0.92em;
  color: var(--code-text, #a7f3d0);
  background: var(--code-bg, rgba(15, 23, 42, 0.9));
  border: 1px solid var(--border-soft, rgba(148, 163, 184, 0.16));
  border-radius: var(--radius-sm, 0.5rem);
  padding: 0.16rem 0.38rem;
}

pre {
  overflow-x: auto;
  padding: 1rem;
  border-radius: var(--radius-lg, 1rem);
  background: var(--code-bg, rgba(2, 6, 23, 0.88));
  border: 1px solid var(--border-soft, rgba(148, 163, 184, 0.16));
  color: var(--text-secondary, #cbd5e1);
  line-height: 1.65;
}

pre code {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

kbd {
  display: inline-flex;
  align-items: center;
  min-height: 1.55rem;
  padding: 0.12rem 0.45rem;
  border-radius: 0.45rem;
  color: var(--text-primary, #f8fafc);
  background: var(--surface-2, #111827);
  border: 1px solid var(--border-soft, rgba(148, 163, 184, 0.18));
  box-shadow: inset 0 -1px 0 rgba(255,255,255,0.08);
  font-size: var(--text-xs, 0.78rem);
  font-weight: 800;
}

/* ------------------------------
   Blockquotes
   ------------------------------ */
blockquote {
  margin: 0;
  padding: 1.15rem 1.25rem;
  border-left: 3px solid var(--color-primary, #22c55e);
  border-radius: 0 var(--radius-lg, 1rem) var(--radius-lg, 1rem) 0;
  background: var(--surface-glass, rgba(15, 23, 42, 0.58));
  color: var(--text-secondary, #cbd5e1);
  line-height: 1.75;
}

blockquote p {
  color: inherit;
}

/* ------------------------------
   Button text helpers
   ------------------------------ */
.btn,
button,
input[type='button'],
input[type='submit'] {
  font-family: var(--font-body, 'Inter', system-ui, sans-serif);
  letter-spacing: -0.01em;
}

.btn-label {
  font-size: var(--text-sm, 0.875rem);
  font-weight: 800;
  line-height: 1;
}

/* ------------------------------
   Numeric / stats typography
   ------------------------------ */
.stat-number,
.metric-number,
.price-number {
  font-family: var(--font-heading, 'Manrope', 'Inter', system-ui, sans-serif);
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 0.98;
  color: var(--text-heading, #ffffff);
  font-variant-numeric: tabular-nums;
}

.stat-label,
.metric-label,
.price-label {
  color: var(--text-muted, #94a3b8);
  font-size: var(--text-sm, 0.875rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.price-currency {
  font-size: 0.48em;
  vertical-align: super;
  color: var(--color-primary, #22c55e);
  letter-spacing: -0.04em;
}

/* ------------------------------
   Navigation typography
   ------------------------------ */
.nav-link,
.menu-link {
  font-size: var(--text-sm, 0.875rem);
  font-weight: 750;
  letter-spacing: -0.015em;
  color: var(--nav-link, #cbd5e1);
}

.nav-link:hover,
.menu-link:hover,
.nav-link.is-active,
.menu-link.is-active {
  color: var(--nav-link-active, #ffffff);
}

/* ------------------------------
   Form text
   ------------------------------ */
.input-hint,
.form-hint {
  display: block;
  margin-top: 0.45rem;
  color: var(--text-muted, #94a3b8);
  font-size: var(--text-xs, 0.78rem);
  line-height: 1.45;
  font-weight: 600;
}

.form-error {
  display: block;
  margin-top: 0.45rem;
  color: var(--color-danger, #ef4444);
  font-size: var(--text-xs, 0.78rem);
  line-height: 1.45;
  font-weight: 750;
}

.form-success {
  display: block;
  margin-top: 0.45rem;
  color: var(--color-success, #22c55e);
  font-size: var(--text-xs, 0.78rem);
  line-height: 1.45;
  font-weight: 750;
}

/* ------------------------------
   Responsive typography
   ------------------------------ */
@media (max-width: 768px) {
  body {
    line-height: 1.6;
  }

  h1,
  .h1 {
    letter-spacing: -0.055em;
  }

  h2,
  .h2 {
    letter-spacing: -0.05em;
  }

  .lead {
    line-height: 1.62;
  }
}

@media (max-width: 420px) {
  html {
    font-size: 15px;
  }

  h1,
  .h1 {
    font-size: clamp(2.25rem, 13vw, 3.25rem);
  }

  h2,
  .h2 {
    font-size: clamp(1.85rem, 10vw, 2.55rem);
  }

  .eyebrow {
    letter-spacing: 0.12em;
  }
}

/* ------------------------------
   Reduced motion support
   ------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  a,
  button,
  .nav-link,
  .menu-link {
    transition: none !important;
  }
}
