/*
 * Stux.Group - site styles
 * Square-cornered and quiet, with Stux.Group red as the accent and red-tinted backgrounds. Dark and light themes:
 * every colour comes from the tokens below. The theme follows the system unless the
 * visitor picks one with the nav toggle (stored in localStorage, applied before paint as
 * <html data-theme="light|dark">).
 */

@font-face { font-family: "Satoshi"; src: url("../fonts/Satoshi-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url("../fonts/Satoshi-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url("../fonts/Satoshi-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url("../fonts/Satoshi-900.woff2") format("woff2"); font-weight: 900; font-display: swap; }

/* ── Tokens ──────────────────────────────────────────────────────────── */

:root {
    color-scheme: dark;
    --bg: #120303;
    --bg-deep: #0a0202;
    --bg-card: rgba(18, 3, 3, .9);
    --surface: #271a1a;          /* icon boxes, hover washes */
    --line: #271a1a;
    --line-2: #3f3333;
    --text: #d4d4d4;
    --text-strong: #f5f5f5;
    --text-muted: #a3a3a3;
    --text-dim: #737373;
    --text-faint: #525252;
    --grid-line: rgba(255, 255, 255, .035);
    --grid-line-visual: rgba(255, 255, 255, .05);   /* brand-card visuals: a touch stronger */
    --nav-bg: rgba(18, 3, 3, .82);   /* the page colour, translucent: the bar blends in instead of reading as a black band */
    --btn-bg: #fff;
    --btn-text: #262626;
    --btn-hover: #e5e5e5;
    --shadow: 0 25px 50px -12px rgba(0, 0, 0, .5);
    --hero-glow: rgba(209, 15, 15, .16);
    --brand: #d10f0f;            /* Stux.Group red: the exact colour of the logo and icon, in both themes */
    --ok: #22c55e;
    --err: #f87171;
    --font-display: "Satoshi", ui-sans-serif, system-ui, sans-serif;
    --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
    --nav-h: 72px;
    /* site-banner.css hooks */
    --banner-page-bg: var(--bg);
    --banner-text: var(--text);
    --banner-site: var(--brand);
    --banner-site-light: #b01414;
}

/* Light theme - defined twice: once for an explicit choice, once for the system setting. */
:root[data-theme="light"] {
    color-scheme: light;
    --bg: #fff6f6;
    --bg-deep: #f8e8e8;
    --bg-card: rgba(255, 255, 255, .92);
    --surface: #f5e1e1;
    --line: #f3dfdf;
    --line-2: #e1c3c3;
    --text: #404040;
    --text-strong: #0a0a0a;
    --text-muted: #525252;
    --text-dim: #6b6b6b;
    --text-faint: #8f8f8f;
    --grid-line: rgba(0, 0, 0, .07);
    --grid-line-visual: rgba(0, 0, 0, .11);
    --nav-bg: rgba(255, 246, 246, .82);
    --btn-bg: #171717;
    --btn-text: #fff;
    --btn-hover: #333;
    --shadow: 0 25px 50px -20px rgba(0, 0, 0, .18);
    --hero-glow: rgba(209, 15, 15, .12);
    --brand: #d10f0f;
    --ok: #16a34a;
    --err: #dc2626;
}
@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        color-scheme: light;
        --bg: #fff6f6;
        --bg-deep: #f8e8e8;
        --bg-card: rgba(255, 255, 255, .92);
        --surface: #f5e1e1;
        --line: #f3dfdf;
        --line-2: #e1c3c3;
        --text: #404040;
        --text-strong: #0a0a0a;
        --text-muted: #525252;
        --text-dim: #6b6b6b;
        --text-faint: #8f8f8f;
        --grid-line: rgba(0, 0, 0, .07);
        --grid-line-visual: rgba(0, 0, 0, .11);
        --nav-bg: rgba(255, 246, 246, .82);
        --btn-bg: #171717;
        --btn-text: #fff;
        --btn-hover: #333;
        --shadow: 0 25px 50px -20px rgba(0, 0, 0, .18);
        --hero-glow: rgba(209, 15, 15, .12);
        --brand: #d10f0f;
        --ok: #16a34a;
        --err: #dc2626;
    }
}

/* ── Base ────────────────────────────────────────────────────────────── */

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + var(--banner-h, 0px));
}
/* site-banner.css sets its own scroll padding; keep room for the fixed nav as well. */
html:root.has-site-banner {
    scroll-padding-top: calc(var(--nav-h) + var(--banner-h, 0px));
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition: background-color .3s ease, color .3s ease;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
::selection { background: var(--brand); color: #fff; }

:focus-visible { outline: 2px solid var(--text-strong); outline-offset: 3px; }

.skip-link {
    position: absolute; left: 16px; top: -48px; z-index: 1000;
    background: var(--btn-bg); color: var(--btn-text); padding: 8px 14px; font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }

/* ── Nav ─────────────────────────────────────────────────────────────── */

.nav {
    position: fixed;
    top: var(--banner-h, 0px);
    left: 0; right: 0;
    z-index: 100;
    border-bottom: 1px solid transparent;
    transition: background .3s ease, border-color .3s ease;
}
.nav.is-solid,
.is-page .nav {
    background: var(--nav-bg);
    border-bottom-color: var(--line);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}
/* Three columns - logo, links, actions - so the links sit dead centre. */
.nav-inner {
    max-width: 1200px;
    height: var(--nav-h);
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
}
.nav-logo { display: inline-flex; align-items: center; justify-self: start; }
.nav-logo img { height: 36px; width: auto; transition: opacity .2s ease; }
.nav-logo:hover img { opacity: .85; }
/* Plain links (no box inside the bar). The current section gets a short red underline drawn
   over the link, so marking it never changes the links' widths or shifts the row. */
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
    position: relative;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px;
    color: var(--text-dim); text-decoration: none; font-size: 14px; font-weight: 500;
    transition: color .2s ease, background .2s ease;
}
.nav-links a:hover { color: var(--text-strong); background: var(--surface); }
.nav-links a.is-current { color: var(--text-strong); }
.nav-links a::after {
    content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 2px;
    background: var(--brand);
    transform: scaleX(0); transition: transform .25s ease;
}
.nav-links a.is-current::after { transform: scaleX(1); }
.nav-ext { font-size: 9px; opacity: .6; }
.nav-actions { display: flex; align-items: center; gap: 10px; justify-self: end; }
.icon-btn {
    width: 40px; height: 40px;
    display: inline-flex; align-items: center; justify-content: center;
    background: none; border: 1px solid var(--line-2); color: var(--text-strong);
    font-size: 15px; cursor: pointer;
    transition: background .2s ease, border-color .2s ease;
}
.icon-btn:hover { background: var(--surface); }
.nav-cta {
    display: inline-flex; align-items: center; height: 40px;
    padding: 0 18px;
    background: var(--btn-bg); color: var(--btn-text);
    text-decoration: none; font-size: 14px; font-weight: 600;
    transition: background .2s ease;
}
.nav-cta:hover { background: var(--btn-hover); }
.nav-toggle { display: none; }
.nav-drawer {
    display: flex; flex-direction: column;
    padding: 8px 20px 20px;
    background: var(--nav-bg);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}
.nav-drawer[hidden] { display: none; }
.nav-drawer a { padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 500; color: var(--text); text-decoration: none; }
.nav-drawer a:last-child { border-bottom: 0; }
.nav-drawer i { font-size: 11px; color: var(--text-faint); margin-left: 4px; }

/* Theme toggle shows the theme you'd switch TO. */
.theme-icon-light { display: none; }
:root[data-theme="light"] .theme-icon-light { display: inline; }
:root[data-theme="light"] .theme-icon-dark { display: none; }

@media (max-width: 900px) {
    .nav-inner { grid-template-columns: 1fr auto; }
    .nav-links, .nav-cta { display: none; }
    .nav-toggle { display: inline-flex; }
    .nav-logo img { height: 30px; }
}
@media (min-width: 901px) {
    .nav-drawer { display: none !important; }
}

/* ── Hero ────────────────────────────────────────────────────────────── */

.hero {
    position: relative;
    min-height: calc(100vh - var(--banner-h, 0px));
    min-height: calc(100svh - var(--banner-h, 0px));
    display: flex; align-items: center; justify-content: center;
    padding: calc(var(--nav-h) + 24px) 20px 120px;
    overflow: hidden;
    isolation: isolate;
}
.hero-grid {
    position: absolute; inset: 0; z-index: -2;
    background-image:
        linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
    background-size: 64px 64px;
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 30%, transparent 75%);
    mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 30%, transparent 75%);
}
.hero-glow {
    position: absolute; z-index: -1;
    left: 50%; top: 38%;
    width: min(900px, 120vw); aspect-ratio: 1;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, var(--hero-glow) 0%, transparent 60%);
    animation: glow 9s ease-in-out infinite alternate;
    pointer-events: none;
}
@keyframes glow {
    from { opacity: .7; transform: translate(-50%, -50%) scale(.92); }
    to   { opacity: 1;  transform: translate(-50%, -50%) scale(1.06); }
}
.hero-canvas { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hero-content { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; text-align: center; }
.hero-mark {
    width: clamp(150px, 26vw, 240px); aspect-ratio: 1;
    margin-bottom: 28px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.hero-mark img {
    width: 100%; height: 100%;
    animation: rise .9s cubic-bezier(.2, .7, .2, 1) both;
}
/* logo-particles.js takes over drawing once it's ready; the <img> stays as the fallback. */
.hero-mark.is-particles img { visibility: hidden; }
.hero-eyebrow {
    display: inline-flex; align-items: center; gap: 12px;
    margin-bottom: 18px;
    font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .22em;
    color: var(--text-dim);
    animation: rise .9s .05s cubic-bezier(.2, .7, .2, 1) both;
}
.hero-eyebrow .sep { color: var(--brand); }
.hero-title { margin: 0; line-height: 0; }
/* The stacked STUX / .GROUP wordmark (the logo without its icon), revealed left to right once the particle logo lands. */
.hero-wordmark {
    width: clamp(220px, 46vw, 460px); height: auto;
    animation: wordmark-in 1.1s .55s cubic-bezier(.65, 0, .35, 1) both;
}
@keyframes wordmark-in {
    from { clip-path: inset(0 100% 0 0); opacity: .2; transform: translateX(-12px); }
    to   { clip-path: inset(0 0 0 0);   opacity: 1;  transform: none; }
}
.hero-sub {
    margin: 26px 0 0;
    max-width: 42rem;
    font-size: clamp(1.15rem, 2.4vw, 1.5rem);
    line-height: 1.45;
    color: var(--text);
}
.hero-sub .word {
    display: inline-block;
    animation: rise .8s cubic-bezier(.2, .7, .2, 1) both;
    animation-delay: calc(1.1s + var(--i) * .09s);
}
@keyframes rise {
    from { opacity: 0; transform: translateY(18px); filter: blur(6px); }
    to   { opacity: 1; transform: none; filter: none; }
}
.hero-scroll {
    position: absolute; bottom: 48px; left: 50%; z-index: 1;
    transform: translateX(-50%);
    color: var(--text-dim); font-size: 26px; text-decoration: none;
    animation: bob 2.4s ease-in-out infinite;
    transition: color .2s ease;
}
.hero-scroll:hover { color: var(--text-strong); }
@keyframes bob {
    0%, 100% { transform: translate(-50%, 0); }
    50%      { transform: translate(-50%, 8px); }
}

/* Brand logos: brands with a separate dark-background variant render both images, and
   only the one for the current theme shows. */
.logo-for-dark { display: none !important; }
:root[data-theme="dark"] .logo-for-light { display: none !important; }
:root[data-theme="dark"] .logo-for-dark { display: block !important; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .logo-for-light { display: none !important; }
    :root:not([data-theme]) .logo-for-dark { display: block !important; }
}

/* Muted logos (marquee, brand tabs): every unselected logo becomes the same flat silhouette
   (dark grey on light mode, light grey on dark), so none looks lighter or darker than another -
   greying the real colours kept each logo's own lightness (lilac pale, Stuxedo near-black).
   Hover/selected switch to full colour. Every state uses the same three filter functions so
   the change animates instead of snapping. */
.marquee-logo, .brand-tab-logo {
    filter: grayscale(1) brightness(0) invert(0); opacity: .5;
    transition: filter .3s ease, opacity .3s ease;
}
:root[data-theme="dark"] :is(.marquee-logo, .brand-tab-logo) { filter: grayscale(1) brightness(0) invert(1); opacity: .5; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) :is(.marquee-logo, .brand-tab-logo) { filter: grayscale(1) brightness(0) invert(1); opacity: .5; }
}

/* Stand-in for a brand logo that isn't uploaded yet (stuxImgFallback in index.php): the brand
   name as text in its colour. It keeps the logo's classes, so the muting above applies too. */
.logo-text {
    display: inline-flex; align-items: center; white-space: nowrap;
    font-family: var(--font-display); font-weight: 700; letter-spacing: -.02em; line-height: 1;
    color: var(--brand-dark);
}
:root[data-theme="light"] .logo-text { color: var(--brand-light); }
@media (prefers-color-scheme: light) {
    :root:not([data-theme]) .logo-text { color: var(--brand-light); }
}
.marquee-logo.logo-text, .brand-tab-logo.logo-text { font-size: 20px; }
.brand-card-logo.logo-text { font-size: 40px; }

/* Logos with a one-colour muted version (Stuxedo): show it while muted, the real logo while
   selected/hovered. */
.logo-mono { display: none; }
.brand-tab:not(.is-active) .logo-full,
.marquee-item:not(:hover):not(:focus-visible) .logo-full { display: none; }
.brand-tab:not(.is-active) .logo-mono,
.marquee-item:not(:hover):not(:focus-visible) .logo-mono { display: block; }

/* ── Brand marquee ───────────────────────────────────────────────────── */

.marquee {
    position: relative;
    overflow: hidden;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: var(--bg);
}
/* The logos fade out at both ends into the strip's own (solid) background - overlays rather
   than a mask, so the background stays solid and the fade doesn't move with the logos. */
.marquee::before, .marquee::after {
    content: ""; position: absolute; top: 0; bottom: 0; width: 8%; z-index: 1; pointer-events: none;
}
.marquee::before { left: 0; background: linear-gradient(to right, var(--bg), transparent); }
.marquee::after { right: 0; background: linear-gradient(to left, var(--bg), transparent); }
.marquee-track {
    display: flex; align-items: center; gap: 36px;
    width: max-content;
    padding: 22px 0;
    animation: marquee 50s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
.marquee-item { display: inline-flex; align-items: center; text-decoration: none; }
/* Logo sizes divide by each logo's --logo-fill (how much of its image the mark fills), so every
   brand's visible logo is the same height regardless of the padding in its file. */
.marquee-logo { height: calc(28px / var(--logo-fill, 1)); width: auto; max-width: none; }
.marquee-item:hover .marquee-logo, .marquee-item:focus-visible .marquee-logo { filter: grayscale(0) brightness(1) invert(0); opacity: 1; }
.marquee-sep { color: var(--line-2); font: 400 19px var(--font-mono); }

/* ── Sections ────────────────────────────────────────────────────────── */

/* Every section sits on the red-tinted page colour, in a full-width band with a thin divider
   on top; the content inside (cards, panels, the form) uses the neutral card surface below. */
.band { position: relative; background: var(--bg); border-top: 1px solid var(--line); }
.section {
    max-width: 1152px;
    margin: 0 auto;
    padding: 96px 20px;
}
.section-head { text-align: center; margin-bottom: 48px; }
.section-index {
    display: inline-flex; align-items: center; gap: 10px;
    margin-bottom: 18px;
    font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .2em;
    color: var(--text-dim);
}
.section-index span { color: var(--brand); }
.section-index::before, .section-index::after { content: ""; width: 28px; height: 1px; background: var(--line-2); }
.display {
    margin: 0 0 20px;
    font-family: var(--font-display); font-weight: 700;
    font-size: clamp(1.9rem, 5vw, 3rem);
    line-height: 1.15; letter-spacing: -.02em;
    color: var(--text-strong);
}
.display .block { display: block; }
.display .muted { color: var(--text-dim); }
.title {
    margin: 0 0 10px;
    font-family: var(--font-display); font-weight: 700;
    font-size: clamp(1.9rem, 4vw, 2.4rem);
    letter-spacing: -.02em;
    color: var(--text-strong);
}
.lead {
    max-width: 48rem; margin: 0 auto;
    font-size: clamp(1rem, 1.6vw, 1.125rem); line-height: 1.75;
    color: var(--text-muted);
}
.sub { margin: 0; color: var(--text-dim); font-size: clamp(1rem, 1.6vw, 1.125rem); }

/* Stats strip */
.stats {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 1px; background: var(--line);
    border: 1px solid var(--line);
    max-width: 960px; margin: 0 auto;
}
.stat { background: var(--bg); padding: 28px 20px; text-align: center; }
.stat-num {
    font-family: var(--font-display); font-weight: 700; font-size: clamp(1.8rem, 4vw, 2.4rem);
    color: var(--text-strong); letter-spacing: -.02em; line-height: 1.1;
}
.stat-label {
    margin-top: 6px;
    font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .14em;
    color: var(--text-dim);
}
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* Shared bits */
.mono-sm { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); margin-top: 2px; }
.mono-xs { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .16em; color: var(--text-faint); }
.eyebrow { font-family: var(--font-mono); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .18em; color: var(--text-dim); margin-bottom: 14px; }
.rule { height: 1px; background: var(--line); }
.body-text { margin: 0; color: var(--text-muted); line-height: 1.75; }

/* Square bullets; inside a brand card they take that brand's colour (--brand-c). */
.bullets { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bullets li {
    position: relative; padding-left: 20px;
    font-size: 14px; line-height: 1.6; color: var(--text-muted);
    transition: color .3s ease;
}
.bullets li::before {
    content: ""; position: absolute; left: 0; top: .6em;
    width: 6px; height: 6px; background: var(--brand-c, var(--line-2));
    transition: box-shadow .3s ease;
}
.bullets-hover li:hover { color: var(--text-strong); }
.bullets-hover li:hover::before { box-shadow: 0 0 10px var(--brand-c, transparent); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    padding: 11px 22px;
    font: 600 14px/1.2 var(--font-body);
    text-decoration: none; cursor: pointer;
    border: 1px solid transparent;
    transition: background .2s ease, color .2s ease;
}
.btn i { font-size: 12px; }
.btn-primary { background: var(--btn-bg); color: var(--btn-text); }
.btn-primary:hover { background: var(--btn-hover); }
.btn-block { width: 100%; padding: 14px 22px; font-size: 15px; }

.pill {
    display: inline-flex; align-items: center; gap: 9px;
    padding: 10px 16px;
    border: 1px solid var(--line);
    font-size: 14px; font-weight: 500; color: var(--text-muted);
}
.pulse {
    width: 8px; height: 8px;
    background: var(--brand-c, var(--ok));
    box-shadow: 0 0 10px var(--brand-c, var(--ok));
    animation: pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;
}
@keyframes pulse { 50% { opacity: .4; } }

.icon-box {
    width: 48px; height: 48px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface); border: 1px solid var(--line-2);
    color: var(--text); font-size: 20px;
}
.icon-box img { width: 30px; height: 30px; object-fit: contain; }
.icon-box-lg { width: 64px; height: 64px; font-size: 26px; }
.icon-box-lg img { width: 40px; height: 40px; }

/* Mouse-follow spotlight (app.js sets --mx/--my) */
.spotlight { position: relative; }
.spotlight::after {
    content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background: radial-gradient(520px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--text-strong) 5%, transparent), transparent 45%);
    opacity: 0; transition: opacity .5s ease;
}
.spotlight:hover::after { opacity: 1; }
.spotlight > * { position: relative; z-index: 1; }

/* ── Brands ──────────────────────────────────────────────────────────── */

/* Per-brand accent from brand_style(): dark-theme value by default, light-theme value on light. */
.brand-tab, .brand-card { --brand: var(--brand-dark); }
:root[data-theme="light"] .brand-tab, :root[data-theme="light"] .brand-card { --brand: var(--brand-light); }
@media (prefers-color-scheme: light) {
    :root:not([data-theme]) .brand-tab, :root:not([data-theme]) .brand-card { --brand: var(--brand-light); }
}

.brand-tabs-wrap { position: relative; max-width: 1112px; margin: 0 auto 56px; }
.brand-tabs {
    display: flex;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    scrollbar-width: none;
}
.brand-tabs::-webkit-scrollbar { display: none; }
.brand-tab {
    position: relative;
    flex: 1 0 auto;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 20px 14px;
    background: none; border: 0; cursor: pointer;
}
.brand-tab-logo { height: calc(28px / var(--logo-fill, 1)); width: auto; max-width: none; }
.brand-tab:hover .brand-tab-logo { opacity: .75; }
.brand-tab.is-active .brand-tab-logo { filter: grayscale(0) brightness(1) invert(0); opacity: 1; }
.brand-tab::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
    background: var(--brand);
    box-shadow: 0 0 14px var(--brand);
    transform: scaleX(0); opacity: 0;
    transition: transform .3s ease, opacity .3s ease;
}
.brand-tab.is-active::after { transform: scaleX(1); opacity: 1; }
/* Narrower than the single row needs (all eight brands take the full 1112px), a scrolling strip
   would hide brands off-screen, so show them all as a grid of tiles instead: four per row (two
   even rows of four), two per row on phones. The selected brand gets its colour as border + underline. */
@media (max-width: 1151px) {
    .brand-tabs-wrap { margin-bottom: 40px; }
    .brand-tabs {
        display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
        overflow: visible; border-bottom: 0;
    }
    .brand-tab {
        padding: 16px 12px;
        border: 1px solid var(--line);
        background: var(--bg-card);
        min-height: 64px;
    }
    .brand-tab-logo { height: calc(22px / var(--logo-fill, 1)); max-width: 100%; }
    .brand-tab-logo.logo-text { font-size: 17px; }
    .brand-tab.is-active { border-color: var(--brand); }
    .brand-tab::after { bottom: -1px; height: 3px; }
}
@media (max-width: 540px) {
    .brand-tabs-wrap { margin-bottom: 32px; }
    .brand-tabs { grid-template-columns: repeat(2, 1fr); }
    .brand-tab { padding: 14px 10px; min-height: 56px; }
    .brand-tab-logo { height: calc(18px / var(--logo-fill, 1)); }
    .brand-tab-logo.logo-text { font-size: 15px; }
}

.brand-panels { max-width: 1152px; margin: 0 auto; }
.brand-card {
    display: grid; grid-template-columns: 1fr 1fr;
    border: 1px solid var(--line);
    background: var(--bg);
    --brand-c: var(--brand);
}
.js .brand-card { display: none; }
.js .brand-card.is-active { display: grid; animation: slide-in .4s ease both; }
html:not(.js) .brand-card + .brand-card { margin-top: 24px; }
@keyframes slide-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.brand-card-body { padding: 40px; display: flex; flex-direction: column; gap: 24px; }
.brand-card-head { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.brand-card-head h3 { margin: 0; line-height: 0; }
.brand-card-logo { height: calc(52px / var(--logo-fill, 1)); width: auto; max-width: 100%; object-fit: contain; }
.featured h3 {
    margin: 0;
    font-family: var(--font-display); font-weight: 700; font-size: clamp(1.5rem, 3vw, 1.9rem);
    letter-spacing: -.02em; color: var(--text-strong); line-height: 1.2;
}
.brand-card-actions { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 6px; }

.brand-card-visual {
    position: relative; overflow: hidden;
    min-height: 380px;
    border-left: 1px solid var(--line);
    background: var(--bg-deep);
    display: flex; align-items: center; justify-content: center;
}
.brand-visual-glow {
    position: absolute; inset: -20%;
    background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--brand) 30%, transparent), transparent 55%);
    filter: blur(20px);
    opacity: .75;
    transition: opacity .6s ease, transform .6s ease;
}
.brand-card:hover .brand-visual-glow { opacity: 1; transform: scale(1.08); }
.brand-visual-grid {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(to right, var(--grid-line-visual) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-line-visual) 1px, transparent 1px);
    background-size: 32px 32px;
    -webkit-mask-image: radial-gradient(circle at 50% 50%, #000, transparent 70%);
    mask-image: radial-gradient(circle at 50% 50%, #000, transparent 70%);
}
.brand-visual-canvas { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.brand-visual-slot {
    position: relative; z-index: 2;
    width: 46%; max-width: 220px; aspect-ratio: 1;
    cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.brand-visual-slot img { width: 100%; height: 100%; object-fit: contain; }
/* Stand-in for a brand icon that isn't uploaded yet (stuxImgFallback in index.php). */
.brand-visual-slot .img-fallback-icon {
    display: grid; place-items: center; width: 100%; height: 100%;
    font-size: clamp(72px, 9vw, 120px); color: var(--brand);
    filter: drop-shadow(0 0 24px color-mix(in srgb, var(--brand) 45%, transparent));
}
/* logo-particles.js draws the icon once ready; the <img> stays as the fallback. */
.brand-visual-slot.is-particles img { visibility: hidden; }
.brand-visual-url {
    position: absolute; left: 16px; bottom: 14px; z-index: 2;
    font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); letter-spacing: .04em;
}

@media (max-width: 960px) {
    .brand-card, .js .brand-card.is-active { grid-template-columns: 1fr; }
    .brand-card-visual { min-height: 260px; border-left: 0; border-bottom: 1px solid var(--line); order: -1; }
    .brand-card-body { padding: 28px 22px; }
}

/* ── Software ────────────────────────────────────────────────────────── */

/* Cards (About's stats, the software grid, the contact form) stand off their section on
   neutral surfaces with a soft shadow: white in light mode, and in dark mode a grey one step
   lighter than the neutral sections, so they lift off both the red and the neutral bands. The
   red tint stays in the section backgrounds. Inside a card, --bg is the card itself and
   --bg-deep a recessed shade (panels, input fields). */
.card-surface, .software, .stats, .brand-card, .legal-grid, .prose {
    --bg: #1d1d1d;
    --bg-deep: #141414;
    --surface: #2a2a2a;
    --line: #2e2e2e;
    --line-2: #444444;
    box-shadow: var(--shadow);
}
:root[data-theme="light"] :is(.card-surface, .software, .stats, .brand-card, .legal-grid, .prose) {
    --bg: #ffffff;
    --bg-deep: #f6f6f6;
    --surface: #f0f0f0;
    --line: #ececec;
    --line-2: #d0d0d0;
}
@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) :is(.card-surface, .software, .stats, .brand-card, .legal-grid, .prose) {
        --bg: #ffffff;
        --bg-deep: #f6f6f6;
        --surface: #f0f0f0;
        --line: #ececec;
        --line-2: #d0d0d0;
    }
}
.software {
    max-width: 1152px; margin: 0 auto;
    display: flex; flex-direction: column; gap: 1px;
    background: var(--line); border: 1px solid var(--line);
}
.featured { display: grid; grid-template-columns: 3fr 2fr; background: var(--bg); }
.featured-main { padding: 40px; display: flex; flex-direction: column; gap: 20px; }
.featured-head { display: flex; align-items: center; gap: 20px; }
.featured-side {
    padding: 32px;
    background: var(--bg-deep);
    border-left: 1px solid var(--line);
    display: flex; flex-direction: column; justify-content: center;
}
.featured-foot { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); }
.featured-foot span { color: var(--text-muted); }

.software-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); }
.soft-card, .legal-card {
    position: relative; overflow: hidden; isolation: isolate;
    background: var(--bg); text-decoration: none;
}
.soft-card { display: block; padding: 32px; }
.soft-card::before, .legal-card::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(to bottom right, var(--surface), transparent);
    opacity: 0; transition: opacity .5s ease;
}
.soft-card:hover::before, .soft-card:focus-visible::before,
.legal-card:hover::before, .legal-card:focus-visible::before { opacity: 1; }
.soft-card-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.soft-card h3 {
    margin: 0;
    font-family: var(--font-display); font-weight: 700; font-size: 18px;
    color: var(--text); transition: color .3s ease;
}
.soft-card:hover h3 { color: var(--text-strong); }
.soft-card .mono-sm { font-size: 11px; }
.soft-card-arrow {
    margin-left: auto; align-self: flex-start;
    color: var(--text-faint); font-size: 14px;
    transform: translateX(-6px); opacity: 0;
    transition: transform .3s ease, opacity .3s ease, color .3s ease;
}
.soft-card:hover .soft-card-arrow { transform: none; opacity: 1; color: var(--brand); }
.soft-card p { margin: 0; font-size: 14px; line-height: 1.7; color: var(--text-dim); transition: color .3s ease; }
.soft-card:hover p { color: var(--text-muted); }

@media (max-width: 960px) {
    .featured { grid-template-columns: 1fr; }
    .featured-side { border-left: 0; border-top: 1px solid var(--line); }
    .featured-main, .featured-side { padding: 28px 22px; }
    .software-grid { grid-template-columns: 1fr; }
    .soft-card { padding: 26px 22px; }
}

/* ── Contact ─────────────────────────────────────────────────────────── */

.contact { background: var(--bg); padding: 80px 20px; border-top: 1px solid var(--line); }
.contact-inner { max-width: 672px; margin: 0 auto; }
.contact .section-head { margin-bottom: 40px; }
.contact-form { display: grid; gap: 22px; }
.contact-form.card-surface { background: var(--bg); border: 1px solid var(--line); padding: 36px; }
@media (max-width: 600px) { .contact-form.card-surface { padding: 22px; } }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.field label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500; color: var(--text); }
.req { color: var(--err); }
.field input, .field textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-deep); color: var(--text-strong);   /* recessed into the form card */
    border: 1px solid var(--line-2); border-radius: 0;
    font: 15px/1.5 var(--font-body);
    transition: border-color .2s ease, box-shadow .2s ease;
}
.field textarea { resize: vertical; min-height: 150px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--text-strong); box-shadow: 0 0 0 1px var(--text-strong); }
.field [aria-invalid="true"] { border-color: var(--err); }
.field-error { margin: 6px 0 0; font-size: 13px; color: var(--err); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-note { margin: 0; font-size: 12px; color: var(--text-dim); text-align: center; }
.form-note a { color: var(--text-muted); }

.notice { display: flex; gap: 10px; align-items: baseline; padding: 14px 18px; margin-bottom: 24px; font-size: 14px; border: 1px solid; color: var(--text-strong); }
.notice-ok { border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: color-mix(in srgb, var(--ok) 9%, transparent); }
.notice-ok i { color: var(--ok); }
.notice-err { border-color: color-mix(in srgb, var(--err) 45%, transparent); background: color-mix(in srgb, var(--err) 9%, transparent); }
.notice-err i { color: var(--err); }
.notice a { color: inherit; }

.contact-direct { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--line); text-align: center; }
.contact-direct p { margin: 0 0 6px; color: var(--text-muted); }
.contact-direct > a { color: var(--text-strong); font-weight: 500; font-size: 17px; text-decoration: none; }
.contact-direct > a:hover { text-decoration: underline; }
.contact-direct .contact-legal { margin-top: 14px; font-size: 13px; color: var(--text-dim); }
.contact-legal a { color: var(--text-muted); }

/* ── Footer ──────────────────────────────────────────────────────────── */

.footer { border-top: 1px solid var(--line); background: var(--bg); }
.footer-inner { max-width: 1152px; margin: 0 auto; padding: 56px 20px 0; }
.footer-top { display: flex; justify-content: space-between; gap: 48px; flex-wrap: wrap; }
.footer-logo { display: inline-block; }
.footer-brand img { height: 44px; width: auto; }
.footer-brand p { margin: 14px 0 0; color: var(--text-dim); font-size: 14px; }
.footer-cols { display: flex; gap: 64px; flex-wrap: wrap; }
.footer-cols > div { display: flex; flex-direction: column; gap: 10px; min-width: 120px; }
.footer-heading { font-family: var(--font-mono); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .18em; color: var(--text-faint); margin-bottom: 4px; }
.footer-cols a { color: var(--text-muted); font-size: 14px; text-decoration: none; transition: color .2s ease; }
.footer-cols a:hover { color: var(--text-strong); }
.footer-bottom {
    margin-top: 48px; padding: 24px 0;
    border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
    display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap;
}
.footer-legal { margin: 0; font-size: 12.5px; line-height: 1.7; color: var(--text-faint); }
.footer-legal a { color: var(--text-muted); text-decoration: none; transition: color .2s ease; }
.footer-legal a:hover, .footer-legal a:focus-visible { color: var(--text-strong); }
.footer-socials { display: flex; gap: 8px; }
/* Social buttons: neutral like the cards (not the red-tinted page lines). */
.footer-socials {
    --social-bg: #1d1d1d; --social-line: #2e2e2e; --social-line-hover: #4a4a4a;
}
:root[data-theme="light"] .footer-socials { --social-bg: #ffffff; --social-line: #e2e2e2; --social-line-hover: #c4c4c4; }
@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) .footer-socials { --social-bg: #ffffff; --social-line: #e2e2e2; --social-line-hover: #c4c4c4; }
}
.footer-socials a {
    width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--social-bg);
    border: 1px solid var(--social-line); color: var(--text-dim); text-decoration: none;
    transition: color .2s ease, border-color .2s ease;
}
.footer-socials a:hover { color: var(--text-strong); border-color: var(--social-line-hover); }
@media (max-width: 600px) { .footer-cols { gap: 36px; } }

/* Footer logos and badges: muted until hovered or focused. The same filter functions are
   used in every state, so the hover animates without the image snapping. */
.footer-logo img, .footer-badge {
    filter: grayscale(1) brightness(1); opacity: .55;
    transition: filter .25s ease, opacity .25s ease;
}
/* Dark mode: a greyed-out red logo turns dark grey and vanishes on the dark footer, so the
   muted Stux.Group logo is lifted (the neon badge is already light). */
:root[data-theme="dark"] .footer-logo img { filter: grayscale(1) brightness(2.2); }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .footer-logo img { filter: grayscale(1) brightness(2.2); }
}
/* Hover/focus restores full colour. The leading :root gives these the same specificity as the
   dark-mode lift above, and coming later they win - otherwise dark mode stayed grey on hover. */
:root .footer-logo:hover img, :root .footer-logo:focus-visible img,
:root .footer-badge-link:hover .footer-badge, :root .footer-badge-link:focus-visible .footer-badge {
    filter: grayscale(0) brightness(1); opacity: 1;
}

/* "Created with love / code / coffee by Stux.Group | Powered by Stuxedo" */
.footer-created {
    padding: 24px 20px 32px;
    display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 12px;
    text-align: center; font-size: 13px; color: var(--text-dim);
}
.footer-created-sep { color: var(--line-2); }
.footer-badge-link { display: inline-flex; align-items: center; }
.footer-badge { height: 24px; width: auto; display: block; }
.footer-created a { color: var(--text-dim); text-decoration: none; transition: color .2s ease; }
.footer-created a:hover, .footer-created a:focus-visible { color: var(--text-strong); }
.footer-created-love { color: #e5484d; font-size: .85em; }
.footer-created-code { color: #30a46c; }
.footer-created-coffee { color: #a0703f; font-size: .95em; }

/* ── Inner pages (legal, 404) ───────────────────────────────────────── */

.page {
    max-width: 820px; margin: 0 auto;
    padding: calc(var(--nav-h) + 64px) 20px 96px;
}
.page-wide { max-width: 1040px; }
.page-head { margin-bottom: 40px; }
.page-eyebrow { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .16em; color: var(--text-dim); margin-bottom: 12px; }
.page-eyebrow a { color: var(--text-dim); text-decoration: none; }
.page-eyebrow a:hover { color: var(--text-strong); }
.page h1 {
    margin: 0 0 14px;
    font-family: var(--font-display); font-weight: 700; font-size: clamp(2.1rem, 5vw, 3rem);
    letter-spacing: -.02em; line-height: 1.1; color: var(--text-strong);
}
.page-lead { margin: 0; font-size: 1.125rem; color: var(--text-muted); }
.page-meta { margin-top: 14px; font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); }

.prose {
    color: var(--text-muted); line-height: 1.8;
    background: var(--bg); border: 1px solid var(--line); padding: 44px 48px;
}
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
@media (max-width: 600px) { .prose { padding: 26px 22px; } }
.prose h2 {
    margin: 44px 0 12px;
    font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; color: var(--text-strong); letter-spacing: -.01em;
}
.prose p, .prose ul, .prose ol { margin: 0 0 16px; }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--text-strong); text-underline-offset: 3px; }
.prose strong { color: var(--text); }

.info-table { border: 1px solid var(--line); margin: 20px 0 24px; }
.info-row { display: grid; grid-template-columns: 200px 1fr; gap: 20px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.info-row:last-child { border-bottom: 0; }
.info-label { color: var(--text); font-weight: 600; font-size: 14px; }
.info-value { font-size: 14px; }
@media (max-width: 600px) { .info-row { grid-template-columns: 1fr; gap: 4px; } }

.legal-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.legal-card { display: flex; gap: 18px; align-items: flex-start; padding: 28px; }
.legal-card-name { font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--text-strong); margin-bottom: 4px; }
.legal-card-desc { font-size: 14px; color: var(--text-dim); line-height: 1.6; }
.legal-card .icon-box { font-size: 18px; transition: color .3s ease; }
.legal-card:hover .icon-box { color: var(--brand); }
@media (max-width: 720px) { .legal-grid { grid-template-columns: 1fr; } }
.legal-contact { margin-top: 28px; font-size: 14px; color: var(--text-dim); }
.legal-contact a { color: var(--text-muted); }

.notfound { text-align: center; padding-top: calc(var(--nav-h) + 120px); }
.notfound-code { font-family: var(--font-display); font-weight: 900; font-size: clamp(5rem, 18vw, 9rem); line-height: 1; color: var(--line-2); }
.notfound-code span { color: var(--brand); }
.notfound .btn { margin-top: 28px; }

/* ── Scroll reveal (app.js adds .is-visible) ───────────────────────── */

.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
    .js .reveal { opacity: 1; transform: none; }
    .marquee-track { animation: none; }
}
