/* ==========================================================================
   SPDLAB.hu — typography.css
   All typographic rules: base styles, headings, body, utilities, prose.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Base body typography
   -------------------------------------------------------------------------- */

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    font-weight: var(--fw-regular);
    line-height: var(--lh-normal);
    color: var(--color-text-primary);
    background-color: var(--color-bg);
    font-feature-settings: "ss01", "cv01", "kern";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* --------------------------------------------------------------------------
   Heading scale
   -------------------------------------------------------------------------- */

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
    font-family: var(--font-sans);
    font-weight: var(--fw-semibold);
    line-height: var(--lh-tight);
    letter-spacing: var(--ls-tight);
    color: var(--color-text-primary);
}

h1,
.h1 {
    font-size: var(--text-4xl);
    letter-spacing: var(--ls-tightest);
    font-weight: var(--fw-semibold);
}

h2,
.h2 {
    font-size: var(--text-3xl);
    letter-spacing: var(--ls-tighter);
}

h3,
.h3 {
    font-size: var(--text-2xl);
    letter-spacing: var(--ls-tight);
}

h4,
.h4 {
    font-size: var(--text-xl);
    letter-spacing: var(--ls-tight);
}

h5,
.h5 {
    font-size: var(--text-lg);
    letter-spacing: var(--ls-normal);
}

h6,
.h6 {
    font-size: var(--text-base);
    letter-spacing: var(--ls-normal);
    font-weight: var(--fw-medium);
}

/* Responsive heading scale */
@media (min-width: 768px) {
    h1,
    .h1 {
        font-size: var(--text-5xl);
    }
    h2,
    .h2 {
        font-size: var(--text-4xl);
    }
    h3,
    .h3 {
        font-size: var(--text-3xl);
    }
}

@media (min-width: 1024px) {
    h1,
    .h1 {
        font-size: var(--text-6xl);
    }
}

/* --------------------------------------------------------------------------
   Display-level type (hero, marketing)
   -------------------------------------------------------------------------- */

.display-xl {
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: var(--fw-semibold);
    line-height: var(--lh-tight);
    letter-spacing: var(--ls-tightest);
}

.display-lg {
    font-size: clamp(2rem, 4.5vw, 3.75rem);
    font-weight: var(--fw-semibold);
    line-height: var(--lh-tight);
    letter-spacing: var(--ls-tighter);
}

.display-md {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: var(--fw-semibold);
    line-height: var(--lh-snug);
    letter-spacing: var(--ls-tight);
}

/* --------------------------------------------------------------------------
   Body text sizes
   -------------------------------------------------------------------------- */

.text-xs {
    font-size: var(--text-xs);
}
.text-sm {
    font-size: var(--text-sm);
}
.text-base {
    font-size: var(--text-base);
}
.text-md {
    font-size: var(--text-md);
}
.text-lg {
    font-size: var(--text-lg);
}
.text-xl {
    font-size: var(--text-xl);
}

/* Lead paragraph (intro text below hero heading) */
.lead {
    font-size: clamp(var(--text-md), 2vw, var(--text-xl));
    font-weight: var(--fw-light);
    line-height: var(--lh-relaxed);
    color: var(--color-text-secondary);
    max-width: 60ch;
}

/* --------------------------------------------------------------------------
   Font weight utilities
   -------------------------------------------------------------------------- */

.fw-light {
    font-weight: var(--fw-light);
}
.fw-regular {
    font-weight: var(--fw-regular);
}
.fw-medium {
    font-weight: var(--fw-medium);
}
.fw-semibold {
    font-weight: var(--fw-semibold);
}

/* --------------------------------------------------------------------------
   Color utilities
   -------------------------------------------------------------------------- */

.text-primary {
    color: var(--color-text-primary);
}
.text-secondary {
    color: var(--color-text-secondary);
}
.text-tertiary {
    color: var(--color-text-tertiary);
}
.text-accent {
    color: var(--color-accent);
}
.text-white {
    color: var(--color-white);
}
.text-inverse {
    color: var(--color-text-inverse);
}

/* --------------------------------------------------------------------------
   Gradient text — accent highlight
   -------------------------------------------------------------------------- */

.text-gradient {
    background: var(--gradient-text-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --------------------------------------------------------------------------
   Alignment utilities
   -------------------------------------------------------------------------- */

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

/* --------------------------------------------------------------------------
   Letter-spacing utilities
   -------------------------------------------------------------------------- */

.ls-tight {
    letter-spacing: var(--ls-tight);
}
.ls-normal {
    letter-spacing: var(--ls-normal);
}
.ls-wide {
    letter-spacing: var(--ls-wide);
}
.ls-wider {
    letter-spacing: var(--ls-wider);
}
.ls-widest {
    letter-spacing: var(--ls-widest);
}

/* --------------------------------------------------------------------------
   Line height utilities
   -------------------------------------------------------------------------- */

.lh-tight {
    line-height: var(--lh-tight);
}
.lh-snug {
    line-height: var(--lh-snug);
}
.lh-normal {
    line-height: var(--lh-normal);
}
.lh-relaxed {
    line-height: var(--lh-relaxed);
}

/* --------------------------------------------------------------------------
   Section label / eyebrow text
   -------------------------------------------------------------------------- */

/* The small uppercase label above section headings */
.section-label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--ls-widest);
    text-transform: uppercase;
    color: var(--color-accent);
}

.section-label::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 1px;
    background-color: var(--color-accent);
    flex-shrink: 0;
    border-radius: var(--radius-full);
}

/* --------------------------------------------------------------------------
   Inline code & monospace
   -------------------------------------------------------------------------- */

code,
kbd,
samp {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--color-surface);
    color: var(--color-accent);
    padding: 0.1em 0.4em;
    border-radius: var(--radius-sm);
    border: var(--border-subtle);
}

/* --------------------------------------------------------------------------
   Prose — long-form text blocks
   -------------------------------------------------------------------------- */

.prose {
    max-width: 65ch;
    color: var(--color-text-secondary);
    line-height: var(--lh-relaxed);
}

.prose p + p {
    margin-top: var(--space-4);
}

.prose strong {
    font-weight: var(--fw-semibold);
    color: var(--color-text-primary);
}

.prose em {
    font-style: italic;
    color: var(--color-text-primary);
}

/* --------------------------------------------------------------------------
   Miscellaneous
   -------------------------------------------------------------------------- */

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

.no-wrap {
    white-space: nowrap;
}

/* Visually hidden (accessible) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
