* { box-sizing: border-box; }

body {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 16px 64px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 16px;
  line-height: 1.6;
  color: #111;
  background: #fff;
}

h1, h2, h3 {
  font-family: -apple-system, Helvetica, Arial, sans-serif;
  line-height: 1.25;
  color: #000;
}

h1 { font-size: 32px; margin: 0 0 8px; }
h2 { font-size: 20px; margin: 28px 0 8px; border-bottom: 1px solid #ddd; padding-bottom: 6px; }
h3 { font-size: 14px; margin: 20px 0 8px; text-transform: uppercase; letter-spacing: 0.04em; color: #555; }

hr {
  border: none;
  border-top: 1px solid #ddd;
  margin: 32px 0;
}

nav ol {
  padding-left: 20px;
}
nav li { margin: 2px 0; font-family: -apple-system, Helvetica, Arial, sans-serif; font-size: 14px; }

pre {
  background: #f4f4f4;
  border: 1px solid #ddd;
  padding: 12px 14px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.5;
}

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

pre code { font-size: 13px; }

table {
  width: 100%;
  border-collapse: collapse;
  font-family: -apple-system, Helvetica, Arial, sans-serif;
  font-size: 13px;
  margin: 16px 0;
}

th, td {
  text-align: left;
  padding: 8px 10px;
  border: 1px solid #ddd;
  vertical-align: top;
}

th {
  background: #f4f4f4;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

footer { margin-top: 32px; }

.demo {
  border: 1px solid #bbb;
  background: #fafafa;
  height: 160px;
  position: relative;
  overflow: hidden;
  margin: 8px 0 8px;
}

.demo .box {
  background: #fff;
  border: 1px solid #111;
  padding: 8px 14px;
  font-family: -apple-system, Helvetica, Arial, sans-serif;
  font-size: 13px;
  text-align: center;
}

.demo .box.fixed {
  width: 120px;
  height: 80px;
  display: grid;
  place-items: center;
}

.demo .box.fixed-width { width: 140px; }
.demo .box.inline { display: inline-block; margin: 2px; padding: 6px 12px; }

/* 1. Flexbox */
.demo-flex-both { display: flex; justify-content: center; align-items: center; }
.demo-flex-h { display: flex; justify-content: center; align-items: flex-start; padding-top: 24px; }
.demo-flex-v { display: flex; align-items: center; justify-content: flex-start; padding-left: 24px; }
.demo-flex-margin-auto { display: flex; }
.demo-flex-margin-auto .box { margin: auto; }

/* 2. Grid */
.demo-grid-center { display: grid; place-items: center; }
.demo-grid-content { display: grid; place-content: center; }

/* 3. Absolute + Transform */
.demo-abs-transform { position: relative; }
.demo-abs-transform .box { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }

/* 4. Absolute + Inset */
.demo-abs-inset, .demo-abs-inset2 { position: relative; }
.demo-abs-inset .box, .demo-abs-inset2 .box { position: absolute; inset: 0; margin: auto; }

/* 5. Margin auto */
.demo-margin-auto { padding-top: 24px; }
.demo-margin-auto .box { margin: 0 auto; display: block; }

/* 6. Text align / line-height */
.demo-text-align { text-align: center; padding-top: 24px; }
.demo-line-height { height: 80px; line-height: 80px; text-align: center; }
