/* ==========================================================================
   Flare IT — base.css
   Reset, document defaults, typography and layout primitives.
   Mobile-first: base styles target 320px, then min-width queries layer up.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Reset
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

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

body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd, ul, ol {
    margin: 0;
}

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

img,
picture,
svg,
video,
iframe {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
}

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

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

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

/* --------------------------------------------------------------------------
   2. Document
   -------------------------------------------------------------------------- */
body {
    min-height: 100vh;
    font-family: var(--font-body);
    font-size: var(--fs-body);
    line-height: var(--lh-normal);
    color: var(--text);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    transition: background-color var(--t-base) var(--ease),
        color var(--t-base) var(--ease);
}

::selection {
    background: var(--selection);
    color: var(--selection-text);
}

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

/* Never remove focus styling — only shape it. */
:focus:not(:focus-visible) {
    outline: none;
}

.skip-link {
    position: absolute;
    left: var(--sp-4);
    top: -100%;
    z-index: 200;
    padding: 0.7rem 1.1rem;
    background: var(--primary);
    color: var(--on-primary);
    border-radius: var(--r-sm);
    font-weight: 600;
    font-size: var(--fs-sm);
    text-decoration: none;
    transition: top var(--t-fast) var(--ease);
}

.skip-link:focus {
    top: var(--sp-3);
}

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

.no-scroll {
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   3. Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: var(--lh-snug);
    letter-spacing: var(--tracking-tight);
    color: var(--text);
    text-wrap: balance;
}

h1 { font-size: var(--fs-h1); line-height: var(--lh-tight); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }
h5 { font-size: var(--fs-body); }
h6 {
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: var(--tracking-eyebrow);
    color: var(--text-muted);
}

p {
    text-wrap: pretty;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--t-fast) var(--ease);
}

a:hover {
    color: var(--primary-hover);
}

strong, b { font-weight: 650; }

code, kbd, samp {
    font-family: var(--font-mono);
    font-size: 0.9em;
}

code {
    background: var(--surface-3);
    color: var(--text);
    padding: 0.14em 0.42em;
    border-radius: var(--r-xs);
}

/* Eyebrow / kicker label above section headings */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55em;
    font-family: var(--font-body);
    font-size: var(--fs-eyebrow);
    font-weight: 700;
    letter-spacing: var(--tracking-eyebrow);
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: var(--sp-3);
}

.eyebrow::before {
    content: "";
    width: 1.9rem;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    opacity: 0.75;
}

.eyebrow--center {
    justify-content: center;
}

.eyebrow--center::after {
    content: "";
    width: 1.9rem;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    opacity: 0.75;
}

.lede {
    font-size: var(--fs-body-lg);
    line-height: var(--lh-relaxed);
    color: var(--text-soft);
}

.text-muted { color: var(--text-muted); }
.text-soft { color: var(--text-soft); }
.text-center { text-align: center; }
.mono { font-family: var(--font-mono); }

/* Gradient text used sparingly — one or two words at most */
.text-gradient {
    background: var(--grad-brand);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* --------------------------------------------------------------------------
   4. Layout
   -------------------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--container);
    min-width: 0;
    margin-inline: auto;
    padding-inline: var(--gutter);
}

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

.container--wide {
    max-width: 1360px;
}

.section {
    padding-block: var(--section-y);
    position: relative;
}

.section--tight {
    padding-block: calc(var(--section-y) * 0.66);
}

.section--alt {
    background: var(--bg-alt);
}

.section--deep {
    background: var(--bg-deep);
    color: #fff;
}

.section--deep h1,
.section--deep h2,
.section--deep h3,
.section--deep h4 {
    color: #fff;
}

.section--soft {
    background:
        radial-gradient(120% 90% at 12% 0%, var(--primary-soft) 0%, transparent 58%),
        var(--bg);
}

.section-head {
    max-width: 44rem;
    margin-bottom: var(--sp-7);
}

.section-head--center {
    margin-inline: auto;
    text-align: center;
}

.section-head p {
    margin-top: var(--sp-4);
    color: var(--text-soft);
    font-size: var(--fs-body-lg);
    line-height: var(--lh-relaxed);
}

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

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

.grid > *,
.split > * {
    min-width: 0;
}

.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }
.grid--4 { grid-template-columns: 1fr; }
.grid--auto {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
}

.split {
    display: grid;
    gap: var(--sp-6);
    align-items: center;
}

.cluster {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3);
    align-items: center;
}

.between {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-4);
    align-items: center;
    justify-content: space-between;
}

/* Hairline divider that respects the theme */
.rule {
    height: 1px;
    border: 0;
    background: linear-gradient(
        90deg,
        transparent,
        var(--border-strong) 18%,
        var(--border-strong) 82%,
        transparent
    );
}

/* Decorative brand blobs / grid paper used behind sections */
.bg-grid {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(to right, var(--border-subtle) 1px, transparent 1px),
        linear-gradient(to bottom, var(--border-subtle) 1px, transparent 1px);
    background-size: 68px 68px;
    mask-image: radial-gradient(72% 62% at 50% 32%, #000 0%, transparent 78%);
    -webkit-mask-image: radial-gradient(72% 62% at 50% 32%, #000 0%, transparent 78%);
    opacity: 0.85;
}

/* --------------------------------------------------------------------------
   5. Breakpoints
   -------------------------------------------------------------------------- */
@media (min-width: 480px) {
    .grid--2 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
    :root { --nav-h: 74px; }

    .grid--3 { grid-template-columns: repeat(2, 1fr); }
    .grid--4 { grid-template-columns: repeat(2, 1fr); }

    .split {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--sp-7);
    }

    .split--wide-first > :first-child { grid-column: span 1; }
    .split--60-40 { grid-template-columns: 1.35fr 1fr; }
    .split--40-60 { grid-template-columns: 1fr 1.35fr; }
}

@media (min-width: 1024px) {
    .grid--3 { grid-template-columns: repeat(3, 1fr); }
    .grid--4 { grid-template-columns: repeat(4, 1fr); }

    .split--sticky {
        align-items: start;
    }
}

@media (min-width: 1280px) {
    .container { padding-inline: var(--gutter); }
}

@media (min-width: 1600px) {
    body { font-size: 1.0625rem; }
}

@media (max-width: 640px) {
    .section-head {
        margin-bottom: var(--sp-6);
    }

    .between {
        align-items: flex-start;
    }

    .between > .btn {
        width: 100%;
    }
}

/* --------------------------------------------------------------------------
   6. Motion preferences
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }

    /* Scroll-reveal elements simply appear. */
    [data-reveal] {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Print — keep it clean if anyone prints a course page or invoice. */
@media print {
    .site-header,
    .site-footer,
    .theme-switcher,
    .btn,
    .hero__visual {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
    }
}
