/* =========================================================
   TRIGON Business Intelligence – main.css
   ========================================================= */

/* ---------- Fonts (self-hosted, no external requests) ---------- */
@font-face {
    font-family: "HK Grotesk";
    src: url("../fonts/hkgrotesk-regular-webfont.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "HK Grotesk";
    src: url("../fonts/hkgrotesk-semibold-webfont.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

/* ---------- Design tokens ---------- */
:root {
    --brand: #F31C55;          /* logo coral – decorative use */
    --brand-strong: #E0144C;   /* buttons / text on light (AA) */
    --brand-soft: rgba(243, 28, 85, .12);

    --ink-900: #0B1020;        /* dark sections */
    --ink-800: #121A2E;
    --ink-700: #1C2640;
    --ink-line: rgba(255, 255, 255, .10);

    --text: #161B26;
    --text-muted: #5A6273;
    --text-on-dark: #E8ECF4;
    --text-on-dark-muted: #A3ADC2;

    --bg: #FFFFFF;
    --bg-alt: #F5F6F9;
    --line: #E3E6EC;

    --radius: 14px;
    --radius-lg: 22px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
    --shadow-hover: 0 2px 4px rgba(16, 24, 40, .06), 0 16px 40px rgba(16, 24, 40, .10);

    --container: 1200px;
    --gutter: clamp(16px, 4vw, 32px);
    --section-y: clamp(72px, 10vw, 128px);

    --font: "HK Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .5em; font-weight: 600; letter-spacing: -.015em; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; }

svg.i {
    fill: none; stroke: currentColor; stroke-width: 1.8;
    stroke-linecap: round; stroke-linejoin: round;
}

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

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-y); }
.section--alt { background: var(--bg-alt); }
.section--dark { background: var(--ink-900); color: var(--text-on-dark); }

.skip-link {
    position: absolute; left: 16px; top: -100px; z-index: 1000;
    background: var(--brand-strong); color: #fff; padding: 10px 16px; border-radius: 8px;
}
.skip-link:focus { top: 16px; }

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

/* ---------- Section headings ---------- */
.eyebrow {
    display: inline-flex; align-items: center; gap: 10px;
    font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
    color: var(--brand-strong); margin-bottom: 16px;
}
.eyebrow::before {
    content: ""; width: 10px; height: 10px; background: var(--brand);
    clip-path: polygon(0 0, 100% 0, 100% 100%); border-radius: 2px;
}
.section--dark .eyebrow { color: #FF6A8F; }
.section-head { max-width: 760px; margin-bottom: clamp(40px, 6vw, 64px); }
.section-head h2 { font-size: clamp(30px, 4vw, 46px); }
.section-head p { font-size: 19px; color: var(--text-muted); margin: 0; }
.section--dark .section-head p { color: var(--text-on-dark-muted); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 14px 24px; border-radius: 999px;
    font: 600 16px/1 var(--font); text-decoration: none !important;
    border: 1px solid transparent; cursor: pointer;
    transition: background .2s, border-color .2s, transform .2s var(--ease), box-shadow .2s;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn--primary { background: var(--brand-strong); color: #fff; box-shadow: 0 8px 24px rgba(224, 20, 76, .30); }
.btn--primary:hover { background: #C80F42; transform: translateY(-1px); }
.btn--ghost { color: #fff; border-color: rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .04); }
.btn--ghost:hover { border-color: rgba(255, 255, 255, .6); background: rgba(255, 255, 255, .08); }
.btn--sm { padding: 10px 18px; font-size: 15px; }

/* ---------- Header / Navigation ---------- */
.site-header {
    position: fixed; inset: 0 0 auto 0; z-index: 100;
    transition: background .3s, box-shadow .3s, backdrop-filter .3s;
}
.site-header.is-scrolled, .site-header.is-solid {
    background: rgba(11, 16, 32, .82);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    box-shadow: 0 1px 0 var(--ink-line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 92px; gap: 24px; }
.nav__logo img { height: 50px; width: auto; }
@media (max-width: 900px) { .nav__logo img { height: 42px; } }
.nav__menu { display: flex; align-items: center; gap: 4px; list-style: none; }
.nav__menu a:not(.btn) {
    display: block; padding: 8px 14px; border-radius: 8px;
    color: var(--text-on-dark-muted); font-size: 15px; font-weight: 600; text-decoration: none;
    transition: color .2s, background .2s;
}
.nav__menu a:not(.btn):hover, .nav__menu a.is-active { color: #fff; background: rgba(255, 255, 255, .06); }
.nav__menu .btn { margin-left: 12px; }
.nav__toggle {
    display: none; background: none; border: 0; padding: 8px; cursor: pointer; color: #fff;
}
.nav__toggle svg { width: 28px; height: 28px; }

@media (max-width: 900px) {
    .nav__toggle { display: block; }
    .nav__menu {
        position: fixed; inset: 92px 0 auto 0; flex-direction: column; align-items: stretch; gap: 0;
        padding: 12px var(--gutter) 24px; background: var(--ink-900);
        border-top: 1px solid var(--ink-line);
        transform: translateY(-8px); opacity: 0; visibility: hidden;
        transition: opacity .2s, transform .2s var(--ease), visibility .2s;
    }
    .nav__menu.is-open { opacity: 1; transform: none; visibility: visible; }
    .nav__menu a:not(.btn) { padding: 14px 4px; font-size: 18px; border-bottom: 1px solid var(--ink-line); border-radius: 0; }
    .nav__menu .btn { margin: 20px 0 0; justify-content: center; }
}

/* ---------- Hero ---------- */
.hero {
    position: relative; overflow: hidden; isolation: isolate;
    background:
        radial-gradient(900px 600px at 85% 20%, rgba(243, 28, 85, .22), transparent 60%),
        radial-gradient(700px 500px at 10% 100%, rgba(64, 98, 255, .16), transparent 60%),
        var(--ink-900);
    color: var(--text-on-dark);
    padding: clamp(140px, 18vw, 200px) 0 clamp(80px, 10vw, 120px);
}
.hero__grid-bg {
    position: absolute; inset: 0; z-index: -2; opacity: .5;
    background-image:
        linear-gradient(var(--ink-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--ink-line) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse at 70% 40%, #000 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at 70% 40%, #000 20%, transparent 75%);
}
.hero__inner { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(36px, 5.6vw, 66px); line-height: 1.06; letter-spacing: -.025em; margin-bottom: 24px; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero__lead { font-size: clamp(18px, 1.6vw, 21px); color: var(--text-on-dark-muted); max-width: 600px; margin-bottom: 36px; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 14px; }
.hero__visual { position: relative; aspect-ratio: 1; max-width: 480px; justify-self: end; width: 100%; }
.hero__visual svg { width: 100%; height: 100%; overflow: visible; }

.hero__facts {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
    margin-top: clamp(56px, 8vw, 88px); border: 1px solid var(--ink-line); border-radius: var(--radius);
    background: var(--ink-line); overflow: hidden;
}
.hero__fact { background: rgba(11, 16, 32, .7); padding: 22px 24px; }
.hero__fact strong { display: block; font-size: clamp(22px, 2.4vw, 28px); color: #fff; line-height: 1.2; }
.hero__fact span { font-size: 15px; color: var(--text-on-dark-muted); }

/* animated network graphic */
.net-line { stroke: rgba(255, 255, 255, .18); stroke-width: 1; }
.net-line--accent { stroke: var(--brand); stroke-width: 1.5; stroke-dasharray: 6 8; animation: dash 6s linear infinite; }
.net-node { fill: var(--ink-700); stroke: rgba(255, 255, 255, .35); stroke-width: 1.5; }
.net-node--accent { fill: var(--brand); stroke: none; }
.net-pulse { fill: none; stroke: var(--brand); stroke-width: 1.5; transform-box: fill-box; transform-origin: center; animation: pulse 3s var(--ease) infinite; }
.net-tri { fill: url(#triGrad); }
.net-float { animation: float 9s ease-in-out infinite; }
@keyframes dash { to { stroke-dashoffset: -140; } }
@keyframes pulse { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(2.6); opacity: 0; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

@media (max-width: 900px) {
    .hero__inner { grid-template-columns: 1fr; }
    .hero__visual { display: none; }
    .hero__facts { grid-template-columns: 1fr; }
}

/* ---------- Logo marquee ---------- */
.logos { padding: 40px 0; border-bottom: 1px solid var(--line); background: #fff; }
.logos__label { text-align: center; font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }
.marquee { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee__track { display: flex; width: max-content; animation: marquee 60s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__track img {
    height: 34px; width: auto; max-width: 150px; object-fit: contain; margin-inline: 36px;
    filter: grayscale(1); opacity: .6; transition: filter .3s, opacity .3s;
}
.marquee__track img:hover { filter: none; opacity: 1; }
/* CWS banner logo: crop to the lettering block and boost contrast in grey state */
.marquee__track img.logo-cws {
    aspect-ratio: 296 / 84; object-fit: cover; object-position: 1.4% center; border-radius: 4px;
    filter: grayscale(1) brightness(3) contrast(1.6); opacity: .85;
}
.marquee__track img.logo-cws:hover { filter: none; opacity: 1; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Cards / Grids ---------- */
.grid { display: grid; gap: 24px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 640px) { .grid--2 { grid-template-columns: 1fr; } }
.card .card__role { font-size: 14px; font-weight: 600; color: var(--brand-strong); margin: -4px 0 12px; }
@media (max-width: 960px) { .grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid--3 { grid-template-columns: 1fr; } }

.card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 28px; box-shadow: var(--shadow);
    transition: transform .3s var(--ease), box-shadow .3s, border-color .3s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: #D5D9E1; }
.card h3 { font-size: 21px; margin-bottom: 10px; }
.card p { color: var(--text-muted); font-size: 16px; margin: 0; }
.icon {
    width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
    background: var(--brand-soft); color: var(--brand-strong); margin-bottom: 20px;
}
.icon svg { width: 24px; height: 24px; }

.group-title {
    display: flex; align-items: center; gap: 16px;
    font-size: 15px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
    color: var(--text-muted); margin: 0 0 20px;
}
.group-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.group + .group { margin-top: 56px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; list-style: none; }
.tags li { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--bg-alt); color: var(--text-muted); border: 1px solid var(--line); }

/* ---------- KI bento ---------- */
.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.bento .tile {
    background: var(--ink-800); border: 1px solid var(--ink-line); border-radius: var(--radius-lg);
    padding: 28px; transition: border-color .3s, transform .3s var(--ease), background .3s;
}
.bento .tile:hover { border-color: rgba(243, 28, 85, .45); transform: translateY(-3px); }
.bento .tile h3 { font-size: 21px; color: #fff; margin-bottom: 10px; }
.bento .tile p { color: var(--text-on-dark-muted); font-size: 16px; margin: 0; }
.bento .icon { background: rgba(243, 28, 85, .14); color: #FF6A8F; }
.tile--feature {
    grid-column: span 2; grid-row: span 2;
    display: flex; flex-direction: column;
    background:
        radial-gradient(600px 300px at 100% 0%, rgba(243, 28, 85, .20), transparent 60%),
        var(--ink-800) !important;
}
.tile--feature h3 { font-size: clamp(24px, 2.6vw, 32px) !important; }
.tile--feature p { font-size: 18px !important; max-width: 560px; }
.badge {
    display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
    color: #fff; background: var(--brand-strong); padding: 5px 10px; border-radius: 999px; margin-bottom: 18px; align-self: flex-start;
}
.flow { display: flex; align-items: center; gap: 12px; margin-top: auto; padding-top: 32px; flex-wrap: wrap; }
.flow__step {
    flex: 1 1 140px; border: 1px solid var(--ink-line); border-radius: 12px; padding: 14px 16px;
    background: rgba(255, 255, 255, .03); font-size: 14px; color: var(--text-on-dark-muted);
}
.flow__step strong { display: block; color: #fff; font-size: 15px; }
.flow__step--ai { border-color: rgba(243, 28, 85, .55); background: rgba(243, 28, 85, .08); }
.flow__arrow { color: var(--brand); flex: none; }
.flow__arrow svg { width: 20px; height: 20px; display: block; }
@media (max-width: 960px) {
    .bento { grid-template-columns: 1fr 1fr; }
    .tile--feature { grid-column: span 2; grid-row: auto; }
}
@media (max-width: 640px) {
    .bento { grid-template-columns: 1fr; }
    .tile--feature { grid-column: auto; }
    .flow__arrow { transform: rotate(90deg); margin-inline: auto; }
    .flow { flex-direction: column; align-items: stretch; }
    .flow__step { flex: none; }
}

/* ---------- About / Team ---------- */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.about__text p { font-size: 18px; color: var(--text-muted); }
.about__text p strong { color: var(--text); }
.team-title { margin-top: clamp(48px, 7vw, 72px); }
@media (max-width: 960px) { .about { grid-template-columns: 1fr; } }

/* ---------- References ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.chip {
    font: 600 14px/1 var(--font); padding: 10px 16px; border-radius: 999px; cursor: pointer;
    border: 1px solid var(--line); background: #fff; color: var(--text-muted);
    transition: background .2s, color .2s, border-color .2s;
}
.chip:hover { border-color: #C9CED8; color: var(--text); }
.chip[aria-pressed="true"] { background: var(--ink-900); border-color: var(--ink-900); color: #fff; }
.logo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; list-style: none; }
.logo-grid li {
    height: 110px; display: grid; place-items: center; padding: 22px 26px;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    transition: opacity .3s, transform .3s var(--ease), box-shadow .3s;
}
.logo-grid li:hover { box-shadow: var(--shadow-hover); }
.logo-grid img { max-height: 52px; max-width: 100%; width: auto; object-fit: contain; filter: grayscale(1); opacity: .75; transition: filter .3s, opacity .3s; }
.logo-grid li:hover img { filter: none; opacity: 1; }
/* CWS logo is a red/pink banner: plain grayscale leaves dark letters on a dark bar,
   so lighten the background and boost contrast in the grey state only */
.logo-grid img.logo-cws {
    width: 100%; max-height: none; aspect-ratio: 296 / 84;   /* crop to the red block with the lettering */
    object-fit: cover; object-position: 1.4% center; border-radius: 4px;
    filter: grayscale(1) brightness(3) contrast(1.6); opacity: 1;
}
.logo-grid li:hover img.logo-cws { filter: none; }
.logo-grid li.is-hidden { display: none; }
@media (max-width: 480px) { .logo-grid { grid-template-columns: repeat(2, 1fr); } .logo-grid li { height: 90px; padding: 16px; } }

/* ---------- Contact ---------- */
.contact {
    position: relative; overflow: hidden; border-radius: var(--radius-lg);
    background:
        radial-gradient(700px 400px at 100% 0%, rgba(243, 28, 85, .25), transparent 60%),
        var(--ink-900);
    color: var(--text-on-dark); padding: clamp(36px, 6vw, 72px);
    display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center;
}
.contact h2 { font-size: clamp(30px, 4vw, 46px); color: #fff; }
.contact p { color: var(--text-on-dark-muted); font-size: 18px; }
.contact__list { list-style: none; display: grid; gap: 12px; }
.contact__item {
    display: flex; gap: 16px; align-items: center; padding: 18px 20px;
    border: 1px solid var(--ink-line); border-radius: var(--radius); background: rgba(255, 255, 255, .03);
    color: #fff; text-decoration: none !important; transition: border-color .2s, background .2s;
}
a.contact__item:hover { border-color: rgba(243, 28, 85, .55); background: rgba(243, 28, 85, .06); }
.contact__item .icon { margin: 0; flex: none; background: rgba(243, 28, 85, .14); color: #FF6A8F; }
.contact__item small { display: block; color: var(--text-on-dark-muted); font-size: 13px; }
.contact__item span { font-weight: 600; font-size: 17px; }
@media (max-width: 900px) { .contact { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink-900); color: var(--text-on-dark-muted); padding: 56px 0 40px; font-size: 15px; }
.footer__top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; padding-bottom: 32px; border-bottom: 1px solid var(--ink-line); }
.footer__brand img { height: 30px; width: auto; margin-bottom: 14px; }
.footer__brand p { max-width: 340px; margin: 0; }
.footer__nav { display: flex; flex-wrap: wrap; gap: 8px 28px; list-style: none; align-content: flex-start; }
.site-footer a { color: var(--text-on-dark); }
.footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 24px; font-size: 14px; }

/* ---------- Legal page ---------- */
.page-hero { background: var(--ink-900); color: #fff; padding: 140px 0 56px; }
.page-hero h1 { font-size: clamp(34px, 5vw, 52px); margin: 0; }
.legal { max-width: var(--container); }
.legal h2 { font-size: 30px; margin-top: 8px; }
.legal h3 { font-size: 19px; margin: 32px 0 8px; }
.legal p, .legal li { color: #3A4152; font-size: 16px; }
.legal ul { padding-left: 22px; margin-bottom: 1em; }
.legal .imprint-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 24px 0 8px; }
.legal .imprint-grid .card p { color: #3A4152; }
.legal .imprint-grid .card:hover { transform: none; }
.legal hr { border: 0; border-top: 1px solid var(--line); margin: 64px 0; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .reveal { opacity: 1; transform: none; }
}
