/* ==========================================================================
   base.css
   Font, design tokens (CSS variables), reset, typography, layout helpers,
   scrollbars, focus styles and the scroll-reveal animation.
   Every other stylesheet uses the variables defined here.
   ========================================================================== */

/* ---------- Font (local copy, see docs/CREDITS.md) ---------- */
@font-face {
    font-family: "Outfit";
    src: url("../fonts/outfit-latin-wght-normal.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* ---------- Design tokens ---------- */
:root {
    /* Colours. Contrast on white: ink 15:1, teal 7.4:1, muted 7:1 (all AA).
       Sun yellow is a background only, always with ink text on it. */
    --qo-ink: #10273d;            /* main text, dark panels */
    --qo-teal: #0b5f66;           /* brand colour: links, icons, deep panel */
    --qo-teal-dark: #084a50;      /* hover on teal */
    --qo-aqua: #d6f0ec;           /* icon badges, pale accents */
    --qo-mist: #eef7f5;           /* soft section panels */
    --qo-sun: #ffcc3d;            /* main call to action */
    --qo-sun-dark: #f5b800;       /* hover on sun */
    --qo-sun-soft: #fff4d1;
    --qo-white: #fff;
    --qo-muted: #4a5b6a;          /* secondary text */
    --qo-line: rgba(16, 39, 61, 0.12);
    --qo-on-dark-muted: rgba(255, 255, 255, 0.82);

    /* Typography */
    --qo-font: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
    --qo-h1: 58px;
    --qo-h2: 40px;
    --qo-h3: 22px;
    --qo-lead: 19px;

    /* Layout */
    --qo-container: 1200px;
    --qo-gutter: 32px;            /* side padding inside the container */
    --qo-edge: 20px;              /* gap between full-width panels and the screen edge */
    --qo-section: 110px;          /* vertical space inside sections */
    --qo-radius-xl: 36px;         /* big panels */
    --qo-radius-lg: 24px;         /* cards, photos */
    --qo-radius-md: 16px;
    --qo-shadow: 0 18px 40px -18px rgba(16, 39, 61, 0.25);
    --qo-shadow-soft: 0 6px 24px rgba(16, 39, 61, 0.07);
    --qo-header-h: 84px;

    /* Motion */
    --qo-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (max-width: 1024px) {
    :root {
        --qo-h1: 44px; --qo-h2: 32px; --qo-h3: 20px;
        --qo-gutter: 24px;
        --qo-section: 84px;
        --qo-radius-xl: 28px;
    }
}
@media (max-width: 767px) {
    :root {
        --qo-h1: 34px; --qo-h2: 27px; --qo-h3: 19px; --qo-lead: 17px;
        --qo-gutter: 16px;
        --qo-edge: 10px;
        --qo-section: 64px;
        --qo-radius-xl: 24px;
        --qo-radius-lg: 18px;
        --qo-header-h: 70px;
    }
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--qo-header-h) + 16px); }
body {
    margin: 0;
    font-family: var(--qo-font);
    font-size: 17px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--qo-ink);
    background: var(--qo-white);
    overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
dl, dd, figure, blockquote { margin: 0; }

/* ---------- Typography ---------- */
h1, h2, h3 {
    margin: 0;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: inherit;
}
h1 { font-size: var(--qo-h1); line-height: 1.08; }
h2 { font-size: var(--qo-h2); line-height: 1.15; }
h3 { font-size: var(--qo-h3); line-height: 1.3; letter-spacing: -0.01em; }

.qo-link { color: var(--qo-teal); text-decoration: underline; text-underline-offset: 3px; }
.qo-link:hover { color: var(--qo-teal-dark); }

/* Long text (privacy policy) */
.qo-prose h2 { font-size: 24px; margin: 1.8em 0 0.5em; }
.qo-prose h2:first-child { margin-top: 0; }
.qo-prose a { color: var(--qo-teal); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Layout helpers ---------- */
.qo-container {
    width: 100%;
    max-width: calc(var(--qo-container) + var(--qo-gutter) * 2);
    margin-inline: auto;
    padding-inline: var(--qo-gutter);
}
.qo-container--narrow { max-width: calc(780px + var(--qo-gutter) * 2); }

.qo-section { padding-block: var(--qo-section); }
.qo-section--tight { padding-block: calc(var(--qo-section) * 0.6); }
.qo-section--flush-top { padding-top: 0; }

/* Full-width rounded panel that sits a little in from the screen edges */
.qo-panel { margin-inline: var(--qo-edge); border-radius: var(--qo-radius-xl); }
.qo-panel--mist { background: var(--qo-mist); }
.qo-panel--deep { background: var(--qo-teal); color: var(--qo-white); }

.qo-grid { display: grid; gap: 24px; }
.qo-grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1024px) {
    .qo-grid--3 { grid-template-columns: repeat(2, 1fr); }
    /* An odd last card would sit alone in two columns: let it take the full row */
    .qo-grid--3 > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 767px)  { .qo-grid--3 { grid-template-columns: 1fr; gap: 16px; } }

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

/* Skip link: visible only when focused with the keyboard */
.qo-skip-link {
    position: absolute;
    left: 16px; top: -60px;
    z-index: 1000;
    padding: 12px 20px;
    border-radius: 30px;
    background: var(--qo-sun);
    font-weight: 600;
    transition: top 0.2s;
}
.qo-skip-link:focus { top: 16px; }

/* ---------- Focus ---------- */
:focus-visible {
    outline: 3px solid var(--qo-teal);
    outline-offset: 3px;
    border-radius: 6px;
}
.qo-panel--deep :focus-visible, .qo-footer :focus-visible { outline-color: var(--qo-sun); }

/* ---------- Icons (inline SVG from helpers.php icon()) ---------- */
.qo-icon { width: 1em; height: 1em; flex-shrink: 0; }

/* ---------- Scrollbars: thin, on-palette (global rule) ---------- */
html, .qo-scroll {
    scrollbar-width: thin;
    scrollbar-color: var(--qo-teal) var(--qo-mist);
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--qo-mist); }
::-webkit-scrollbar-thumb { background: var(--qo-teal); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--qo-teal-dark); }

/* ---------- Scroll reveal ----------
   Elements get data-reveal="fade|up|left" and optional data-delay (ms).
   reveal.js adds .is-visible when they scroll into view. Without JS nothing is
   hidden (the hidden state only applies once <html> has the .has-js class). */
.has-js [data-reveal] {
    opacity: 0;
    transition: opacity 0.8s var(--qo-ease), transform 0.8s var(--qo-ease);
}
.has-js [data-reveal="up"] { transform: translateY(32px); }
.has-js [data-reveal="left"] { transform: translateX(-40px); }
.has-js [data-reveal].is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
    .has-js [data-reveal] { opacity: 1; transform: none; }
}
