/* Xvetu Solutions - shared design layer for xvetu.com
 *
 * This file carries two things every page of the site shares:
 *   1. the brand font, served as a file from this server (no third party);
 *   2. the design tokens of the company - the same yellow / violet / pink
 *      language the company already speaks, taken from its own site.
 *
 * The product pages (sherloc) and the documents (privacy, terms) link this file
 * so the font and the tokens live in one place instead of being pasted into
 * every page: one cached request instead of 35 KB glued into each file.
 *
 * The font files sit next to this file, in ../fonts/. The address is written
 * relative on purpose, so the page works both from this server and from disk.
 *
 * Scope. Only the font and the tokens are site-wide. Every layout component of
 * the company pages is written under .xv-shell, because the product page uses
 * the same class names (.xv-brand, .xv-hero, .xv-nav, .xv-card, .xv-wrap) for
 * its own, older layer: without the prefix this file would repaint the product
 * page with company rules. A page that does not carry .xv-shell on its body
 * receives the font and the tokens and nothing else.
 */

@font-face {
    font-family: 'HoReCa Alt';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/horeca-alt-w700.woff2") format("woff2");
}

@font-face {
    font-family: 'HoReCa Alt';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url("../fonts/horeca-alt-w800.woff2") format("woff2");
}

:root {
    /* Brand - the four colours of the company, unchanged. */
    --xv-yellow: #FFCC00;
    --xv-violet: #6421FF;
    --xv-violet-light: #A10DFF;
    --xv-pink: #FE4880;
    --xv-ink: #212121;
    --xv-ink-soft: #40404E;
    --xv-line: #DADADA;
    --xv-paper: #F3F3F3;

    /* Semantic names the pages use. Light theme is the default. */
    --bg: var(--xv-paper);
    --surface: #FFFFFF;
    --surface-2: #FBFBFB;
    --text: var(--xv-ink);
    --text-muted: var(--xv-ink-soft);
    --border: var(--xv-line);
    --border-strong: #C4C4CC;
    --accent: var(--xv-violet);
    --accent-strong: #4E15D6;
    --accent-soft: rgba(100, 33, 255, .10);
    --accent-2: var(--xv-pink);
    --accent-3: var(--xv-yellow);
    --on-accent: #FFFFFF;
    --focus: var(--xv-violet-light);

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 999px;
    --tap-min: 46px;

    --font-display: "HoReCa Alt", "Arial Black", "Segoe UI", sans-serif;
    --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, "Liberation Mono", monospace;

    --w-max: 1080px;
    --w-text: 68ch;
    --gap: 24px;
    --pad-x: clamp(18px, 4vw, 40px);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #16161A;
        --surface: #1F1F25;
        --surface-2: #191920;
        --text: #F3F3F3;
        --text-muted: #B9B9C2;
        --border: #33333C;
        --border-strong: #45454F;
        --accent: var(--xv-violet-light);
        --accent-strong: #B65CFF;
        --accent-soft: rgba(161, 13, 255, .16);
        --on-accent: #FFFFFF;
        --focus: var(--xv-yellow);
    }
}

/* -- Reset ----------------------------------------------------------------- */

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 17px;
    line-height: 1.6;
}

img,
svg {
    max-width: 100%;
    height: auto;
}

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

/* -- Company shell --------------------------------------------------------- */

.xv-shell {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
}

.xv-shell a {
    color: var(--accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.xv-shell a:hover {
    color: var(--accent-strong);
}

.xv-shell h1,
.xv-shell h2,
.xv-shell h3 {
    font-family: var(--font-display);
    line-height: 1.05;
    letter-spacing: -.01em;
    margin: 0 0 .4em;
    text-wrap: balance;
}

.xv-shell h1 {
    font-size: clamp(2.1rem, 6vw, 3.6rem);
    font-weight: 800;
    text-transform: uppercase;
}

.xv-shell h2 {
    font-size: clamp(1.5rem, 3.6vw, 2.2rem);
    font-weight: 700;
}

.xv-shell h3 {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0;
}

.xv-shell p {
    margin: 0 0 1em;
    text-wrap: pretty;
}

.xv-shell .xv-wrap {
    width: min(100% - 2 * var(--pad-x), var(--w-max));
    margin-inline: auto;
}

/* The brand mark is declared once in a zero-size svg and referenced by <use>.
   display:none would break <use> in some engines, so the box is collapsed
   instead. The paths draw themselves with currentColor, so the colour of the
   place that uses them decides. */
.xv-shell .xv-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.xv-shell .xv-skip {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 10;
    padding: 10px 16px;
    background: var(--surface);
    color: var(--text);
    border-radius: 0 0 var(--radius-sm) 0;
}

.xv-shell .xv-skip:focus {
    left: 0;
}

/* -- Header ---------------------------------------------------------------- */

.xv-shell .xv-header {
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(8px);
}

.xv-shell .xv-header__in {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: var(--gap);
    padding-block: 14px;
}

.xv-shell .xv-brand {
    display: inline-grid;
    grid-template-columns: auto auto;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
}

.xv-shell .xv-brand__mark {
    width: 34px;
    height: 34px;
    color: var(--xv-violet);
}

.xv-shell .xv-brand__name {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.xv-shell .xv-nav {
    display: grid;
    grid-auto-flow: column;
    justify-content: end;
    gap: clamp(10px, 2.4vw, 26px);
    align-items: center;
}

.xv-shell .xv-nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: .95rem;
    min-height: var(--tap-min);
    display: inline-grid;
    align-items: center;
    white-space: nowrap;
}

.xv-shell .xv-nav a:hover {
    color: var(--text);
}

.xv-shell .xv-nav a[aria-current="page"] {
    color: var(--text);
    font-weight: 600;
}

/* On a narrow phone the wordmark and four links do not fit one row: the header
   becomes two rows instead of squeezing the name and breaking the Chinese label
   in half. */
@media (max-width: 640px) {
    .xv-shell .xv-header__in {
        grid-template-columns: 1fr;
        gap: 4px;
        padding-block: 10px;
    }

    .xv-shell .xv-nav {
        justify-content: start;
        gap: 18px;
    }

    .xv-shell .xv-brand__name {
        font-size: .98rem;
    }
}

/* -- Hero ------------------------------------------------------------------ */

.xv-shell .xv-hero {
    display: grid;
    justify-items: start;
    gap: 18px;
    padding-block: clamp(48px, 9vw, 104px) clamp(32px, 6vw, 64px);
}

.xv-shell .xv-hero__mark {
    width: clamp(84px, 16vw, 132px);
    height: clamp(84px, 16vw, 132px);
    color: var(--xv-violet);
}

.xv-shell .xv-hero h1 {
    max-width: 20ch;
}

.xv-shell .xv-hero__lead {
    max-width: 58ch;
    font-size: clamp(1.05rem, 2.2vw, 1.25rem);
    color: var(--text-muted);
}

.xv-shell .xv-rule {
    width: 64px;
    height: 4px;
    border: 0;
    margin: 4px 0 0;
    background: var(--xv-yellow);
    border-radius: var(--radius-pill);
}

/* -- Sections -------------------------------------------------------------- */

.xv-shell .xv-section {
    padding-block: clamp(36px, 6vw, 64px);
}

.xv-shell .xv-section + .xv-section {
    border-top: 1px solid var(--border);
}

.xv-shell .xv-section__head {
    display: grid;
    gap: 6px;
    margin-bottom: 26px;
}

.xv-shell .xv-section__note {
    color: var(--text-muted);
    max-width: var(--w-text);
}

/* -- Cards (products) ------------------------------------------------------ */

.xv-shell .xv-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: var(--gap);
}

.xv-shell .xv-card {
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    gap: 10px;
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.xv-shell .xv-card__tag {
    justify-self: start;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 4px 12px;
}

.xv-shell .xv-card h3 {
    margin: 0;
}

.xv-shell .xv-card p {
    margin: 0;
    color: var(--text-muted);
}

.xv-shell .xv-card__go {
    justify-self: start;
    display: inline-grid;
    grid-auto-flow: column;
    align-items: center;
    gap: 8px;
    min-height: var(--tap-min);
    font-weight: 600;
    text-decoration: none;
}

.xv-shell .xv-card__go::after {
    content: "";
    width: .6em;
    height: .6em;
    border-right: 2px solid currentColor;
    border-top: 2px solid currentColor;
    transform: rotate(45deg);
}

.xv-shell .xv-card--soon {
    background: var(--surface-2);
    border-style: dashed;
}

.xv-shell .xv-card--soon .xv-card__go {
    color: var(--text-muted);
}

.xv-shell .xv-card--soon .xv-card__go::after {
    display: none;
}

/* -- About list ------------------------------------------------------------ */

.xv-shell .xv-points {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: var(--gap) var(--gap);
    margin: 0;
    padding: 0;
    list-style: none;
}

.xv-shell .xv-points li {
    display: grid;
    gap: 6px;
    padding-left: 18px;
    border-left: 3px solid var(--xv-yellow);
}

.xv-shell .xv-points b {
    font-family: var(--font-display);
    letter-spacing: .01em;
}

.xv-shell .xv-points span {
    color: var(--text-muted);
    font-size: .96rem;
}

/* -- Footer ---------------------------------------------------------------- */

.xv-shell .xv-footer {
    border-top: 1px solid var(--border);
    margin-top: 40px;
    padding-block: 30px 40px;
    color: var(--text-muted);
    font-size: .93rem;
}

.xv-shell .xv-footer__in {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: var(--gap);
}

.xv-shell .xv-footer__col {
    display: grid;
    gap: 6px;
    align-content: start;
}

.xv-shell .xv-footer b {
    color: var(--text);
}

.xv-shell .xv-footer a {
    color: inherit;
}

.xv-shell .xv-footer__bottom {
    margin-top: 26px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    display: grid;
    gap: 8px;
}

@media (min-width: 760px) {
    .xv-shell .xv-footer__bottom {
        grid-auto-flow: column;
        justify-content: space-between;
    }
}

/* -- Motion ---------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
    }
}
