/* Cognivance — shared shell (tokens, base, nav, footer, buttons)
   Layout idea: an annotated worked example. One wide column, grotesk display
   headings, plain sans body, mono annotations in blue ink. The studio shell
   stays neutral; the only other colour on the page belongs to the products. */

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

:root {
    /* neutrals, biased slightly towards the blue accent */
    --paper: #f8f9fb;
    --surface: #ffffff;
    --sunk: #eff1f5;
    --ink: #12151c;
    --ink-2: #474e5d;
    --ink-3: #6f7686;
    --line: #e1e4ea;
    --line-2: #c8cdd7;

    /* the studio's one accent: annotation ink */
    --accent: #2b40e0;
    --accent-hover: #1f31c0;
    --accent-soft: rgba(43, 64, 224, 0.08);
    --on-accent: #ffffff;

    /* inverted panel (contact) */
    --inv-bg: #12151c;
    --inv-ink: #f3f5f9;
    --inv-ink-2: #aab1c0;
    --inv-line: #2b3140;
    --inv-field: #1b1f29;

    /* status colours used inside product figures */
    --ok: #157f4b;
    --ok-soft: rgba(21, 127, 75, 0.12);
    --warn: #9a5b00;
    --warn-soft: rgba(196, 124, 10, 0.16);
    --bad: #b3261e;
    --bad-soft: rgba(179, 38, 30, 0.11);

    /* product accents: fill, text-safe ink, soft tint */
    --pp: #b7791f;   --pp-ink: #8a5a0c;   --pp-soft: rgba(183, 121, 31, 0.13);
    --al: #1f8a55;   --al-ink: #176b41;   --al-soft: rgba(31, 138, 85, 0.12);
    --nb: #f2bd13;   --nb-ink: #7d5c00;   --nb-soft: rgba(242, 189, 19, 0.30);
    --bq: #5fa82c;   --bq-ink: #3d7a12;   --bq-soft: rgba(95, 168, 44, 0.16);
    --up: #1f5fae;   --up-ink: #1f5fae;   --up-soft: rgba(31, 95, 174, 0.11);

    --nav-bg: rgba(248, 249, 251, 0.86);
    --shadow: 0 1px 2px rgba(18, 21, 28, 0.04), 0 12px 32px -12px rgba(18, 21, 28, 0.12);

    --font-display: 'Bricolage Grotesque', 'Helvetica Neue', Arial, sans-serif;
    --font-body: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

    --wrap: 1180px;
    --gutter: clamp(1.25rem, 4vw, 3rem);
    --r-s: 6px;
    --r-m: 12px;

    color-scheme: light;
}

/* dark is the default; the light values above apply once the visitor switches to light */
:root:not([data-theme="light"]) {
    --paper: #101117;           /* the hero film's own background, so the film has no visible edge */
    --surface: #141822;
    --sunk: #10141c;
    --ink: #e9ecf3;
    --ink-2: #aab1bf;
    --ink-3: #7f8798;
    --line: #232937;
    --line-2: #363e50;
    --accent: #96a4ff;
    --accent-hover: #b3bdff;
    --accent-soft: rgba(150, 164, 255, 0.12);
    --on-accent: #0d1017;
    --inv-bg: #141822;
    --inv-ink: #e9ecf3;
    --inv-ink-2: #aab1bf;
    --inv-line: #2a3142;
    --inv-field: #0d1017;
    --ok: #5bd39a;
    --ok-soft: rgba(91, 211, 154, 0.14);
    --warn: #f0b354;
    --warn-soft: rgba(240, 179, 84, 0.15);
    --bad: #ff8d85;
    --bad-soft: rgba(255, 141, 133, 0.14);
    --pp: #e0a93b;   --pp-ink: #ebbb5c;   --pp-soft: rgba(224, 169, 59, 0.16);
    --al: #4fc78a;   --al-ink: #6ad7a0;   --al-soft: rgba(79, 199, 138, 0.15);
    --nb: #ffd23f;   --nb-ink: #ffd96a;   --nb-soft: rgba(255, 210, 63, 0.22);
    --bq: #86cc48;   --bq-ink: #9edc66;   --bq-soft: rgba(134, 204, 72, 0.16);
    --up: #6ea8ef;   --up-ink: #8fbcf5;   --up-soft: rgba(110, 168, 239, 0.15);
    --nav-bg: rgba(16, 17, 23, 0.84);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 40px -16px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 5rem;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.6;
    background: var(--paper);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: inherit; }

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

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

.wrap {
    width: 100%;
    max-width: calc(var(--wrap) + 2 * var(--gutter));
    margin-inline: auto;
    padding-inline: var(--gutter);
}

/* text that is read out but not shown (the hero film already shows the headline) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* --- type roles --- */
.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
}

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.05;
    text-wrap: balance;
}

/* --- nav --- */
.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--nav-bg);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    backdrop-filter: saturate(1.4) blur(14px);
    border-bottom: 1px solid var(--line);
}

.nav-in {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    min-height: 4rem;
}

.brand {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    text-decoration: none;
    color: var(--ink);
}

.brand i {
    font-style: normal;
    color: var(--accent);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1.75rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.75rem;
    list-style: none;
}

.nav-links a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--ink-2);
    text-decoration: none;
    transition: color 0.15s;
}

.nav-links a:hover { color: var(--ink); }

.nav-tools {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.theme-btn, .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    color: var(--ink-2);
    background: none;
    border: 1px solid var(--line);
    border-radius: var(--r-s);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.theme-btn:hover, .nav-toggle:hover { color: var(--ink); border-color: var(--line-2); }
.theme-btn svg, .nav-toggle svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* sun shows in dark, moon in light */
.theme-btn .i-sun { display: none; }
:root:not([data-theme="light"]) .theme-btn .i-sun { display: block; }
:root:not([data-theme="light"]) .theme-btn .i-moon { display: none; }

.nav-toggle { display: none; }

@media (max-width: 860px) {
    .nav-toggle { display: inline-flex; }
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 1rem var(--gutter) 1.5rem;
        background: var(--paper);
        border-bottom: 1px solid var(--line);
    }
    .nav-menu.open { display: flex; }
    .nav-links { flex-direction: column; align-items: stretch; gap: 0; }
    .nav-links a { display: block; padding: 0.7rem 0; font-size: 1rem; border-bottom: 1px solid var(--line); }
}

/* --- buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1;
    padding: 0.85rem 1.25rem;
    border-radius: var(--r-s);
    border: 1px solid transparent;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}

.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }

.btn-quiet { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-quiet:hover { border-color: var(--ink); }

.btn[disabled] { opacity: 0.6; cursor: default; }

/* --- footer --- */
.foot {
    border-top: 1px solid var(--line);
    padding-block: 2.5rem 3rem;
    font-size: 0.875rem;
    color: var(--ink-3);
}

.foot-in {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem 2.5rem;
}

.foot-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    list-style: none;
}

.foot a { color: var(--ink-2); text-decoration: none; }
.foot a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* --- painted panels ---
   One idea runs through the site: dark panels with a painted abstract picture
   (mosaic.js paints any element that has data-art), white-outlined pills, and
   frosted glass that carries text. Panels look the same in light and dark
   mode, so the colours on them are fixed. */
:root {
    --panel: #0d1017;
    --glass: rgba(255, 255, 255, 0.76);
    --glass-strong: rgba(255, 255, 255, 0.86);
    --on-glass: #12151c;
    --on-glass-2: #2a3040;
    --on-glass-3: #3a4150;
    --panel-accent: #2b40e0;
    --gap: clamp(0.9rem, 1.6vw, 1.5rem);
}

.panel {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    border-radius: 6px;
    background: var(--panel);
    color: #ffffff;
}

/* the painted picture; a little larger than its panel so it can drift */
.tile-art {
    position: absolute;
    inset: -8%;
    width: 116%;
    height: 116%;
    z-index: -1;
    animation: tile-drift 26s ease-in-out infinite alternate;
}

@keyframes tile-drift {
    from { transform: translate3d(-2.5%, -2%, 0) scale(1); }
    to { transform: translate3d(2.5%, 2%, 0) scale(1.06); }
}

.pill, .tile-pill {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #ffffff;
    padding: 0.3rem 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 7px;
    background: rgba(10, 14, 24, 0.45);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.glass {
    border-radius: 14px;
    background: var(--glass);
    -webkit-backdrop-filter: blur(18px) saturate(1.5);
    backdrop-filter: blur(18px) saturate(1.5);
    color: var(--on-glass);
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; animation: none !important; }
}
