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

html {
  font-size: 112.5%; /* 18px base; scales with user browser preferences */
}

:root {
  --bg: #161616;
  --highlight: #ffffff;
  --accent: #eeeeee;
  --text-primary: #bbbbbb;
  --text-secondary: #999999;
  --dark: #7a7a7a;
  --border: #333333;
  --bg-dark: #000;
  --v-spacing: clamp(3rem, 6vw, 6rem);
}

[data-theme="light"] {
  --bg: #FAF9F5;
  --highlight: #111111;
  --accent: #222222;
  --text-primary: #444444;
  --text-secondary: #666666;
  --dark: #888888;
  --border: #dddddd;
  --bg-dark: #eeebe4;
}

[data-theme="light"] body {
  font-weight: 400;
}

[data-theme="light"] time,
[data-theme="light"] .meta,
[data-theme="light"] .dim,
[data-theme="light"] small,
[data-theme="light"] footer {
  font-weight: 400;
}

.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.3s ease, border-color 0.3s ease;
  z-index: 100;
  padding: 0;
}

.theme-toggle:hover {
  color: var(--highlight);
  border-color: var(--text-secondary);
}

.theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun  { display: block; }

[data-theme="light"] .theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .icon-sun  { display: none; }

body {
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.8;
  margin: 0;
  padding: 0;
  overflow-wrap: break-word;
}

h1, h2, h3 {
  color: var(--highlight);
  font-weight: 600;
  letter-spacing: 0.1em;
}

h1 {
  font-size: 1.3em;
  line-height: 1.4em;
  text-transform: uppercase;
}

article header h1 {
  text-transform: capitalize;
}

article h2 {
  margin-top: var(--v-spacing);
}

h2 {
  font-size: 1.3em;
  /* text-transform: uppercase; */
  margin: 0;
}

h3, h4 {
  font-size: 1em;
  line-height: 1em;
  font-weight: 400;
}

p {
  margin: 1.5em 0;
}

em, strong {
  color: var(--accent);
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 4px;
  transition: all 0.4s ease;
}

a:hover {
  text-decoration-color: var(--text-secondary);
  color: var(--highlight);
}

nav a {
  font-weight: 800;
}

.v-align-middle > * {
  vertical-align: middle;
}

ul {
  list-style: none;
  padding-left: 0;
}

main {
  max-width: 65ch;
  width: 100%;
  margin: var(--v-spacing) auto;
  padding: 0 1rem;
}

article header {
  margin-bottom: 2em;
}

@media (max-width: 600px) {
  html {
    font-size: 100%; /* 16px on mobile */
  }

  blockquote {
    margin: 1em;
  }

  img.portrait {
    width: 100%;
  }
}

code {
  font-family: ui-monospace, "Cascadia Code", monospace;
  background: var(--bg);
  padding: 0.2em 0.4em;
  font-size: 0.8em;
}

pre {
  background: var(--bg);
  padding: 1.5rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 4px;
  white-space: pre-wrap;
}

time, .meta, .dim, small {
  color: var(--text-secondary);
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-weight: 300;
  font-size: 0.85rem;
}

small {
  color: var(--dark);
  font-size: 0.8rem;
}

.footnote {
  color: var(--text-secondary);
  font-size: 0.8rem;
  padding-top: 0.5em;
  margin-top: 0.25em;
}

.footnote a {
  color: var(--dark);
}

sup a {
  text-decoration: none;
  color: var(--text-secondary);
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--dark);
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-weight: 300;
  font-size: 0.85rem;
  text-transform: uppercase;
  padding: 2em 0 var(--v-spacing) 0;
}

.footer-icons {
  display: flex;
  align-items: center;
  gap: 1em;
}

footer svg {
  display: block;
  width: 1.2em;
  height: 1.2em;
}

hr {
  border: 0;
  height: 1px;
  background: var(--border);
  margin: var(--v-spacing) auto;
}

hr.spacer {
  background: none;
  margin: calc(var(--v-spacing) * 0.5) auto;
}

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

img.logo {
  width: 70px;
  height: auto;
}

img.portrait {
  display: block;
  width: 65%;
  margin: 0 auto;
}

.align-horizontal {
  display: flex;
  align-items: center;
  gap: 1em;
  margin-bottom: var(--v-spacing);
}

.card {
  background: var(--bg-dark);
  /* border: 1px solid var(--border); */
  border-radius: 4px;
  padding: 1rem 1.25rem 2rem 1.25rem;
  margin: 1rem 0 4rem 0;
  font-family: courier;
  font-size: 0.8em;
}

.card p {
  margin: 0.5rem 0;
}

.card small {
  display: inline-block;
}

.card strong {
  font-size: 1.1em;
}

.card .pipe {
  color: var(--border);
  padding: 0 0.4em;
}

.card .flag {
  font-size: 1.2em;
  vertical-align: middle;
}

.card .label {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.bg-dark {
  background: var(--bg-dark);
}

.card-entry + .card-entry {
  margin-top: 2rem;
}

.card-attrs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  margin: 0.5rem 0px;
  padding: 0.25rem 0px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding-top: 0.6rem;
}

.attr {
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

.attr-yes {
  color: #5a9472;
}

.attr-no {
  color: #8a5555;
}

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

table {
  display: block;
  overflow-x: auto;
  white-space: nowrap;
  margin: 1.5rem 0;
  margin-left: -1rem;
  border-collapse: separate;
  border-spacing: 2em 0.75em;
  background: var(--bg);
  font-size: 0.85em;
}

td, th {
  padding: 0.25em 0.5em;
  text-align: left;
}

th:first-child, td:first-child {
  padding-left: 0;
}

th {
  font-weight: 700;
  color: var(--text-secondary);
}

.tbl-cost {
  font-size: 0.85em;
  color: var(--dark);
}

.tbl-model {
  font-family: ui-monospace, "Cascadia Code", monospace;
  color: var(--accent);
}

.tbl-dash {
  color: var(--dark);
}

.tbl-pending {
  color: var(--dark);
  font-style: italic;
}

.check-yes {
  color: #5a9472;
}

.check-no {
  color: #8a5555;
}

.tbl-cat {
  color: var(--text-secondary);
}

.tbl-tool {
  color: var(--highlight);
}

.tbl-notes {
  color: var(--dark);
}
