/* ==========================================================================
   WK Growth Matrix — Reset, typography and layout primitives
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
    font-family: var(--font-body);
    font-size: var(--step-0);
    line-height: 1.75;
    color: var(--ink);
    background: var(--surface);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

html[dir="rtl"] body,
html[lang="ar"] body { font-family: var(--font-arabic); line-height: 1.95; }

img, svg, video, canvas { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration: none; }

button, input, select, textarea { font: inherit; color: inherit; }

button { background: none; border: 0; cursor: pointer; }

ul[class], ol[class] { list-style: none; padding: 0; }

:focus-visible {
    outline: 2px solid var(--gold-500);
    outline-offset: 3px;
    border-radius: var(--radius-xs);
}

::selection { background: var(--gold-300); color: var(--navy-800); }

/* --- Headings ---------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.015em;
    color: var(--navy-700);
    text-wrap: balance;
}

html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3,
html[dir="rtl"] h4, html[dir="rtl"] h5, html[dir="rtl"] h6 {
    font-family: var(--font-arabic);
    letter-spacing: 0;
    line-height: 1.45;
}

h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

p { text-wrap: pretty; }

strong, b { font-weight: 700; color: var(--navy-700); }

hr { border: 0; border-top: 1px solid var(--line); margin-block: var(--sp-6); }

/* --- Layout primitives -------------------------------------------------- */

.container {
    width: min(100% - (var(--gutter) * 2), var(--container));
    margin-inline: auto;
}

.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: var(--section-y); position: relative; }
.section--tight { padding-block: calc(var(--section-y) * .62); }
.section--alt   { background: var(--surface-alt); }
.section--sand  { background: linear-gradient(180deg, var(--sand-100), var(--cream)); }

.section--dark {
    background: var(--navy-700);
    color: var(--on-dark-soft);
}
.section--dark h1, .section--dark h2, .section--dark h3, .section--dark h4 { color: var(--white); }

.stack > * + * { margin-block-start: var(--sp-4); }

.grid { display: grid; gap: var(--sp-5); }

.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }

/* Paired form fields inside a narrow panel */
.grid--fields { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); column-gap: var(--sp-5); row-gap: 0; }

.flow-gap { display: flex; flex-wrap: wrap; gap: var(--sp-3); }

/* --- Utilities ---------------------------------------------------------- */

.text-center { text-align: center; }
.mx-auto { margin-inline: auto; }
.mt-6 { margin-block-start: var(--sp-6); }
.mt-5 { margin-block-start: var(--sp-5); }
.mt-4 { margin-block-start: var(--sp-4); }
.lead { font-size: var(--step-1); color: var(--ink-soft); line-height: 1.8; }
.muted { color: var(--ink-muted); }
.numeric { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.skip-link {
    position: absolute;
    inset-block-start: -100%;
    inset-inline-start: var(--sp-4);
    z-index: 200;
    background: var(--navy-700);
    color: var(--white);
    padding: var(--sp-3) var(--sp-5);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    transition: inset-block-start var(--dur) var(--ease);
}
.skip-link:focus { inset-block-start: 0; }

/* --- Motion on scroll --------------------------------------------------- */

.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; transition: none; }
}

/* --- Print --------------------------------------------------------------- */

@media print {
    .site-header, .site-footer, .floating-actions, .service-actions { display: none !important; }
    body { background: #fff; color: #000; }
    .section { padding-block: 1rem; }
}
