/* Explain: Base styles for layout, typography, and header positioning. */
* {
    box-sizing: border-box;
}

html {
    background: var(--background-color);
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--text-color);
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
    font-family: var(--font-heading);
    font-weight: 800;
    line-height: 1.4;
}

/* Margins are deliberately NOT reset here. This stylesheet sits outside the
   Tailwind cascade layers, so any rule written in it overrides the layered
   utilities used in the markup — a "margin: 0" reset would cancel every mt-*
   gap and glue headings and paragraphs together. Tailwind's own base reset
   already zeroes these margins, and the utilities add the spacing back. */

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

img {
    max-width: 100%;
}

[hidden] {
    display: none !important;
}

::selection {
    background: var(--accent-color);
    color: var(--dark-color);
}

.container-x {
    width: 100%;
    max-width: 80rem;
    margin-inline: auto;
    padding-inline: 1.25rem;
}

/* Inner pages: the header sits in the normal page flow on a dark band,
   so the navigation and contact bar stay clearly readable above light content. */
body > header {
    position: relative;
    background: var(--dark-color);
    z-index: 999;
}

/* Homepage: the header floats over the dark hero image and stays in place.
   It does NOT follow the visitor while scrolling (not fixed / not sticky). */
body.header-overlay > header {
    position: absolute !important;
    top: 0 !important;
    inset-inline: 0 !important;
    width: 100%;
    background: transparent;
}

/* Keep the scrolling root free of overflow rules that break fixed elements */
html,
body {
    overflow-x: clip;
}