/* CXDXStudio site styles. Dark theme only (logo yellow #FFCF2E is the one accent).
   System font stack, no external requests. Fluid from 320 to 1600 px. Symmetric: centred rows, equal-width cards, no one-sided rows. */
:root {
  --bg-0: #0A0A08; --bg-1: #11110E; --bg-2: #181814; --bg-3: #20201B; --bg-4: #2A2A24;
  --line: #2C2B25; --line-2: #45433A; --ctl-line: #77745F;
  --text: #F6F3E8; --text-2: #BDB9AB; --text-3: #8E8A7C;
  --accent: #FFCF2E; --accent-hover: #FFDA5C; --accent-press: #E9B81D; --on-accent: #0A0A08;
  --off-bg: #161615; --off-line: #333331; --off-text: #9B9B96; --off-icon: #6E6E6A;
  --tile: #1C1B16;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", monospace;
  --radius: 16px; --radius-s: 12px;
  --gutter: clamp(16px, 4vw, 32px);
  --wide: 1200px; --narrow: 880px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; color-scheme: dark; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg-0); color: var(--text); font: 400 16px/1.65 var(--font); -webkit-font-smoothing: antialiased; }
main { flex: 1 0 auto; }
img, svg { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 650; letter-spacing: -.01em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
code, .mono { font-family: var(--mono); font-size: .9em; }
button { font: inherit; color: inherit; }

/* both languages are in the markup; the page shows one */
html[data-lang="en"] [data-l="tr"], html[data-lang="tr"] [data-l="en"] { display: none !important; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 50%; top: 8px; transform: translate(-50%, -200%); z-index: 100; padding: 10px 18px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 600; text-decoration: none; }
.skip:focus { transform: translate(-50%, 0); outline-color: var(--text); }

.container { width: min(100% - 2 * var(--gutter), var(--wide)); margin-inline: auto; }
.container--narrow { width: min(100% - 2 * var(--gutter), var(--narrow)); }
.icon { flex: none; }

/* ---------- header: 1fr auto 1fr, nav on the centre line ---------- */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg-1); }
.site-header__in { width: min(100% - 2 * var(--gutter), var(--wide)); margin-inline: auto; min-height: 68px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px 16px; padding-block: 12px; }
.brand { justify-self: start; display: inline-flex; align-items: center; border-radius: 8px; }
.brand img { display: block; height: 28px; width: auto; }
/* the dark-page wordmark shows on screen; the same logo with dark lettering is swapped in for print */
img.wm-print, .brand img.wm-print, .hero__title img.wm-print { display: none; }
.nav { display: flex; align-items: center; justify-content: center; gap: 6px; }
.nav a { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 16px; border-radius: 999px; color: var(--text-2); text-decoration: none; font-weight: 550; transition: color .15s, background-color .15s; }
.nav a:hover { color: var(--text); background: var(--bg-3); }
.nav a[aria-current="page"] { color: var(--text); background: var(--bg-3); box-shadow: inset 0 -2px 0 var(--accent); }
.lang { justify-self: end; display: inline-flex; padding: 3px; gap: 3px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--bg-2); }
.lang button { appearance: none; width: 40px; height: 32px; border: 0; border-radius: 999px; background: transparent; color: var(--text-2); font-size: 13px; font-weight: 650; letter-spacing: .04em; cursor: pointer; transition: color .15s, background-color .15s; }
.lang button:hover { color: var(--text); }
.lang button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.lang button:focus-visible { outline-offset: 1px; }
@media (max-width: 719px) {
  .site-header__in { grid-template-columns: 1fr auto; grid-template-areas: "brand lang" "nav nav"; }
  .brand { grid-area: brand; } .lang { grid-area: lang; }
  .nav { grid-area: nav; }
}

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent; font-size: 15px; font-weight: 600; line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer; transition: background-color .15s, border-color .15s, color .15s, transform .15s var(--ease); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn--primary:active { background: var(--accent-press); }
.btn--ghost { border-color: var(--ctl-line); background: transparent; color: var(--text); }
.btn--ghost:hover { background: var(--bg-3); color: var(--text); border-color: var(--text-3); }
.btn--lg { min-height: 52px; padding: 0 32px; font-size: 16px; }
.btn--sm { min-height: 40px; padding: 0 18px; font-size: 14px; }
.btn:focus-visible { outline-offset: 3px; border-radius: 999px; }
.icon--ext { width: 15px; height: 15px; opacity: .85; }

/* ---------- hero ---------- */
.hero { text-align: center; padding: clamp(48px, 9vw, 104px) var(--gutter) clamp(36px, 6vw, 64px); background: radial-gradient(60% 90% at 50% 0%, rgba(255, 207, 46, .10), rgba(255, 207, 46, 0) 70%); }
.hero__title { margin: 0 auto; width: min(100%, 560px); font-size: 0; }
.hero__title img { display: block; width: 100%; height: auto; margin-inline: auto; }
.hero__line { margin: clamp(20px, 3.5vw, 32px) auto 0; max-width: 34ch; color: var(--text-2); font-size: clamp(18px, 2.4vw, 22px); line-height: 1.5; text-wrap: balance; }
.hero__cta { margin-top: clamp(24px, 4vw, 36px); }

/* ---------- sections ---------- */
.section { padding: clamp(32px, 6vw, 64px) 0; }
.section--tight { padding: clamp(24px, 4vw, 40px) 0; }
.section__title { text-align: center; font-size: clamp(24px, 3.2vw, 32px); margin-bottom: clamp(20px, 3vw, 32px); }
.section__lead { text-align: center; color: var(--text-2); margin: -12px auto clamp(18px, 3vw, 28px); max-width: 60ch; text-wrap: balance; }
.page-head { text-align: center; padding: clamp(36px, 7vw, 72px) 0 clamp(12px, 3vw, 28px); }
.page-head__title { font-size: clamp(32px, 5.4vw, 48px); }
.page-head__lead { margin: 14px auto 0; max-width: 48ch; color: var(--text-2); font-size: clamp(16px, 2vw, 19px); text-wrap: balance; }
.page-head .tile { margin-bottom: 20px; }

/* ---------- icon tile ---------- */
.tile { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--tile); border: 1px solid var(--line); color: var(--accent); }
.tile--lg { width: 64px; height: 64px; border-radius: 18px; }
.tile--xl { width: 76px; height: 76px; border-radius: 22px; }
.tile--off { background: transparent; border: 1px dashed var(--off-line); color: var(--off-icon); }

/* ---------- home: four equal cards ---------- */
.cards { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1240px) { .cards { grid-template-columns: repeat(4, 1fr); } }
.cards__item { display: flex; }
.card { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding: 28px 22px 22px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .2s, background-color .2s, transform .2s var(--ease); }
@media (hover: hover) { .card:not(.card--off):hover { border-color: var(--line-2); background: var(--bg-3); transform: translateY(-2px); } }
.card__title { font-size: 21px; }
.card__text { color: var(--text-2); font-size: 15px; line-height: 1.55; text-wrap: balance; }
.card__actions { margin-top: auto; padding-top: 10px; width: 100%; display: grid; grid-template-rows: 46px 46px; gap: 10px; }
.card__actions > .btn { width: 100%; padding-inline: 12px; }
/* Games: grey, disabled, one word. No link, no hover, no animation. */
.card--off { background: var(--off-bg); border: 1px dashed var(--off-line); cursor: default; user-select: none; }
.card--off .card__title { color: var(--off-text); }
.card--off .card__text { color: var(--off-text); }
.soon-pill { grid-row: 1 / span 2; display: grid; place-items: center; min-height: 100px; border: 1px dashed var(--off-line); border-radius: var(--radius-s); color: var(--off-text); font-weight: 600; letter-spacing: .02em; }

/* ---------- products: tabs ---------- */
.tabs { padding-bottom: clamp(32px, 6vw, 64px); }
.tablist { max-width: var(--narrow); margin-inline: auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 6px; margin-bottom: clamp(24px, 4vw, 40px); background: var(--bg-1); border: 1px solid var(--line); border-radius: 20px; }
.tab { appearance: none; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 68px; min-width: 0; padding: 8px 10px; border: 1px solid transparent; border-radius: 14px; background: transparent; color: var(--text-2); font-size: 15px; font-weight: 600; cursor: pointer; transition: color .15s, background-color .15s, border-color .15s; }
.tab:hover { color: var(--text); background: var(--bg-2); }
.tab[aria-selected="true"] { color: var(--text); background: var(--bg-3); border-color: var(--line-2); box-shadow: inset 0 -2px 0 var(--accent); }
.tab__icon { color: var(--accent); }
.tab__label { overflow-wrap: anywhere; font-size: 14px; line-height: 1.2; text-align: center; }
/* Games tab: visibly grey (reduced contrast), no yellow; still focusable and selectable so "Coming soon" can be read */
.tab--off { color: var(--off-text); background: var(--off-bg); border: 1px dashed var(--off-line); }
.tab--off .tab__icon { color: var(--off-icon); }
.tab--off:hover { color: var(--off-text); background: var(--off-bg); }
.tab--off[aria-selected="true"] { color: var(--off-text); background: var(--off-bg); border-color: var(--off-line); border-style: dashed; box-shadow: inset 0 -2px 0 var(--off-icon); }
@media (max-width: 759px) { .tablist { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .tab { min-height: 52px; padding: 6px; } .tab__icon { display: none; } }

/* tab panels: the head script sets html[data-tab]; without JS every panel is shown one under the other */
.js .tabpanel { display: none; }
html:not([data-tab]) #panel-cexordex, html[data-tab="cexordex"] #panel-cexordex,
html[data-tab="bestmastering"] #panel-bestmastering, html[data-tab="games"] #panel-games, html[data-tab="qiguard"] #panel-qiguard { display: block; }
html:not(.js) .tablist { display: none; }
html:not(.js) .tabpanel + .tabpanel { margin-top: 64px; padding-top: 48px; border-top: 1px solid var(--line); }
.tabpanel:focus-visible { outline-offset: 6px; border-radius: var(--radius); }
.panel__head { display: grid; justify-items: center; gap: 12px; text-align: center; margin-bottom: clamp(18px, 3vw, 28px); }
.panel__title { font-size: clamp(30px, 4.4vw, 40px); }
.panel__tagline { color: var(--text-2); font-size: clamp(16px, 2vw, 19px); max-width: 40ch; text-wrap: balance; }
.prose { max-width: 68ch; margin-inline: auto; color: var(--text); }
.prose p + p { margin-top: 1em; }
.cta { display: flex; justify-content: center; margin: clamp(20px, 3vw, 28px) 0 clamp(8px, 2vw, 16px); }
.cta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }
.block { margin-top: clamp(32px, 5vw, 52px); }
.block-title { text-align: center; font-size: clamp(20px, 2.6vw, 24px); margin: 0 0 clamp(16px, 2.5vw, 24px); }
.section .block { margin-top: clamp(28px, 4vw, 40px); }

/* feature grids: centred, equal-width cells; an odd last cell stays centred */
.grid { --cols: 3; --gap: 16px; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--gap); }
.grid > li { flex: 0 0 calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols)); min-width: 0; display: flex; container-type: inline-size; }
.grid--3 { --cols: 3; } .grid--4 { --cols: 4; }
@media (max-width: 1099px) { .grid--4 { --cols: 2; } }
@media (max-width: 899px) { .grid--3 { --cols: 2; } }
@media (max-width: 639px) { .grid--3, .grid--4 { --cols: 1; } }
.feat { flex: 1; padding: 22px 20px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; gap: 10px; }
.feat__title { font-size: 17px; }
/* two title lines in cards narrower than the step chosen by the page generator */
@container (width < 260px) { .tw-260 .feat__title { min-height: 2.4em; } }
@container (width < 300px) { .tw-300 .feat__title { min-height: 2.4em; } }
@container (width < 340px) { .tw-340 .feat__title { min-height: 2.4em; } }
@container (width < 380px) { .tw-380 .feat__title { min-height: 2.4em; } }
@container (width < 420px) { .tw-420 .feat__title { min-height: 2.4em; } }
@container (width < 460px) { .tw-460 .feat__title { min-height: 2.4em; } }
.feat__text { color: var(--text-2); font-size: 15px; line-height: 1.6; }
.feat__foot { margin-top: auto; padding-top: 8px; display: grid; justify-items: center; gap: 8px; }
.feat__tags { font-family: var(--mono); font-size: 12px; line-height: 1.5; color: var(--text-2); text-align: center; text-wrap: balance; }

/* chips */
.chip { display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: .02em; border: 1px solid var(--line-2); color: var(--text-2); background: var(--bg-1); }
.chip--ok { color: var(--accent); border-color: rgba(255, 207, 46, .45); }
.chip--plan { color: var(--text-2); border-style: dashed; border-color: var(--ctl-line); }
.chip--tag { font-family: var(--mono); font-weight: 500; font-size: 12px; color: var(--text-2); }

/* facts table */
.facts-wrap { max-width: var(--narrow); margin-inline: auto; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.facts { width: 100%; border-collapse: collapse; }
.facts th, .facts td { padding: 14px 20px; vertical-align: top; text-align: left; border-top: 1px solid var(--line); }
.facts tr:first-child > * { border-top: 0; }
.facts th { width: 34%; color: var(--text-2); font-weight: 600; font-size: 14px; }
.facts td { color: var(--text); font-size: 15px; overflow-wrap: anywhere; text-wrap: balance; }
@media (max-width: 599px) {
  .facts, .facts tbody, .facts tr, .facts th, .facts td { display: block; width: 100%; }
  .facts th { padding: 14px 16px 2px; border-top: 1px solid var(--line); }
  .facts td { padding: 0 16px 14px; border-top: 0; }
  .facts tr:first-child > th { border-top: 0; }
}

/* notes */
.note { max-width: var(--narrow); margin: clamp(24px, 4vw, 36px) auto 0; padding: 18px 22px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius); }
.note__label { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 8px; color: var(--text-2); font-size: 13px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.note__text { color: var(--text-2); font-size: 15px; line-height: 1.65; }
.legal-line { margin: 16px auto 0; max-width: var(--narrow); text-align: center; color: var(--text-3); font-size: 13px; text-wrap: balance; }

/* link chips */
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 850px; margin-inline: auto; }
.chip-link { display: inline-flex; align-items: center; justify-content: center; position: relative; width: 270px; max-width: 100%; min-height: 44px; padding: 0 34px; text-align: center; line-height: 1.25; border: 1px solid var(--ctl-line); border-radius: 999px; color: var(--text); font-size: 14px; font-weight: 550; text-decoration: none; transition: background-color .15s, border-color .15s; }
.chip-link .icon--ext { position: absolute; right: 13px; top: 50%; margin-top: -7.5px; }
.chip-link:hover { background: var(--bg-3); border-color: var(--text-3); color: var(--text); }

/* Games panel: grey, dashed, one word; nothing else, nothing interactive */
.soon { display: grid; justify-items: center; align-content: center; gap: 14px; min-height: 260px; padding: 32px 24px; border: 1px dashed var(--off-line); border-radius: var(--radius); background: var(--off-bg); color: var(--off-text); cursor: default; user-select: none; }
.soon__icon { color: var(--off-icon); width: 40px; height: 40px; }
.soon__label { font-size: clamp(22px, 3vw, 28px); font-weight: 600; letter-spacing: .02em; color: var(--off-text); }

/* ---------- Qiguard page ---------- */
.sites { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.site { flex: 0 1 340px; display: grid; justify-items: center; gap: 6px; padding: 22px 20px; text-align: center; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); }
.site__name { font-size: 20px; font-weight: 650; }
.site__host { color: var(--text-3); font-family: var(--mono); font-size: 14px; }
.site__note { color: var(--text-2); font-size: 15px; text-wrap: balance; }
.site__chip { margin-top: 6px; }
.site__link { margin-top: 10px; }
.planned { display: grid; justify-items: center; gap: 8px; padding: 26px 22px; text-align: center; border: 1px dashed var(--ctl-line); border-radius: var(--radius); background: var(--bg-1); }
.planned__label { font-size: 19px; font-weight: 650; text-wrap: balance; }
.planned__detail { color: var(--text-2); font-size: 15px; text-wrap: balance; }

/* ---------- 404 ---------- */
.page-head--nf { padding-block: clamp(56px, 12vw, 120px); }
.nf__code { color: var(--accent); font-size: clamp(56px, 12vw, 96px); font-weight: 700; line-height: 1; margin-bottom: 12px; letter-spacing: -.03em; }

/* ---------- footer + shield strip ---------- */
.site-footer { margin-top: clamp(24px, 5vw, 56px); border-top: 1px solid var(--line); background: var(--bg-1); }
.site-footer__in { width: min(100% - 2 * var(--gutter), var(--wide)); margin-inline: auto; padding: clamp(28px, 5vw, 44px) 0; display: grid; justify-items: center; gap: 20px; text-align: center; }
.shield-strip { display: flex; justify-content: center; }
.shield-badge { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 48px; padding: 8px 22px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--bg-2); color: var(--text); font-weight: 600; text-decoration: none; text-wrap: balance; transition: background-color .15s, border-color .15s; }
.shield-badge:hover { background: var(--bg-3); border-color: var(--ctl-line); color: var(--text); }
.shield-badge__icon { color: var(--accent); }
.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px; }
.footer-nav a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; color: var(--text-2); text-decoration: none; font-weight: 550; }
.footer-nav a:hover { color: var(--text); background: var(--bg-3); }
.footer-note { color: var(--text-3); font-size: 13px; max-width: 70ch; text-wrap: balance; }
.footer-note--legal { margin-top: -8px; }

/* ---------- reduced motion, print ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .card:hover { transform: none !important; }
}
@media print {
  :root { --bg-0: #fff; --bg-1: #fff; --bg-2: #fff; --bg-3: #fff; --text: #000; --text-2: #222; --text-3: #444; --accent: #000; --line: #bbb; --line-2: #888; --ctl-line: #666; --off-text: #444; --off-bg: #fff; --off-line: #999; --off-icon: #666; --tile: #fff; --on-accent: #000; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .skip, .lang, .nav, .tablist, .hero__cta, .footer-nav, .btn:not([target]), .icon--ext { display: none !important; }
  img.wm-screen { display: none !important; }
  img.wm-print { display: block !important; }
  .hero { background: none; padding: 16pt 0; }
  .tabpanel { display: block !important; break-inside: avoid-page; margin-top: 18pt; }
  .tabpanel--off { display: none !important; }
  .card, .feat, .facts-wrap, .note, .site, .planned { break-inside: avoid; box-shadow: none; }
  a { color: #000; text-decoration: none; }
  a[target="_blank"]::after { content: " (" attr(href) ")"; font-weight: 400; font-size: 9pt; overflow-wrap: anywhere; }
  .btn--primary { background: none; border: 1px solid #000; color: #000; }
  .chip-link { width: auto; padding: 4pt 8pt; }
  .tile { border-color: #888; }
  .site-footer { border-top: 1px solid #888; }
}
