:root {
  --color-bg: #0A0A0A;
  --color-fg: #ECECEC;
  --color-accent: #C85A3A;
  --color-border: #ECECEC;
  --color-border-light: rgba(236, 236, 236, 0.1);
  --color-muted: #7A7A7A;
  --color-surface: #1A1A1A;

  --spacing-unit: 0.5rem;
  --max-content-width: 960px;

  --line-height-base: 1.6;
  --line-height-relaxed: 1.7;

  --border-thin: 1px solid var(--color-border-light);
  --border-normal: 2px solid var(--color-border-light);
  --border-heavy: 4px solid var(--color-border);
}

html {
  box-sizing: border-box;
  font-size: clamp(0.875rem, 1vw + 0.75rem, 0.9375rem);
  line-height: var(--line-height-base);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

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

body {
  margin: 0;
  padding: calc(var(--spacing-unit) * 4);
  background: var(--color-bg);
  color: var(--color-fg);
}

body:not([data-full-bleed])>header,
body:not([data-full-bleed])>main,
body:not([data-full-bleed])>footer,
body:not([data-full-bleed])>aside {
  max-width: var(--max-content-width);
  margin-left: auto;
  margin-right: auto;
}

body>header {
  margin-bottom: calc(var(--spacing-unit) * 4);
  padding-bottom: calc(var(--spacing-unit) * 4);
  border-bottom: var(--border-normal);
}

main section+section {
  margin-top: calc(var(--spacing-unit) * 8);
  padding-top: calc(var(--spacing-unit) * 4);
  border-top: var(--border-normal);
}

p,
ul,
ol,
dl,
blockquote,
pre,
table,
figure {
  margin: calc(var(--spacing-unit) * 2) 0;
}

p {
  line-height: var(--line-height-relaxed);
}

a {
  color: var(--color-accent);
  text-decoration-thickness: 0.125rem;
}

:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

mark {
  background: var(--color-accent);
  color: var(--color-bg);
  padding: 0.125rem 0.35rem;
  border: var(--border-thin);
  text-transform: uppercase;
}

code,
kbd {
  font-family: "SF Mono", "Monaco", "Cascadia Code", "Roboto Mono", "Courier New", monospace;
  background: var(--color-surface);
  padding: 0.2em 0.4em;
  border: var(--border-thin);
}

pre {
  padding: calc(var(--spacing-unit) * 2);
  background: var(--color-surface);
  border: var(--border-normal);
  border-left: var(--border-heavy);
  overflow-x: auto;
  line-height: 1.5;
}

pre>code {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
}

blockquote {
  border-left: var(--border-heavy);
  padding-left: calc(var(--spacing-unit) * 2);
  margin-left: 0;
  margin-right: 0;
  font-style: italic;
  color: var(--color-muted);
}

hr {
  border: none;
  border-top: var(--border-normal);
  margin: calc(var(--spacing-unit) * 4) 0;
}

ul {
  padding-left: calc(var(--spacing-unit) * 4);
  list-style: square;
}

ol {
  padding-left: calc(var(--spacing-unit) * 4);
}

li {
  margin: calc(var(--spacing-unit) * 1) 0;
  line-height: var(--line-height-base);
}

ul ul,
ol ol,
ul ol,
ol ul {
  margin-top: calc(var(--spacing-unit) * 1);
  margin-bottom: 0;
  padding-left: calc(var(--spacing-unit) * 3);
}

dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 4);
  line-height: var(--line-height-base);
}

dt {
  font-weight: 700;
}

dd {
  margin: 0;
}

figcaption {
  color: var(--color-muted);
}

img,
video,
iframe {
  max-width: 100%;
  height: auto;
  display: block;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  margin: calc(var(--spacing-unit) * 3) 0;
  line-height: var(--line-height-base);
  background: var(--color-bg);
  display: block;
  overflow-x: auto;
}

caption {
  font-weight: 700;
  margin-bottom: calc(var(--spacing-unit) * 2);
  text-transform: uppercase;
  color: var(--color-muted);
}

th,
td {
  padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 2);
  vertical-align: top;
  border-bottom: var(--border-normal);
}

th {
  text-align: start;
  font-weight: 700;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:last-child th {
  border-bottom: none;
}

tfoot td,
tfoot th {
  padding-top: calc(var(--spacing-unit) * 2);
  border-top: 2px solid var(--color-border);
  border-bottom: none;
  font-weight: 600;
  background: var(--color-surface);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  margin: 0;
  border-radius: 0;
}

:is(button, input[type="button"], input[type="submit"], input[type="reset"]) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-unit);
  padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 3);
  border: 2px solid var(--color-border);
  background: var(--color-bg);
  cursor: pointer;
  font-weight: 600;
  text-transform: uppercase;
}

:is(button, input[type="button"], input[type="submit"], input[type="reset"]):hover {
  background: var(--color-fg);
  color: var(--color-bg);
}

:is(button, input[type="button"], input[type="submit"], input[type="reset"]):disabled {
  border-style: dashed;
  cursor: not-allowed;
  color: var(--color-muted);
  background: transparent;
}

:is(button, input[type="button"], input[type="submit"], input[type="reset"]):disabled:hover {
  background: transparent;
  color: var(--color-muted);
}

:is(button, input[type="button"], input[type="submit"], input[type="reset"])+ :is(button, input[type="button"], input[type="submit"], input[type="reset"]) {
  margin-left: calc(var(--spacing-unit) * 2);
}

:is(input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="search"],
  input[type="url"],
  input[type="tel"],
  input[type="number"],
  input[type="date"],
  input[type="time"],
  input[type="month"],
  input[type="week"],
  input[type="datetime-local"],
  textarea,
  select) {
  width: 100%;
  padding: calc(var(--spacing-unit) * 2);
  border: 2px solid var(--color-border-light);
  background: var(--color-bg);
  appearance: none;
}

:is(input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="search"],
  input[type="url"],
  input[type="tel"],
  input[type="number"],
  input[type="date"],
  input[type="time"],
  input[type="month"],
  input[type="week"],
  input[type="datetime-local"],
  textarea,
  select):focus {
  border-color: var(--color-accent);
  outline: none;
}

select,
input[list] {
  padding-right: calc(var(--spacing-unit) * 5);
}

select option,
select optgroup,
datalist,
datalist option {
  color: var(--color-fg);
  background: var(--color-bg);
}

input[type="checkbox"],
input[type="radio"] {
  margin-right: calc(var(--spacing-unit) * 2);
}

input::placeholder,
textarea::placeholder {
  font-style: italic;
  opacity: 0.6;
  color: var(--color-muted);
}

fieldset {
  border: var(--border-normal);
  padding: calc(var(--spacing-unit) * 3);
  margin: 0 0 calc(var(--spacing-unit) * 3);
}

legend {
  padding: 0 calc(var(--spacing-unit) * 2);
  font-weight: 700;
  margin-bottom: calc(var(--spacing-unit) * 1.5);
}

label {
  display: block;
  margin-top: calc(var(--spacing-unit) * 3);
  margin-bottom: calc(var(--spacing-unit) * 1.5);
  font-weight: 600;
  line-height: 1.5;
}

label:first-child,
legend+label {
  margin-top: 0;
}

label:has(input[type="checkbox"]),
label:has(input[type="radio"]) {
  display: flex;
  align-items: center;
  font-weight: 400;
  margin-top: calc(var(--spacing-unit) * 1.5);
}

fieldset fieldset {
  margin-top: calc(var(--spacing-unit) * 3);
}

:is(input, select, textarea)+label {
  margin-top: calc(var(--spacing-unit) * 3);
}

:is(input, select, textarea)+ :is(button, input[type="button"], input[type="submit"], input[type="reset"]) {
  margin-top: calc(var(--spacing-unit) * 3);
}

details {
  border: var(--border-normal);
  padding: 0;
  margin: calc(var(--spacing-unit) * 2) 0;
}

summary {
  cursor: pointer;
  font-weight: 700;
  padding: calc(var(--spacing-unit) * 2);
  background: var(--color-surface);
}

details[open] summary {
  border-bottom: var(--border-normal);
}

details[open]>*:not(summary) {
  padding: calc(var(--spacing-unit) * 2);
  padding-top: calc(var(--spacing-unit) * 1.5);
}

nav {
  margin: calc(var(--spacing-unit) * 3) 0;
}

nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: calc(var(--spacing-unit) * 3);
  flex-wrap: wrap;
}

nav a {
  text-decoration: none;
  font-weight: 600;
}

aside,
footer {
  margin-top: calc(var(--spacing-unit) * 8);
  padding-top: calc(var(--spacing-unit) * 4);
  border-top: var(--border-normal);
}

footer {
  color: var(--color-muted);
}
