/* The launch page and sources.html. */

:root {
  --bg: #f7f7f4;
  --fg: #1d1d1b;
  --muted: #5c5c57;
  --line: #d4d4cc;
  --link: #1f5fa8;
  --surface: #fff;
  --info-bg: #eaf1f9;
  --info-line: #c3d5ea;
  --info-mark: #1f5fa8;
  --button-bg: #1d1d1b;
  --button-fg: #f7f7f4;
  --screen: #000;
  --shadow: 0 1px 2px rgb(0 0 0 / 6%), 0 8px 24px rgb(0 0 0 / 8%);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413;
    --fg: #e8e8e3;
    --muted: #a3a39c;
    --line: #3a3a36;
    --link: #8ab8f0;
    --surface: #1d1d1b;
    --info-bg: #17222f;
    --info-line: #2c4057;
    --info-mark: #8ab8f0;
    --button-bg: #e8e8e3;
    --button-fg: #141413;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px rgb(0 0 0 / 40%);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 system-ui, sans-serif;
}

/* 1024 pixels inside, so the screen shows at 1:1. */
main {
  max-width: 1056px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

main.text {
  max-width: 880px;
}

h1 {
  margin: 0 0 12px;
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h2 {
  margin: 32px 0 8px;
  font-size: 20px;
}

a {
  color: var(--link);
}

header p {
  max-width: 70ch;
  margin: 0 0 12px;
}

/* The top: the text, the start, and the notes on the boot. */
.top {
  display: grid;
  gap: 16px;
  grid-template-areas: "text" "launch" "info" "vm";
  margin-bottom: 24px;
}

header {
  grid-area: text;
}

#start {
  display: contents;
}

#start[hidden] {
  display: none;
}

.launch {
  grid-area: launch;
  align-self: start;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.launch p {
  margin: 12px 0 0;
  font-size: 15px;
}

.launch ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

@media (min-width: 760px) {
  .top {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    grid-template-rows: auto auto 1fr;
    grid-template-areas: "text launch" "info launch" "vm launch";
    column-gap: 32px;
  }
}

button {
  font: inherit;
  font-weight: 600;
  padding: 12px 20px;
  border: 0;
  border-radius: 8px;
  background: var(--button-bg);
  color: var(--button-fg);
  cursor: pointer;
}

.launch button {
  width: 100%;
}

button:disabled {
  opacity: 0.5;
  cursor: default;
}

button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

/* The notes on the boot: an information mark in a rounded bar. */
.info {
  grid-area: info;
  align-self: start;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 24px 12px 12px;
  border: 1px solid var(--info-line);
  border-radius: 28px;
  background: var(--info-bg);
  font-size: 15px;
}

.info-icon {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--info-mark);
  color: var(--bg);
  font: italic 700 18px/28px Georgia, serif;
  text-align: center;
}

.info-body {
  min-width: 0;
  padding-top: 2px;
}

.info-body p {
  margin: 0;
}

.info-body p + p {
  margin-top: 6px;
}

#cpus:empty {
  display: none;
}

#size,
#hint,
#versions,
footer {
  color: var(--muted);
}

#status {
  margin: 0 0 12px;
  font-weight: 600;
}

#status:empty {
  display: none;
}

/* The offer of the virtual machine, and its closed section on trust. */
.vm {
  grid-area: vm;
  align-self: start;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-size: 15px;
}

.vm[hidden] {
  display: none;
}

#vm-offer p {
  max-width: 70ch;
  margin: 0;
  padding: 14px 18px;
}

#vm-trust {
  border-top: 1px solid var(--line);
}

#vm-proof {
  padding: 0 18px 6px 37px;
}

#vm-proof h3 {
  margin: 12px 0 4px;
  font-size: 15px;
}

#vm-proof p,
#vm-proof ul {
  max-width: 70ch;
  margin: 0 0 10px;
}

#vm-proof ul {
  padding-left: 20px;
}

#vm-proof code {
  word-break: break-all;
}

#vm-proof pre {
  margin: 0 0 10px;
  padding: 8px 12px;
  overflow-x: auto;
  border-radius: 8px;
  background: var(--bg);
}

#vm-proof pre code {
  word-break: normal;
  white-space: pre;
}

/* vtium's screen. */
#screen {
  background: var(--screen);
  line-height: 0;
  box-shadow: 0 0 0 1px var(--line), var(--shadow);
}

#display {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}

#display:focus {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

#hint {
  margin: 12px 0 0;
}

/* The sections that open on a click. */
.shades,
#log-box {
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}

#log-box {
  margin-top: 16px;
}

.shades details + details {
  border-top: 1px solid var(--line);
}

summary {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 14px 18px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

/* A triangle that points right, and down when the section is open. */
summary::before {
  content: "";
  flex: none;
  width: 0;
  height: 0;
  margin: 0 2px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid var(--muted);
}

details[open] > summary::before {
  transform: rotate(90deg);
}

#log-box summary {
  font-weight: 400;
  color: var(--muted);
}

.shades details > :not(summary) {
  max-width: calc(70ch + 36px);
  margin: 0 0 12px;
  padding: 0 18px 0 37px;
}

.shades details > :last-child {
  margin-bottom: 18px;
}

.shades ul {
  padding-left: 57px;
}

.shades li + li {
  margin-top: 4px;
}

code,
kbd {
  font: 0.92em ui-monospace, monospace;
}

#log {
  max-height: 320px;
  overflow: auto;
  margin: 0;
  padding: 8px 18px 14px;
  font: 12px/1.4 ui-monospace, monospace;
  white-space: pre-wrap;
  word-break: break-all;
}

footer {
  margin-top: 32px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.scroll {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 4px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

td a {
  word-break: break-all;
}
