:root {
  --font-primary: "Manrope", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --body-color: #111;
  --body-bg: #f1f3f4;
  --text-weight: 460;
  --text-spacing: 0.01em;
  --focus-color: rgba(0, 122, 255, 0.5);
  --selection-color: #111;
  --selection-bg: #ededed;
}

* {
  outline: 0;
  padding: 0;
  margin: 0;
  border: 0;
  box-sizing: border-box;
}

::selection {
  color: var(--selection-color);
  background: var(--selection-bg);
}

html {
  background: var(--body-bg);
  color: var(--body-color);
  scroll-behavior: smooth;
}

html,
body {
  min-height: 100%;
}

body {
  overflow-y: scroll;
  font-size: 16px;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: var(--font-primary);
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--body-color);
  position: relative;
  display: flex;
  font-weight: 400;
}

ul {
  list-style: none;
}

/* ---- Layout container ---- */
.container {
  padding: 5rem 1rem 2.5rem;
  max-width: 36.375rem;
  margin: 0 auto;
}

@media screen and (max-width: 768px) {
  .container {
    padding: 2rem 1.5rem 2.5rem;
  }
}

/* Top fade overlay */
.container::before {
  content: "";
  pointer-events: none;
  z-index: 9;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 8rem;
  background: linear-gradient(
    180deg,
    #fff 0,
    hsla(0, 0%, 100%, 0.738) 19%,
    hsla(0, 0%, 100%, 0.541) 34%,
    hsla(0, 0%, 100%, 0.382) 47%,
    hsla(0, 0%, 100%, 0.278) 56.5%,
    hsla(0, 0%, 100%, 0.194) 65%,
    hsla(0, 0%, 100%, 0.126) 73%,
    hsla(0, 0%, 100%, 0.075) 80.2%,
    hsla(0, 0%, 100%, 0.042) 86.1%,
    hsla(0, 0%, 100%, 0.021) 91%,
    hsla(0, 0%, 100%, 0.008) 95.2%,
    hsla(0, 0%, 100%, 0.002) 98.2%,
    hsla(0, 0%, 100%, 0)
  );
}

@media screen and (max-width: 768px) {
  .container::before {
    height: 2.5rem;
  }
}

/* ---- Article ---- */
.article {
  max-width: 70ch;
}

.article > header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0 0 0.5rem;
}

.article > header h1 {
  color: #111;
  font-weight: 500;
}

.article > header h1,
.article > header time {
  font-size: 0.875rem;
  line-height: 1.25rem;
  letter-spacing: var(--text-spacing, -0.00563rem);
}

.article > header time {
  color: rgba(0, 0, 0, 0.4);
  font-weight: 460;
}

.article > p {
  padding-top: 1rem;
  font-size: 0.875rem;
  font-weight: var(--text-weight, 460);
  line-height: 1.25rem;
  letter-spacing: var(--text-spacing, -0.00563rem);
}

.article h2 {
  font-size: 0.875rem;
  font-weight: 560;
  line-height: 1.25rem;
  letter-spacing: var(--text-spacing, -0.00563rem);
  text-wrap: balance;
}

.article > p + h2 {
  padding-top: 2.25rem;
}

.hint {
  border-bottom: 1px dotted #b3b3b3;
  cursor: help;
}

/* ---- Hidden until the Konami code is entered ---- */
[data-konami] {
  display: none;
}

[data-konami].revealed {
  display: block;
}

.font-picker,
.color-picker,
.weight-picker,
.link-picker,
.toggle-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.font-picker,
.color-picker {
  padding: 0 0 1.25rem;
}

.weight-picker,
.link-picker,
.toggle-picker {
  padding: 0 0 2rem;
}

.font-btn,
.color-btn,
.weight-btn,
.link-btn,
.toggle-btn {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 11px;
  line-height: 16px;
  font-weight: 500;
  padding: 3px 8px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.035);
  color: rgba(0, 0, 0, 0.55);
  transition: opacity 0.2s, background 0.15s, color 0.2s;
}

.font-btn:hover,
.color-btn:hover,
.weight-btn:hover,
.link-btn:hover,
.toggle-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: rgba(0, 0, 0, 0.8);
}

.font-btn.is-active,
.color-btn.is-active,
.weight-btn.is-active,
.link-btn.is-active,
.toggle-btn.is-active {
  background: rgba(0, 0, 0, 0.08);
  color: #111;
}

.color-btn,
.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.color-btn .swatch,
.link-btn .swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.spacing-slider {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 0 1.25rem;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 11px;
  line-height: 16px;
  color: rgba(0, 0, 0, 0.55);
}

.spacing-slider input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 160px;
  height: 2px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.14);
  cursor: pointer;
}

.spacing-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.15);
  cursor: pointer;
}

.spacing-slider input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: none;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.15);
  cursor: pointer;
}

.spacing-value {
  font-variant-numeric: tabular-nums;
  color: rgba(0, 0, 0, 0.4);
}

/* ---- Inline links ---- */
.basic-link {
  position: relative;
  display: inline;
  color: var(--link-color, var(--body-color));
  font-weight: inherit;
  line-height: inherit;
  transition: all 0.2s ease;
}

.basic-link::before {
  pointer-events: none;
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  border-radius: 2px;
  background: var(--link-underline, #d9d9d9);
  opacity: 1;
  transition: inherit;
}

.basic-link:hover::before {
  background: var(--link-underline-hover, #666);
}

/* ---- Writing list ---- */
.postList {
  padding: 3rem 0 0;
}

.postList-title {
  color: rgba(0, 0, 0, 0.4);
  font-size: 0.875rem;
  font-weight: 460;
  letter-spacing: -0.00563rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #f2f2f2;
}

.postList > ul {
  display: flex;
  flex-direction: column;
  list-style: none;
}

.postList > ul > li {
  border-bottom: 1px solid #f2f2f2;
}

.postList > ul > li:last-child {
  border-bottom: none;
}

.postList > ul > li > ul {
  display: flex;
  flex-direction: column;
  list-style: none;
}

.postList > ul > li > ul > li > a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.735rem 0 0.735rem 6.75rem;
}

@media screen and (max-width: 520px) {
  .postList > ul > li > ul > li > a {
    padding-left: 3rem;
  }
}

.postList > ul > li > ul > li > a::after {
  content: "";
  border-bottom: 1px solid #f2f2f2;
  position: absolute;
  bottom: 0;
  left: 6.75rem;
  right: 0;
}

.postList > ul > li > ul > li:last-child > a::after {
  display: none;
}

.postList > ul > li > ul > li > a h2 {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: #111;
  font-size: 0.875rem;
  font-weight: 460;
  letter-spacing: -0.00563rem;
  transition: opacity 0.14s ease;
}

.postList > ul > li > ul > li > a h2 .new {
  margin-left: 0.5rem;
  color: rgb(255, 0, 170);
}

.postList > ul > li > ul > li > a time {
  color: rgba(0, 0, 0, 0.4);
  font-size: 0.875rem;
  font-weight: 460;
  line-height: normal;
  letter-spacing: -0.00563rem;
}

.postList > ul > li > ul > li > a time span {
  transition: opacity 0.14s ease;
  display: inline-block;
}

/* hide the literal "/" separator */
.postList > ul > li > ul > li > a time span:nth-child(2) {
  position: absolute;
  width: 0;
  height: 0;
  padding: 0;
  overflow: hidden;
}

/* the year is parked in the left gutter, shown once per group */
.postList > ul > li > ul > li > a time span:last-child {
  visibility: hidden;
  position: absolute;
  left: 0;
}

.postList > ul > li > ul > li:first-child > a > time > span:last-child {
  visibility: visible;
}

/* dim the rest of the list on hover, keeping years legible */
@media screen and (min-width: 520px) {
  .postList > ul:hover > li > ul > li > a h2,
  .postList > ul:hover > li > ul > li > a time span {
    opacity: 0.3;
  }
  .postList > ul:hover > li > ul > li > a time span:last-child {
    opacity: 1;
  }
}

.postList > ul > li > ul > li > a:hover h2,
.postList > ul > li > ul > li > a:hover time span {
  opacity: 1;
}

/* ---- Footer ---- */
.writing {
  display: none;
}

.show-writing .writing {
  display: block;
}

.footer {
  display: none;
  padding: 3rem 0 5rem;
}

.show-footer .footer {
  display: block;
}

.footer-inner {
  max-width: 36.375rem;
  margin: 0 auto;
  padding-top: 12px;
  border-top: 1px solid #eee;
}

.footer-inner p {
  color: rgba(0, 0, 0, 0.4);
  font-size: 0.8125rem;
  font-weight: 460;
  letter-spacing: -0.0025rem;
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
