:root {
  --max: 1180px;
  --bg: #f4f3ed;
  --surface: #ffffff;
  --ink: #101415;
  --muted: #5f6c70;
  --line: #d8ddd9;
  --accent: #35c978;
  --accent-2: #ff9f1a;
  --dark: #101415;
  --display: "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  --body: "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--bg); font-family: var(--body); line-height: 1.55; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input { font: inherit; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.skip-link { position: fixed; top: -80px; left: 12px; z-index: 100; padding: 10px 14px; color: #101415; background: #fff; }
.skip-link:focus { top: 12px; }
.cws-header { min-height: 76px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px; padding: 10px max(20px, calc((100vw - var(--max)) / 2)); color: #fff; background: var(--dark); border-bottom: 1px solid rgba(255,255,255,.16); }
.cws-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; text-decoration: none; }
.cws-brand img { width: 42px; height: 42px; object-fit: contain; }
.cws-nav { display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; }
.cws-nav a { padding: 9px 10px; font-size: .86rem; font-weight: 750; text-decoration: none; }
.cws-nav a[aria-current="page"] { color: var(--accent); }
.theme-switcher { display: flex; align-items: center; gap: 9px; }
.theme-switcher > span { color: rgba(255,255,255,.62); font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.theme-switcher div { display: flex; gap: 3px; padding: 3px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); border-radius: 6px; }
.theme-switcher button { min-height: 34px; padding: 6px 9px; color: rgba(255,255,255,.78); background: transparent; border: 0; border-radius: 4px; cursor: pointer; font-size: .72rem; font-weight: 800; }
.theme-switcher button[aria-pressed="true"] { color: #101415; background: var(--accent); }
.theme-hero { min-height: min(82svh, 760px); position: relative; display: flex; align-items: flex-end; overflow: hidden; color: #fff; background: #090d0f center/cover no-repeat; }
.theme-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(4,7,8,.92) 0%, rgba(4,7,8,.64) 39%, rgba(4,7,8,.08) 72%); }
.hero-inner { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; padding: 92px 0 76px; position: relative; }
.hero-inner > * { max-width: 700px; }
.kicker, .section-label { margin: 0 0 13px; color: var(--accent); font-size: .76rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
h1, h2, h3 { font-family: var(--display); letter-spacing: 0; }
.theme-hero h1 { margin: 0; max-width: 770px; font-size: clamp(3.2rem, 7vw, 6.6rem); line-height: .92; }
.hero-lead { margin: 24px 0 0; color: rgba(255,255,255,.82); font-size: clamp(1.05rem, 2vw, 1.35rem); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; padding: 11px 17px; color: #101415; background: var(--accent); border: 1px solid var(--accent); border-radius: 5px; font-weight: 850; text-decoration: none; }
.button.secondary { color: #fff; background: rgba(8,12,13,.72); border-color: rgba(255,255,255,.35); }
.band { padding: clamp(68px, 9vw, 112px) 20px; }
.band.surface { background: var(--surface); }
.band.dark { color: #fff; background: var(--dark); }
.inner { width: min(var(--max), 100%); margin: 0 auto; }
.section-head { max-width: 820px; margin-bottom: 38px; }
.section-head h2, .feature-copy h2, .video-copy h2 { margin: 0; font-size: clamp(2rem, 4.4vw, 4.1rem); line-height: 1; }
.section-head > p:last-child, .feature-copy > p, .video-copy > p { color: var(--muted); font-size: 1.06rem; }
.dark .section-head > p:last-child, .dark .feature-copy > p { color: rgba(255,255,255,.7); }
.phase-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); border-top: 1px solid var(--line); }
.phase { min-height: 178px; padding: 24px 18px 0 0; }
.phase span { display: block; margin-bottom: 10px; color: var(--accent-2); font-size: .74rem; font-weight: 900; }
.phase strong { display: block; font-size: 1.02rem; }
.phase p { color: var(--muted); }
.feature { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: clamp(34px, 7vw, 92px); align-items: center; }
.feature-media img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border: 1px solid var(--line); border-radius: 6px; }
.feature-copy ul { margin: 24px 0; padding-left: 20px; }
.feature-copy li + li { margin-top: 8px; }
.video-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(290px, .75fr); gap: clamp(30px, 6vw, 74px); align-items: center; }
.video-player { width: 100%; aspect-ratio: 16/9; overflow: hidden; background: #000; border: 1px solid var(--line); border-radius: 6px; }
.video-player iframe { width: 100%; height: 100%; display: block; border: 0; }
.cta { padding: clamp(34px, 6vw, 62px); color: #101415; background: var(--accent); }
.cta h2 { max-width: 850px; margin: 0; font-size: clamp(2rem, 4.5vw, 4.2rem); line-height: 1; }
.cta p { max-width: 700px; }
.cta .button { color: #fff; background: #101415; border-color: #101415; }
.cws-footer { display: grid; grid-template-columns: 1fr auto auto; align-items: end; gap: 30px; padding: 34px max(20px, calc((100vw - var(--max)) / 2)); color: #fff; background: var(--dark); }
.cws-footer p { margin: 6px 0 0; color: rgba(255,255,255,.62); }
.cws-footer nav { display: flex; flex-wrap: wrap; gap: 12px; }
.cws-footer a { font-size: .84rem; font-weight: 750; }
.version-note { font-size: .74rem; white-space: nowrap; }

/* Galáxia: missão, navegação e linguagem de comando. */
.theme-galaxia { --bg: #060914; --surface: #eef4f7; --ink: #121827; --muted: #526171; --line: #bccbd3; --accent: #f5cf52; --accent-2: #62d7f4; --dark: #070a12; --display: "Arial Narrow", "Segoe UI", Arial, sans-serif; }
.theme-galaxia .theme-hero { background-image: url('/images/themes/galaxia/cws-hero.webp'); background-position: 52% center; }
.theme-galaxia .theme-hero h1 { text-transform: uppercase; max-width: 670px; }
.theme-galaxia .mission-band { color: #eaf7ff; background: #0b1220; }
.theme-galaxia .mission-map { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; position: relative; }
.theme-galaxia .mission-map::before { content: ""; position: absolute; top: 35px; left: 8%; right: 8%; height: 1px; background: #62d7f4; }
.theme-galaxia .mission-node { position: relative; padding: 72px 18px 0; text-align: center; }
.theme-galaxia .mission-node::before { content: ""; width: 15px; height: 15px; position: absolute; top: 28px; left: calc(50% - 8px); background: #07101b; border: 3px solid #f5cf52; border-radius: 50%; box-shadow: 0 0 18px #62d7f4; }
.theme-galaxia .mission-node p { color: #a8bdc9; }
.theme-galaxia .command-feature { border-top: 1px solid #30445a; border-bottom: 1px solid #30445a; }
.theme-galaxia .command-feature .feature-media img { border-radius: 0; clip-path: polygon(0 0, 93% 0, 100% 9%, 100% 100%, 7% 100%, 0 91%); }

/* Matriz: arquitetura, diagnóstico e protocolos. */
.theme-matriz { --bg: #020604; --surface: #07100a; --ink: #c8f7d2; --muted: #77ac82; --line: #1b5530; --accent: #51f47a; --accent-2: #f0f6ec; --dark: #010302; --display: Consolas, "Courier New", monospace; --body: Consolas, "Courier New", monospace; }
.theme-matriz .cws-header, .theme-matriz .cws-footer { border-color: #1b5530; }
.theme-matriz .theme-hero { background-image: url('/images/themes/matriz/cws-hero.webp'); background-position: center; }
.theme-matriz .theme-hero::before { background: linear-gradient(90deg, rgba(0,3,1,.95), rgba(0,3,1,.7) 40%, rgba(0,3,1,.04) 70%); }
.theme-matriz .theme-hero h1 { max-width: 650px; font-size: clamp(2.8rem, 6.1vw, 5.8rem); }
.theme-matriz .button { text-transform: uppercase; border-radius: 0; }
.theme-matriz .protocol-grid { display: grid; grid-template-columns: .72fr 1.28fr; border: 1px solid var(--line); }
.theme-matriz .protocol-index { padding: 34px; border-right: 1px solid var(--line); }
.theme-matriz .protocol-index strong { color: var(--accent); font-size: 3.5rem; }
.theme-matriz .protocol-log { padding: 34px; }
.theme-matriz .log-row { display: grid; grid-template-columns: 100px 1fr; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.theme-matriz .log-row:last-child { border-bottom: 0; }
.theme-matriz .log-row span { color: var(--accent); font-weight: 900; }
.theme-matriz .log-row p { margin: 0; color: var(--muted); }
.theme-matriz .system-section { background-image: linear-gradient(rgba(81,244,122,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(81,244,122,.045) 1px, transparent 1px); background-size: 36px 36px; }
.theme-matriz .feature-media img, .theme-matriz .video-player { border-radius: 0; }

/* Multiverso: frentes paralelas e coordenação de capacidades. */
.theme-multiverso { --bg: #edf0f3; --surface: #ffffff; --ink: #161922; --muted: #596271; --line: #bac1cc; --accent: #f3c64f; --accent-2: #34b9df; --dark: #11141c; --display: Impact, "Arial Narrow", "Segoe UI", sans-serif; }
.theme-multiverso .theme-hero { background-image: url('/images/themes/multiverso/cws-hero.webp'); background-position: center; }
.theme-multiverso .theme-hero::before { background: linear-gradient(90deg, rgba(9,12,17,.94), rgba(9,12,17,.55) 42%, rgba(9,12,17,.03) 74%); }
.theme-multiverso .theme-hero h1 { max-width: 740px; text-transform: uppercase; }
.theme-multiverso .fronts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.theme-multiverso .front { min-height: 240px; padding: 26px; color: #fff; background: #181d28; border-top: 7px solid var(--front-color); }
.theme-multiverso .front:nth-child(1) { --front-color: #e94350; }
.theme-multiverso .front:nth-child(2) { --front-color: #34b9df; }
.theme-multiverso .front:nth-child(3) { --front-color: #f3c64f; }
.theme-multiverso .front:nth-child(4) { --front-color: #6ad28a; }
.theme-multiverso .front span { color: var(--front-color); font-size: .75rem; font-weight: 900; text-transform: uppercase; }
.theme-multiverso .front h3 { margin: 18px 0 9px; font-size: 1.7rem; text-transform: uppercase; }
.theme-multiverso .front p { color: #b9c2ce; }
.theme-multiverso .assembly { position: relative; overflow: hidden; color: #fff; background: #11141c; }
.theme-multiverso .assembly::after { content: "04"; position: absolute; right: 3%; top: -48px; color: rgba(255,255,255,.045); font: 900 300px/1 Impact, sans-serif; }
.theme-multiverso .assembly .feature { position: relative; z-index: 1; }

@media (max-width: 980px) {
  .cws-header { grid-template-columns: auto 1fr; }
  .theme-switcher { grid-column: 1 / -1; justify-content: space-between; }
  .theme-switcher div { overflow-x: auto; }
  .phase-grid, .theme-galaxia .mission-map { grid-template-columns: 1fr; }
  .theme-galaxia .mission-map::before { top: 0; bottom: 0; left: 7px; right: auto; width: 1px; height: auto; }
  .theme-galaxia .mission-node { padding: 8px 0 24px 40px; text-align: left; }
  .theme-galaxia .mission-node::before { top: 10px; left: 0; }
  .theme-multiverso .fronts { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .cws-header { grid-template-columns: 1fr; align-items: start; gap: 7px; }
  .cws-nav { justify-content: flex-start; flex-wrap: wrap; }
  .theme-switcher { grid-column: auto; align-items: flex-start; flex-direction: column; }
  .theme-switcher div { width: 100%; }
  .theme-switcher button { flex: 1 0 auto; }
  .theme-hero { min-height: 700px; background-position: 58% center; }
  .theme-hero::before { background: linear-gradient(0deg, rgba(4,7,8,.96), rgba(4,7,8,.56) 58%, rgba(4,7,8,.08)); }
  .hero-inner { width: calc(100% - 28px); padding: 300px 0 46px; }
  .theme-hero h1 { font-size: clamp(3rem, 15vw, 5rem); }
  .feature, .video-layout, .theme-matriz .protocol-grid { grid-template-columns: 1fr; }
  .theme-matriz .protocol-index { border-right: 0; border-bottom: 1px solid var(--line); }
  .theme-multiverso .fronts { grid-template-columns: 1fr; }
  .cws-footer { grid-template-columns: 1fr; align-items: start; }
}
@media (max-width: 430px) {
  .cws-header, .band { padding-inline: 14px; }
  .cws-nav a { padding: 7px 6px; font-size: .8rem; }
  .theme-switcher > span { display: none; }
  .theme-switcher button { padding-inline: 7px; font-size: .68rem; }
  .theme-hero { min-height: 650px; }
  .hero-inner { padding-top: 270px; }
  .actions .button { width: 100%; }
  .theme-matriz .log-row { grid-template-columns: 1fr; gap: 5px; }
}
.theme-atari .theme-hero {
  background-image: url('/images/themes/atari/cws-hero.png?v=20260726b');
  background-position: center;
  image-rendering: pixelated;
  border-bottom: 8px solid #5ce1e6;
}
.theme-atari .theme-hero::before {
  background: linear-gradient(90deg, rgba(8,7,10,.97), rgba(8,7,10,.7) 52%, rgba(8,7,10,.12));
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
