/* ── Typography System ────────────────────────────────────────────────────
   Modern type scale for a professional enterprise software company.
   Font: Inter (primary) + Roboto Slab (accent)
   Strategy: fluid sizing via clamp(), tight headings, generous body spacing.
   ────────────────────────────────────────────────────────────────────── */

/* ── CSS Type Tokens ─────────────────────────────────────────────────────── */

:root {
  /* Font families */
  --font-primary:   'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-accent:    'Roboto Slab', Georgia, serif;

  /* Type scale — fluid between ~375px and 1440px viewports */
  --text-xs:     0.75rem;                          /* 12px */
  --text-sm:     0.875rem;                         /* 14px */
  --text-base:   1rem;                             /* 16px */
  --text-md:     1.125rem;                         /* 18px */
  --text-lg:     clamp(1.125rem, 1.5vw, 1.25rem); /* 18–20px */
  --text-xl:     clamp(1.25rem, 2vw, 1.5rem);     /* 20–24px */
  --text-2xl:    clamp(1.375rem, 2.5vw, 1.875rem);/* 22–30px */
  --text-3xl:    clamp(1.5rem, 3vw, 2.25rem);     /* 24–36px */
  --text-4xl:    clamp(1.75rem, 3.5vw, 3rem);     /* 28–48px */
  --text-5xl:    clamp(2rem, 5vw, 3.75rem);       /* 32–60px */

  /* Line heights */
  --leading-none:   1;
  --leading-tight:  1.2;
  --leading-snug:   1.35;
  --leading-normal: 1.5;
  --leading-relaxed:1.65;
  --leading-loose:  1.8;

  /* Letter spacing */
  --tracking-tight:  -0.03em;
  --tracking-snug:   -0.02em;
  --tracking-normal:  0em;
  --tracking-wide:    0.06em;
  --tracking-wider:   0.1em;

  /* Font weights */
  --weight-normal:  400;
  --weight-medium:  500;
  --weight-semi:    600;
  --weight-bold:    700;

  /* Spacing rhythm (8px grid) */
  --space-1:  0.25rem;  /* 4px  */
  --space-2:  0.5rem;   /* 8px  */
  --space-3:  0.75rem;  /* 12px */
  --space-4:  1rem;     /* 16px */
  --space-5:  1.25rem;  /* 20px */
  --space-6:  1.5rem;   /* 24px */
  --space-8:  2rem;     /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */
}

/* ── Base Reset ──────────────────────────────────────────────────────────── */

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  line-height: var(--leading-relaxed);
  color: var(--middle-gray-color, #404040);
}

/* ── Heading Hierarchy ───────────────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-primary);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  color: #1a1a2e;
  margin-top: 0;
  margin-bottom: var(--space-4);
}

h1 {
  font-size: var(--text-4xl);
  letter-spacing: var(--tracking-tight);
  line-height: 1.1;
}

h2 {
  font-size: var(--text-3xl);
  letter-spacing: var(--tracking-snug);
  font-weight: var(--weight-bold);
}

h3 {
  font-size: var(--text-2xl);
  letter-spacing: -0.015em;
  font-weight: var(--weight-semi);
}

h4 {
  font-size: var(--text-xl);
  letter-spacing: -0.01em;
  font-weight: var(--weight-semi);
}

h5 {
  font-size: var(--text-lg);
  letter-spacing: -0.005em;
  font-weight: var(--weight-semi);
}

h6 {
  font-size: var(--text-base);
  letter-spacing: 0;
  font-weight: var(--weight-semi);
}

/* ── Body Text ───────────────────────────────────────────────────────────── */

p {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  margin-top: 0;
  margin-bottom: var(--space-4);
  color: var(--middle-gray-color, #404040);
}

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

/* ── Lists ───────────────────────────────────────────────────────────────── */

ul, ol {
  padding-left: var(--space-6);
  margin-top: 0;
  margin-bottom: var(--space-4);
}

li {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-2);
}

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

/* ── Strong / Em ─────────────────────────────────────────────────────────── */

strong, b {
  font-weight: var(--weight-semi);
}

/* ── Semantic Type Classes ────────────────────────────────────────────────
   Override existing classes with modernised values, keeping the same names
   so no HTML changes are needed.
   ────────────────────────────────────────────────────────────────────── */

/* Hero / banner headline */
.banner_text {
  font-family: var(--font-primary);
  font-size: clamp(2rem, 5vw, 3.75rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 800;
}

/* Section headings */
.headline,
.headline_b {
  font-family: var(--font-primary);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: var(--weight-bold);
}

.headline_b {
  font-weight: var(--weight-bold);
}

/* Accent subtitle (Roboto Slab — keep brand feel) */
.subtitle {
  font-family: var(--font-accent);
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  line-height: var(--leading-relaxed);
  letter-spacing: 0;
  font-weight: 400;
  color: var(--light-gray-color, #787878);
}

/* Body copy — primary */
.main_text,
.main_text_b {
  font-family: var(--font-primary);
  font-size: clamp(0.9375rem, 1.5vw, 1.0625rem);
  line-height: var(--leading-relaxed);
  letter-spacing: 0;
}

.main_text_b {
  font-weight: var(--weight-semi);
}

/* Body copy — accent (Roboto Slab) */
.main_text_b_rs {
  font-family: var(--font-accent);
  font-size: clamp(0.9375rem, 1.5vw, 1.0625rem);
  line-height: var(--leading-relaxed);
  font-weight: 500;
}

/* Large body */
.body_text {
  font-family: var(--font-primary);
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  line-height: var(--leading-relaxed);
}

.body_text_rs {
  font-family: var(--font-accent);
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  line-height: var(--leading-relaxed);
  font-weight: 400;
}

/* Small body */
.body_text_small {
  font-family: var(--font-primary);
  font-size: clamp(0.875rem, 1.2vw, 1rem);
  line-height: var(--leading-relaxed);
}

.body_text_small_rs {
  font-family: var(--font-accent);
  font-size: clamp(0.875rem, 1.2vw, 1rem);
  line-height: var(--leading-relaxed);
}

.body_text_smaller {
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.body_text_smaller_rs {
  font-family: var(--font-accent);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  font-weight: 300;
}

/* ── Section spacing ─────────────────────────────────────────────────────── */

/* Reduce the heavy 120px paddings to comfortable 80–96px with fluid scaling */
.clients-all,
.technologies {
  padding-top: clamp(4rem, 8vw, 6rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
}

.contact_section,
.vacancy {
  padding-top: clamp(4rem, 7vw, 6.25rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
}

/* ── Fluid heading overrides for services pages ──────────────────────────── */

.main-services-container h1 {
  font-size: clamp(1.75rem, 3.5vw, 2.625rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.main-services-container h2 {
  font-size: clamp(1.25rem, 2.5vw, 1.625rem);
  line-height: var(--leading-snug);
  letter-spacing: -0.015em;
}

/* ── Project cards heading ───────────────────────────────────────────────── */

.first-description h3 {
  font-size: clamp(1.5rem, 3vw, 2.625rem);
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.first-description h4 {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  font-weight: var(--weight-semi);
  letter-spacing: -0.01em;
}

/* ── Contact / CTA banner (shared across all pages) ─────────────────────── */

.contact .contact_block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 56px 0;
  gap: 32px;
}

.contact .contact_block button {
  font-family: var(--font-primary);
  font-size: 15px;
  font-weight: var(--weight-semi);
  color: var(--qa-blue-dark-color, #005d88);
  padding: 14px 36px;
  border-radius: 50px;
  background: #ffffff;
  border: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.15s;
}

.contact .contact_block button:hover {
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.22);
  transform: translateY(-1px);
}

@media (max-width: 767px) {
  .contact .contact_block {
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    gap: 20px;
  }

  .contact .contact_block button {
    width: 100%;
    justify-content: center;
  }
}

/* ── Uppercase label utility ─────────────────────────────────────────────── */

.label-caps {
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--light-gray-color, #787878);
}

/* ── Link defaults ───────────────────────────────────────────────────────── */

a {
  transition: color 0.15s;
}

/* ── Responsive adjustments ──────────────────────────────────────────────── */

@media (max-width: 767px) {
  body {
    font-size: var(--text-base);
    line-height: var(--leading-normal);
  }

  h1 { letter-spacing: -0.02em; }
  h2 { letter-spacing: -0.015em; }
  h3 { letter-spacing: -0.01em; }

  .banner_text {
    letter-spacing: -0.02em;
  }
}
