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

html {
  color-scheme: dark;
  background: #000;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 44rem;
  display: flex;
  flex-direction: column;
  padding: max(1.5rem, env(safe-area-inset-top)) max(1.5rem, env(safe-area-inset-right))
    max(1.5rem, env(safe-area-inset-bottom)) max(1.5rem, env(safe-area-inset-left));
  background: #000;
  color: #fff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem 1rem;
}

.info {
  display: flex;
  gap: 1.5rem;
}

main {
  flex: 1;
  padding: clamp(2rem, 6vw, 4rem) 0;
}

.site,
.lang,
.info,
.close,
.addr,
.credit,
.meta {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: clamp(0.8rem, 0.7rem + 0.5vw, 1rem);
}

.site {
  color: #fff;
  letter-spacing: 0.2em;
  text-decoration: none;
  text-transform: uppercase;
}

.addr,
.meta,
.empty {
  color: #9a9a9a;
  letter-spacing: 0.1em;
}

.colophon {
  display: flex;
  align-items: baseline;
  gap: 0.6em;
  white-space: nowrap;
}

.credit {
  color: #9a9a9a;
  font-family: inherit;
  font-size: 0.7rem;
}

/* Smala skärmar: adressen och raden om AI krymper med bredden så att de får plats på en rad */
@media (max-width: 34rem) {
  .colophon {
    flex-basis: 100%;
  }

  .colophon .addr,
  .credit {
    font-size: min(2.3vw, 0.7rem);
    letter-spacing: 0;
  }
}

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(2rem, 1.4rem + 3vw, 3.25rem);
  font-weight: 700;
}

h2 {
  margin: 2.5rem 0 0.75rem;
  font-size: 1.5rem;
}

h3 {
  margin: 2rem 0 0.5rem;
  font-size: 1.2rem;
}

a {
  color: #fff;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

img {
  max-width: 100%;
  height: auto;
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
}

pre {
  overflow-x: auto;
  padding: 1rem;
  border: 1px solid #333;
}

table {
  width: 100%;
  margin: 1.5rem 0;
  border-collapse: collapse;
}

th,
td {
  padding: 0.5rem 0.75rem;
  border: 1px solid #333;
  text-align: left;
  vertical-align: top;
}

th {
  background: #1a1a1a;
}

td code {
  overflow-wrap: anywhere;
}

blockquote {
  margin: 1.5rem 0;
  padding-left: 1rem;
  border-left: 1px solid #fff;
  color: #9a9a9a;
}

.articles {
  margin: 2.5rem 0 0;
  padding: 0;
  list-style: none;
}

.articles li {
  padding: 1.25rem 0;
  border-top: 1px solid #333;
}

.articles a {
  font-size: 1.25rem;
  font-weight: 700;
}

.articles p {
  margin: 0.25rem 0 0;
  color: #9a9a9a;
}

.nowrap {
  white-space: nowrap;
}

.popup {
  display: none;
  position: fixed;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: max(1.5rem, env(safe-area-inset-top)) max(1.5rem, env(safe-area-inset-right))
    max(1.5rem, env(safe-area-inset-bottom)) max(1.5rem, env(safe-area-inset-left));
  background: rgba(0, 0, 0, 0.85);
}

.popup:target {
  display: block;
}

.backdrop {
  position: fixed;
  inset: 0;
  cursor: default;
}

.popup section {
  position: relative;
  max-width: 41rem;
  margin: 0 auto;
  padding: 1.5rem;
  border: 1px solid #333;
  background: #000;
}

.popup h2 {
  margin-top: 0;
}

.close {
  float: right;
  margin: 0 0 1rem 1rem;
}

.popup h3 {
  margin: 1.25rem 0 0.25rem;
  font-size: inherit;
  letter-spacing: 0;
}

#glossary p {
  margin: 0;
  color: #9a9a9a;
}
