/* ============================================================
   ENVIQA ENGINEERING - Design System
   ============================================================
   Dark hero + light body.
   Syne (headings) + Instrument Sans (body).
   Primary: #1c213e / Accent: built from navy base.
   ============================================================ */


/* ────────────────────────────────────────────────────────────
   0. FONTS
   Google Fonts import (tymczasowo - docelowo self-hosted)
   ──────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Syne:wght@400;500;600;700&display=swap');


/* ────────────────────────────────────────────────────────────
   1. DESIGN TOKENS (CSS Custom Properties)
   ──────────────────────────────────────────────────────────── */

:root {

    /* ── Colors: Brand ── */
    --color-navy:           #1c213e;
    --color-navy-light:     #282d4a;
    --color-navy-dark:      #12152a;
    --color-navy-darkest:   #0b0d1a;

    /* ── Colors: Neutrals ── */
    --color-white:          #ffffff;
    --color-off-white:      #f8f8fa;
    --color-gray-100:       #eaeaea;
    --color-gray-200:       #d4d4d8;
    --color-gray-300:       #a1a1aa;
    --color-gray-400:       #71717a;
    --color-gray-500:       #52525b;
    --color-gray-600:       #3f3f46;
    --color-gray-700:       #27272a;

    /* ── Colors: Accent ── */
    --color-accent:         #4f7df5;
    --color-accent-light:   #7ba0ff;
    --color-accent-dark:    #3a5fc4;
    --color-accent-subtle:  rgba(79, 125, 245, 0.08);

    /* ── Colors: Semantic ── */
    --color-success:        #22c55e;
    --color-warning:        #eab308;
    --color-error:          #ef4444;

    /* ── Colors: Surfaces ── */
    --surface-dark:         var(--color-navy);
    --surface-dark-alt:     var(--color-navy-light);
    --surface-light:        var(--color-white);
    --surface-light-alt:    var(--color-off-white);

    /* ── Colors: Text ── */
    --text-on-dark:         var(--color-white);
    --text-on-dark-muted:   rgba(255, 255, 255, 0.6);
    --text-on-dark-subtle:  rgba(255, 255, 255, 0.35);
    --text-on-light:        var(--color-navy);
    --text-on-light-muted:  var(--color-gray-500);
    --text-on-light-subtle: var(--color-gray-300);

    /* ── Typography: Families ── */
    --font-heading:         'Syne', system-ui, sans-serif;
    --font-body:            'Instrument Sans', system-ui, sans-serif;
    --font-mono:            'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

    /* ── Typography: Scale (modular, ratio ~1.25) ── */
    --text-xs:              0.75rem;      /* 12px */
    --text-sm:              0.875rem;     /* 14px */
    --text-base:            1rem;         /* 16px */
    --text-lg:              1.125rem;     /* 18px */
    --text-xl:              1.25rem;      /* 20px */
    --text-2xl:             1.5rem;       /* 24px */
    --text-3xl:             1.875rem;     /* 30px */
    --text-4xl:             2.25rem;      /* 36px */
    --text-5xl:             3rem;         /* 48px */
    --text-6xl:             3.75rem;      /* 60px */
    --text-7xl:             4.5rem;       /* 72px */
    --text-8xl:             6rem;         /* 96px */

    /* ── Typography: Line Heights ── */
    --leading-none:         1;
    --leading-tight:        1.15;
    --leading-snug:         1.3;
    --leading-normal:       1.5;
    --leading-relaxed:      1.65;
    --leading-loose:        1.8;

    /* ── Typography: Font Weights ── */
    --weight-regular:       400;
    --weight-medium:        500;
    --weight-semibold:      600;
    --weight-bold:          700;
    /* --weight-extrabold removed: Syne max 700 */

    /* ── Typography: Letter Spacing ── */
    --tracking-tighter:     -0.03em;
    --tracking-tight:       -0.015em;
    --tracking-normal:      0;
    --tracking-wide:        0.025em;
    --tracking-wider:       0.05em;
    --tracking-widest:      0.1em;

    /* ── Spacing Scale (4px base) ── */
    --space-0:              0;
    --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 */
    --space-32:             8rem;         /* 128px */
    --space-40:             10rem;        /* 160px */

    /* ── Section Spacing ── */
    --section-padding-y:    var(--space-32);
    --section-padding-y-sm: var(--space-20);

    /* ── Layout ── */
    --container-max:        1600px;
    --container-narrow:     960px;
    --container-wide:       1440px;
    --gutter:               var(--space-6);

    /* ── Borders ── */
    --radius-sm:            4px;
    --radius-md:            8px;
    --radius-lg:            12px;
    --radius-xl:            16px;
    --radius-full:          9999px;

    --border-subtle:        1px solid rgba(255, 255, 255, 0.08);
    --border-subtle-light:  1px solid rgba(28, 33, 62, 0.08);
    --border-default:       1px solid var(--color-gray-200);

    /* ── Shadows ── */
    --shadow-sm:            0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md:            0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg:            0 8px 30px rgba(0, 0, 0, 0.12);
    --shadow-xl:            0 16px 50px rgba(0, 0, 0, 0.16);
    --shadow-glow:          0 0 40px rgba(79, 125, 245, 0.15);

    /* ── Transitions ── */
    --ease-default:         cubic-bezier(0.4, 0, 0.2, 1);
    --ease-in:              cubic-bezier(0.4, 0, 1, 1);
    --ease-out:             cubic-bezier(0, 0, 0.2, 1);
    --ease-bounce:          cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast:        150ms;
    --duration-normal:      250ms;
    --duration-slow:        400ms;
    --duration-slower:      600ms;

    /* ── Z-index Scale ── */
    --z-below:              -1;
    --z-base:               0;
    --z-above:              10;
    --z-nav:                100;
    --z-overlay:            200;
    --z-modal:              300;
}


/* ────────────────────────────────────────────────────────────
   2. RESET & BASE
   ──────────────────────────────────────────────────────────── */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-body);
    font-weight: var(--weight-regular);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--text-on-light);
    background-color: var(--surface-light);
}

img, video, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

ul, ol {
    list-style: none;
}

::selection {
    background-color: var(--color-accent);
    color: var(--color-white);
}


/* ────────────────────────────────────────────────────────────
   3. TYPOGRAPHY
   ──────────────────────────────────────────────────────────── */

/* ── Headings ── */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-heading);
    font-weight: var(--weight-bold);
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
    color: inherit;
}

h1, .h1 {
    font-size: var(--text-6xl);
    font-weight: var(--weight-bold);
    letter-spacing: var(--tracking-tighter);
}

h2, .h2 {
    font-size: var(--text-5xl);
    font-weight: var(--weight-bold);
    letter-spacing: var(--tracking-tighter);
}

h3, .h3 {
    font-size: var(--text-4xl);
    font-weight: var(--weight-bold);
}

h4, .h4 {
    font-size: var(--text-3xl);
    font-weight: var(--weight-semibold);
}

h5, .h5 {
    font-size: var(--text-2xl);
    font-weight: var(--weight-semibold);
}

h6, .h6 {
    font-size: var(--text-xl);
    font-weight: var(--weight-semibold);
}

/* ── Body Text ── */
p {
    margin-bottom: var(--space-4);
    line-height: var(--leading-relaxed);
}

.text-lead {
    font-size: var(--text-xl);
    line-height: var(--leading-relaxed);
    color: var(--text-on-light-muted);
}

.text-sm {
    font-size: var(--text-sm);
}

.text-xs {
    font-size: var(--text-xs);
}

.text-mono {
    font-family: var(--font-mono);
    font-size: 0.9em;
}

/* ── Label / Overline ── */
.overline {
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-widest);
    text-transform: uppercase;
    color: var(--color-accent);
}

.overline--muted {
    color: var(--text-on-light-muted);
}

/* ── Links ── */
.link {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-default);
}

.link:hover {
    color: var(--color-accent-dark);
}

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: var(--weight-medium);
    color: var(--color-accent);
    transition: gap var(--duration-normal) var(--ease-default),
                color var(--duration-fast) var(--ease-default);
}

.link-arrow::after {
    content: '\2192';
    transition: transform var(--duration-normal) var(--ease-default);
}

.link-arrow:hover {
    gap: var(--space-3);
    color: var(--color-accent-dark);
}

.link-arrow:hover::after {
    transform: translateX(2px);
}


/* ────────────────────────────────────────────────────────────
   4. LAYOUT
   ──────────────────────────────────────────────────────────── */

.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.container--narrow {
    max-width: var(--container-narrow);
}

.container--wide {
    max-width: var(--container-wide);
}

/* ── Sections ── */
.section {
    padding-block: var(--section-padding-y);
}

.section--dark {
    background-color: var(--surface-dark);
    color: var(--text-on-dark);
}

.section--dark .text-lead,
.section--dark p {
    color: var(--text-on-dark-muted);
}

.section--dark .overline {
    color: var(--color-accent-light);
}

.section--dark-alt {
    background-color: var(--surface-dark-alt);
    color: var(--text-on-dark);
}

.section--light-alt {
    background-color: var(--surface-light-alt);
}

/* ── Grid ── */
.grid {
    display: grid;
    gap: var(--gutter);
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

/* ── Flex ── */
.flex {
    display: flex;
}

.flex--center {
    align-items: center;
    justify-content: center;
}

.flex--between {
    align-items: center;
    justify-content: space-between;
}

.flex--col {
    flex-direction: column;
}

.flex--gap-sm  { gap: var(--space-2); }
.flex--gap     { gap: var(--space-4); }
.flex--gap-md  { gap: var(--space-6); }
.flex--gap-lg  { gap: var(--space-8); }
.flex--gap-xl  { gap: var(--space-12); }


/* ────────────────────────────────────────────────────────────
   5. COMPONENTS
   ──────────────────────────────────────────────────────────── */

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    line-height: 1;
    letter-spacing: var(--tracking-wide);
    border-radius: var(--radius-md);
    transition: all var(--duration-normal) var(--ease-default);
    white-space: nowrap;
}

.btn--primary {
    background-color: var(--color-accent);
    color: var(--color-white);
}

.btn--primary:hover {
    background-color: var(--color-accent-dark);
    box-shadow: var(--shadow-glow);
}

.btn--secondary {
    background-color: transparent;
    color: var(--text-on-light);
    border: 1px solid var(--color-gray-200);
}

.btn--secondary:hover {
    border-color: var(--color-navy);
    background-color: var(--color-off-white);
}

.btn--ghost {
    background-color: transparent;
    color: var(--text-on-dark);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn--ghost:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background-color: rgba(255, 255, 255, 0.05);
}

.btn--white {
    background-color: var(--color-white);
    color: var(--color-navy);
}

.btn--white:hover {
    background-color: var(--color-off-white);
    box-shadow: var(--shadow-lg);
}

.btn--lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-base);
}

.btn--sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-xs);
}

/* ── Cards ── */
.card {
    background-color: var(--surface-light);
    border: var(--border-subtle-light);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    transition: box-shadow var(--duration-normal) var(--ease-default),
                transform var(--duration-normal) var(--ease-default);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card--dark {
    background-color: var(--surface-dark-alt);
    border: var(--border-subtle);
    color: var(--text-on-dark);
}

.card--dark:hover {
    background-color: rgba(40, 45, 74, 0.8);
    box-shadow: var(--shadow-glow);
}

.card--dark p {
    color: var(--text-on-dark-muted);
}

.card--flat {
    border: none;
    box-shadow: none;
    padding: var(--space-6);
    background-color: var(--surface-light-alt);
}

.card--flat:hover {
    box-shadow: var(--shadow-md);
}

.card__overline {
    margin-bottom: var(--space-3);
}

.card__title {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-weight: var(--weight-bold);
    margin-bottom: var(--space-3);
}

.card__text {
    color: var(--text-on-light-muted);
    margin-bottom: var(--space-4);
}

.card--dark .card__text {
    color: var(--text-on-dark-muted);
}

/* ── Badge / Tag ── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-wide);
    border-radius: var(--radius-full);
    background-color: var(--color-accent-subtle);
    color: var(--color-accent);
}

.badge--dark {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--color-accent-light);
}

/* ── Divider ── */
.divider {
    height: 1px;
    background-color: var(--color-gray-200);
    border: none;
    margin-block: var(--space-8);
}

.divider--dark {
    background-color: rgba(255, 255, 255, 0.08);
}

/* ── Metric / Stat Block ── */
.metric {
    text-align: center;
}

.metric__value {
    font-family: var(--font-heading);
    font-size: var(--text-5xl);
    font-weight: var(--weight-bold);
    letter-spacing: var(--tracking-tighter);
    line-height: var(--leading-none);
    color: var(--color-navy);
}

.metric__label {
    font-size: var(--text-sm);
    color: var(--text-on-light-muted);
    margin-top: var(--space-2);
}

.section--dark .metric__value {
    color: var(--color-white);
}

.section--dark .metric__label {
    color: var(--text-on-dark-muted);
}

/* ── Nav (floating pill) ── */
.nav {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-nav);
    width: calc(100% - 32px);
    max-width: 1552px;
    height: 64px;
    margin-top: 16px;
    padding: 0 var(--space-6);
    border-radius: 8px;
    background: hsla(0, 0%, 67%, 0.1);
    border: none;
    transition: background 0.4s ease,
                backdrop-filter 0.4s ease,
                border 0.4s ease,
                box-shadow 0.4s ease;
}

.nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.nav__logo {
    font-family: var(--font-heading);
    font-weight: var(--weight-bold);
    font-size: var(--text-xl);
    letter-spacing: var(--tracking-tight);
    color: var(--color-white);
}

.nav__logo span {
    display: block;
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: var(--weight-regular);
    letter-spacing: var(--tracking-widest);
    text-transform: uppercase;
    opacity: 0.5;
    margin-top: 2px;
}

/* ── Sector Bar ── */
.sector-bar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-8);
    padding-block: var(--space-10);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    letter-spacing: var(--tracking-wide);
    color: var(--text-on-dark-muted);
}

.sector-bar__item {
    position: relative;
    transition: color var(--duration-normal) var(--ease-default);
}

.sector-bar__item:hover {
    color: var(--text-on-dark);
}

.sector-bar__item::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--color-accent);
    transition: width var(--duration-normal) var(--ease-default);
}

.sector-bar__item:hover::after {
    width: 100%;
}

/* ── News Card (editorial style) ── */
.news-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.news-card__image {
    aspect-ratio: 16 / 9;
    background-color: var(--color-gray-100);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.news-card__meta {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-xs);
    color: var(--text-on-light-muted);
}

.news-card__category {
    font-weight: var(--weight-semibold);
    color: var(--color-accent);
}

.news-card__title {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: var(--weight-bold);
    line-height: var(--leading-snug);
}

.news-card__excerpt {
    font-size: var(--text-sm);
    color: var(--text-on-light-muted);
    line-height: var(--leading-relaxed);
}


/* ────────────────────────────────────────────────────────────
   6. UTILITIES
   ──────────────────────────────────────────────────────────── */

.text-center    { text-align: center; }
.text-left      { text-align: left; }
.text-right     { text-align: right; }

.mt-0   { margin-top: var(--space-0); }
.mt-2   { margin-top: var(--space-2); }
.mt-4   { margin-top: var(--space-4); }
.mt-6   { margin-top: var(--space-6); }
.mt-8   { margin-top: var(--space-8); }
.mt-12  { margin-top: var(--space-12); }
.mt-16  { margin-top: var(--space-16); }

.mb-0   { margin-bottom: var(--space-0); }
.mb-2   { margin-bottom: var(--space-2); }
.mb-4   { margin-bottom: var(--space-4); }
.mb-6   { margin-bottom: var(--space-6); }
.mb-8   { margin-bottom: var(--space-8); }
.mb-12  { margin-bottom: var(--space-12); }
.mb-16  { margin-bottom: var(--space-16); }

.mx-auto { margin-inline: auto; }

.w-full  { width: 100%; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}


/* ────────────────────────────────────────────────────────────
   7. RESPONSIVE
   ──────────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
    :root {
        --section-padding-y: var(--space-16);
    }

    h1, .h1 { font-size: var(--text-5xl); }
    h2, .h2 { font-size: var(--text-4xl); }
    h3, .h3 { font-size: var(--text-3xl); }

    .grid--3 { grid-template-columns: repeat(2, 1fr); }
    .grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    :root {
        --section-padding-y: var(--space-12);
        --gutter: var(--space-4);
    }

    h1, .h1 { font-size: var(--text-4xl); }
    h2, .h2 { font-size: var(--text-3xl); }
    h3, .h3 { font-size: var(--text-2xl); }

    .grid--2,
    .grid--3,
    .grid--4 {
        grid-template-columns: 1fr;
    }

    .sector-bar {
        gap: var(--space-4);
        font-size: var(--text-xs);
    }
}

@media (max-width: 480px) {
    h1, .h1 { font-size: var(--text-3xl); }
    h2, .h2 { font-size: var(--text-2xl); }
}
