/* code.wes.dev.br — brand colors from logomarca/ (navy, W gradient, cyan window, orange </>). */
:root {
  --navy: #0b1433;
  --blue: #2a7bff;
  --violet: #8b3df5;
  --cyan: #22c7f5;
  --orange: #ff6a13;

  --bg: var(--navy);
  --text: #eef2ff;
  --text-muted: #a3aed6;
  --link: var(--cyan);
  --rule: #1f2b58;
  --code-bg: #070d24;

  --font-display: 'Doto', 'Share Tech Mono', ui-monospace, monospace;
  --font-text: 'Chakra Petch', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-code: 'Share Tech Mono', ui-monospace, Consolas, monospace;

  color-scheme: dark;
}

/* Light by the system, unless a page chose dark (data-theme, the admin's switch); or chosen. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) {
    --bg: #f4f6fc;
    --text: #0b1433;
    --text-muted: #46507a;
    --link: #1259c9;
    --rule: #d3d9ec;
    --code-bg: #e7ebf7;
    color-scheme: light;
  }
}

:root[data-theme='light'] {
  --bg: #f4f6fc;
  --text: #0b1433;
  --text-muted: #46507a;
  --link: #1259c9;
  --rule: #d3d9ec;
  --code-bg: #e7ebf7;
  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--font-text);
}

a {
  color: var(--link);
  text-underline-offset: 0.18em;
}

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

.top,
main,
.foot {
  width: min(1160px, 100% - 32px);
  margin-inline: auto;
}

/* ---------- Header ---------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 28px;
}

.brand img {
  display: block;
  width: 200px;
  height: auto;
}

.top__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.top__nav a {
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}

.top__nav a:hover {
  border-color: var(--rule);
  background: color-mix(in srgb, var(--link) 12%, transparent);
}

.top__nav a[aria-current='page'] {
  border-color: color-mix(in srgb, var(--link) 55%, transparent);
  background: color-mix(in srgb, var(--link) 10%, transparent);
}

/* The theme switch (assets/theme.js): automatic, light or dark; only with JavaScript. */
.top__theme {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.top__theme[hidden] {
  display: none;
}

.top__theme:hover {
  border-color: var(--link);
  color: var(--link);
}

.top__theme:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

/* The "Menu" button exists only with JavaScript and on small screens (assets/menu.js). */
.top__toggle,
.top__toggle[hidden] {
  display: none;
}

@media (max-width: 640px) {
  .top {
    flex-wrap: wrap;
  }

  .top__nav {
    justify-content: flex-start;
  }

  .top__nav a {
    padding: 6px 10px;
  }

  .top--js {
    position: relative;
    flex-wrap: nowrap;
  }

  .top--js .top__toggle:not([hidden]) {
    display: inline-flex;
    margin-left: auto;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 8px 14px;
    border: 1px solid var(--rule);
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
  }

  .top--js .top__toggle:focus-visible {
    outline: 2px solid var(--link);
    outline-offset: 2px;
  }

  /* Three lines that turn into an X when open. */
  .top__bars,
  .top__bars::before,
  .top__bars::after {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 1px;
    background: currentColor;
    transition: transform 0.15s, background-color 0.15s;
  }

  .top__bars {
    position: relative;
  }

  .top__bars::before,
  .top__bars::after {
    position: absolute;
    left: 0;
    content: '';
  }

  .top__bars::before {
    top: -6px;
  }

  .top__bars::after {
    top: 6px;
  }

  .top--js.is-open .top__bars {
    background: transparent;
  }

  .top--js.is-open .top__bars::before {
    transform: translateY(6px) rotate(45deg);
  }

  .top--js.is-open .top__bars::after {
    transform: translateY(-6px) rotate(-45deg);
  }

  .top--js .top__nav {
    position: absolute;
    top: calc(100% - 16px);
    right: 0;
    left: 0;
    z-index: 20;
    display: none;
    flex-direction: column;
    gap: 2px;
    padding: 8px;
    border: 1px solid var(--rule);
    border-radius: 10px;
    background: var(--bg);
    box-shadow: 0 12px 32px rgb(0 0 0 / 0.35);
  }

  .top--js.is-open .top__nav {
    display: flex;
  }

  .top--js .top__nav a {
    padding: 12px 14px;
    font-size: 1.0625rem;
  }

  .brand img {
    width: 170px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .top__bars,
  .top__bars::before,
  .top__bars::after {
    transition: none;
  }
}

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 56px;
  align-items: center;
  padding-block: 40px 88px;
}

.hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.2rem, 4.2vw, 3.5rem);
  line-height: 1.1;
  word-spacing: -0.25em;
}

.hero__lead {
  max-width: 32em;
  margin: 24px 0 0;
  color: var(--text-muted);
  font-size: 1.1875rem;
}

.download {
  margin-top: 36px;
}

.download p {
  margin: 0;
}

.download__status {
  max-width: 30em;
  padding-left: 14px;
  border-left: 3px solid var(--cyan);
}

.button-download {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 24px;
  border-radius: 10px;
  background: linear-gradient(100deg, var(--blue), var(--violet));
  color: #fff;
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
}

.button-download:hover {
  filter: brightness(1.08);
}

.button-download small {
  font-size: 0.875rem;
  font-weight: 400;
  opacity: 0.92;
}

.download .download__meta {
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* The editor window: the app's own "WeS Noite" theme, tilted like the window in the icon. */
.window {
  --win-bg: #272822;
  --win-chrome: #1e1f1c;
  --win-text: #f8f8f2;
  --win-gutter: #90908a;

  justify-self: center;
  width: max-content;
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  border: 3px solid var(--cyan);
  border-radius: 12px;
  background: var(--win-bg);
  color: var(--win-text);
  font-family: var(--font-code);
  font-size: min(14px, (100vw - 56px) / 30);
  transform: rotate(-2deg);
}

.window__tabs {
  display: flex;
  background: var(--win-chrome);
  font-family: var(--font-text);
  font-size: 0.86em;
}

.window__tab {
  padding: 0.55em 1.2em;
  color: #9a9a8f;
}

.window__tab.is-active {
  background: var(--win-bg);
  color: var(--win-text);
  box-shadow: inset 0 2px 0 #6c8cff;
}

.window__text {
  padding: 0.8em 1.2em 0.8em 0;
}

.row {
  display: flex;
  line-height: 1.5;
}

.gutter {
  flex: none;
  width: 6ch;
  padding-right: 1.2ch;
  color: var(--win-gutter);
  text-align: right;
}

.code {
  white-space: pre;
}

.match {
  border-radius: 2px;
  background: rgb(230 219 116 / 0.28);
  box-shadow: 0 0 0 1px rgb(230 219 116 / 0.55);
  color: inherit;
}

.match.current {
  background: rgb(255 152 0 / 0.75);
  box-shadow: 0 0 0 1px rgb(255 190 80);
  color: #1e1f1c;
}

.window__status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em 1.6em;
  padding: 0.45em 1.2em;
  background: #2b2d6e;
  color: #f2f2ff;
  font-family: var(--font-text);
  font-size: 0.86em;
}

[data-index] {
  font-variant-numeric: tabular-nums;
}

/* ---------- Sections ---------- */

.install,
.requirements,
.plan {
  padding-block: 64px;
  border-top: 1px solid var(--rule);
}

h2 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.2;
}

.section__lead {
  max-width: 40em;
  margin: 14px 0 0;
  color: var(--text-muted);
}

.systems {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 36px;
}

.systems--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.system code,
.section__lead code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--code-bg);
  font: 0.9em var(--font-code);
}

.system {
  padding: 4px 28px 8px;
  border-left: 1px solid var(--rule);
}

.system:first-child {
  padding-left: 0;
  border-left: 0;
}

.system h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.system p {
  margin: 10px 0 0;
}

.system__steps {
  margin: 10px 0 0;
  padding-left: 1.4em;
}

.system__steps li + li {
  margin-top: 8px;
}

.system__mine {
  display: none;
  color: var(--link);
  font-size: 0.9375rem;
  font-weight: 600;
}

.system.is-current .system__mine {
  display: block;
  margin-top: 2px;
}

.system pre {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--code-bg);
  font: 0.875rem/1.5 var(--font-code);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 56px;
  max-width: 60em;
  margin: 36px 0 0;
}

.features dt {
  font-weight: 600;
}

.features dd {
  margin: 4px 0 0;
  color: var(--text-muted);
}

/* ---------- Release notes ---------- */

.notes {
  padding-block: 40px 88px;
}

.notes > * {
  max-width: 44em;
}

.notes h1 {
  margin: 0;
  font-size: 2.25rem;
  font-weight: 600;
  line-height: 1.15;
}

.release {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
}

.release__date {
  margin: 4px 0 0;
  color: var(--text-muted);
}

.release ul {
  margin: 16px 0 0;
  padding-left: 1.2em;
}

/* A large version groups its notes by area. */
.release h3 {
  margin: 28px 0 0;
  font-size: 1.125rem;
}

.release h3 + ul {
  margin-top: 10px;
}

.download .download__howto {
  margin-top: 12px;
  font-weight: 600;
}

/* ---------- All downloads ---------- */

.downloads {
  padding-block: 40px 88px;
}

.downloads h1 {
  margin: 0;
  font-size: 2.25rem;
  font-weight: 600;
  line-height: 1.15;
}

.downloads .section__lead {
  max-width: 44em;
}

.downloads__after {
  max-width: 44em;
  margin: 32px 0 0;
  color: var(--text-muted);
}

.downloads__note {
  max-width: 44em;
  margin: 14px 0 0;
  color: var(--text-muted);
}

/* Each system: its download beside how to install it; the visitor's own first. */
.oses {
  margin-top: 32px;
}

.os {
  padding-block: 28px;
  border-top: 1px solid var(--rule);
  scroll-margin-top: 16px;
}

.os h2 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 600;
}

.os__mine {
  display: none;
  color: var(--link);
  font-size: 1rem;
}

.os.is-current .os__mine {
  display: inline;
}

.os.is-current {
  border-top: 0;
  padding-top: 8px;
}

.os:target h2 {
  color: var(--link);
}

.os__pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px 36px;
  align-items: start;
  margin-top: 16px;
}

.os h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
}

.os__install {
  padding-top: 21px;
}

.os__install p {
  margin: 10px 0 0;
}

.os__install .system__steps {
  margin: 10px 0 0;
  padding-left: 1.4em;
}

.os__install .system__steps li + li {
  margin-top: 8px;
}

.os__install code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--code-bg);
  font: 0.9em var(--font-code);
}

.os__install pre {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--code-bg);
  font: 0.875rem/1.5 var(--font-code);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.os__install pre code {
  padding: 0;
  background: none;
}

.oses__others {
  margin: 36px 0 0;
  padding-top: 28px;
  border-top: 2px solid var(--rule);
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.oses__others + .os {
  border-top: 0;
}

.dl {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  border: 1px solid var(--rule);
  border-radius: 12px;
}

.dl.is-current {
  border-color: color-mix(in srgb, var(--link) 60%, transparent);
  background: color-mix(in srgb, var(--link) 6%, transparent);
}

.dl h3 {
  margin: 0;
  font-size: 1.25rem;
}

.dl p {
  margin: 0;
  overflow-wrap: anywhere;
}

.dl__detail,
.dl__facts,
.dl__none {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.dl__permanent,
.dl__file,
.dl__hash {
  font-size: 0.9375rem;
}

.dl__hash code {
  font: 0.8125rem/1.5 var(--font-code, monospace);
  word-break: break-all;
}

.dl__play {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}

.dl__play::before {
  content: '▶';
  color: #34a853;
}

.dl__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px !important;
}

.dl__get {
  padding: 8px 14px;
  border-radius: 8px;
  background: linear-gradient(100deg, var(--blue), var(--violet));
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.dl__copy {
  padding: 6px 12px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: transparent;
  color: var(--link);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.dl__copy:hover {
  border-color: var(--link);
}

.dl__file .dl__copy,
.dl__hash .dl__copy {
  margin-left: 4px;
  padding: 2px 10px;
}

@media (max-width: 920px) {
  .os__pair {
    grid-template-columns: minmax(0, 1fr);
  }

  .os__install {
    padding-top: 4px;
  }
}

/* ---------- Frequently asked questions ---------- */

.faq__group {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
}

.faq__group h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.faq__item h3 {
  margin: 24px 0 0;
  font-size: 1.125rem;
  line-height: 1.35;
}

.faq__item p {
  margin: 8px 0 0;
  line-height: 1.6;
}

.faq__cta {
  margin-top: 48px;
}

.plan__more {
  margin: 32px 0 0;
}

/* ---------- Requirements ---------- */

.requirements__list {
  margin: 16px 0 0;
  padding-left: 1.2em;
}

.requirements__list li + li {
  margin-top: 8px;
}

/* ---------- Footer ---------- */

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 28px 40px;
  border-top: 1px solid var(--rule);
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.foot p {
  margin: 0;
}

.foot__version:empty {
  display: none;
}

/* ---------- Narrow screens ---------- */

@media (max-width: 920px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
    padding-block: 16px 64px;
  }

  .window {
    transform: none;
  }

  .systems,
  .features {
    grid-template-columns: minmax(0, 1fr);
  }

  .system,
  .system:first-child {
    padding: 22px 0 0;
    border-left: 0;
  }

  .system + .system {
    margin-top: 22px;
    border-top: 1px solid var(--rule);
  }
}

@media (max-width: 480px) {
  .brand img {
    width: 160px;
  }
}
