:root{
  --bg: #fffefd;
  --text: #404246;
  --muted:#7f8081;
  
  --max: 44rem;
  --pad: 1.25rem;
  --leading: 1.65;
}

*{ box-sizing: border-box; }

html{ -webkit-text-size-adjust: 100%; }

body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/var(--leading) system-ui, -apple-system, Segoe UI,
        Roboto, Helvetica, Arial, sans-serif;
}

a{
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:hover{
  text-decoration-color: #111111;
}

.page{
  max-width: var(--max);
  margin: 0 auto;
  padding: calc(var(--pad) * 2) var(--pad) calc(var(--pad) * 3);
}

/* NAV */
.nav{
  display: flex;
  gap: .9rem;
  align-items: baseline;
  margin-bottom: 2.25rem;
  flex-wrap: wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.nav a{
  text-decoration: none;
}

.nav a[aria-current="page"]{
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* FADE TRANSITIONS */
.fade{
  opacity: 0;
  transition: opacity 160ms ease;
}

.fade.is-visible{
  opacity: 1;
}

.fade.is-leaving{
  opacity: 0;
}

/* TYPE */
h1{
  font-size: 2.25rem;
  line-height: 1.15;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

.post-header{
  margin-bottom: 2rem;
}

.post-header h1{
  margin-bottom: .45rem;
}

.post-deck{
  margin: 0 0 .4rem;
  color: #626468;
  font-size: 1.08rem;
  line-height: 1.45;
}

.post-date{
  margin: 0;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
               "Liberation Mono", "Courier New", monospace;
  font-size: .9rem;
  font-variant-numeric: tabular-nums;
}

.signoff{
  margin-top: 2rem;
}

.post-footer{
  margin-top: 2.5rem;
  text-align: right;
  font-size: .875rem;
}

p{
  margin: 0 0 1rem;
}

.post-list{
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-list li{
  margin: .5rem 0;
}

.post-list a{
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: .6rem;
  text-decoration: none;
  color: inherit;
  width: 100%;
}

.post-list .title{
  white-space: nowrap;
}

.post-list .date{
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.post-list .dots{
  height: 1em;
  align-self: center;
  background-image: radial-gradient(
    circle,
    currentColor 1.2px,
    transparent 1.3px
  );
  background-size: 8px 1em;
  background-repeat: repeat-x;
  background-position: center;
  opacity: 0.35;
}

.post-list .dots,
.post-list .date{
  opacity: 0.35;
  transition: opacity 120ms ease;
}

.post-list a:hover .dots,
.post-list a:hover .date{
  opacity: 0.7;
}

.figure{
  margin: 1.5rem 0 2rem;
}

.figure img{
  max-width: 90%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.figure--molecule img{
  max-width: 76%;
}

.figure figcaption{
  max-width: 36rem;
  margin: .75rem auto 0;
  font-size: .9rem;
  line-height: 1.45;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
}

.equation{
  margin: 1.5rem 0 2rem;
}

.equation pre[class*="language-"]{
  margin: 0;
  overflow-x: auto;
}

.equation .math{
  min-height: 4rem;
  padding: 1.25rem .5rem;
  overflow-x: auto;
  text-align: center;
  font-size: 1.15rem;
}

.equation .katex-display{
  margin: 0;
}

.equation figcaption{
  max-width: 36rem;
  margin: .75rem auto 0;
  font-size: .9rem;
  line-height: 1.45;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
}

.caption-title{
  display: block;
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}

.caption-note{
  display: block;
  margin-top: .15rem;
  white-space: nowrap;
}

.figure .caption-credit{
  white-space: normal;
}

.download{
  margin: 1.5rem 0 2rem;
  padding: .85rem 1rem;
  border-left: 2px solid var(--muted);
  background: #f7f6f4;
}

.download a{
  font-weight: 600;
}

.download span{
  margin-left: .4rem;
  color: var(--muted);
  font-size: .9rem;
  white-space: nowrap;
}

.aside{
  margin: 1.5rem 0 2rem;
  padding: .85rem 1rem;
  border-left: 2px solid var(--muted);
  background: #f7f6f4;
}

.aside p:last-child{
  margin-bottom: 0;
}

.aside-title{
  font-weight: 600;
}

/* CORRUPTED.DBC */
.arg-entry h1,
.can-frame,
.terminal-page,
.diagnostic-page{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
               "Liberation Mono", "Courier New", monospace;
}

.can-frame{
  margin: 3.25rem 0 0;
  border: 1px solid #c9c7c3;
  background: #f7f6f4;
  box-shadow: 4px 4px 0 #e9e7e3;
}

.can-frame-standard{
  margin: 0;
  padding: .55rem .8rem;
  border-bottom: 1px solid #c9c7c3;
  color: var(--muted);
  font-size: .78rem;
  letter-spacing: .12em;
}

.can-frame dl{
  margin: 0;
  padding: .75rem .8rem;
}

.can-frame dl div{
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: .75rem;
  padding: .42rem 0;
}

.can-frame dt{
  color: var(--muted);
}

.can-frame dd{
  margin: 0;
  overflow-wrap: anywhere;
}

.terminal-page,
.diagnostic-page{
  min-height: 100vh;
  background: #101311;
  color: #c8f7cf;
}

.terminal-page{
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
}

.recovery-terminal{
  width: min(100%, 52rem);
  height: min(38rem, calc(100vh - 2rem));
  min-height: 22rem;
  border: 1px solid #416a49;
  background: #0a0d0b;
  box-shadow: 0 1.1rem 4rem rgba(0, 0, 0, .42);
}

.terminal-bar{
  position: relative;
  display: flex;
  align-items: center;
  gap: .45rem;
  height: 2.5rem;
  padding: 0 .8rem;
  border-bottom: 1px solid #2e4934;
  background: #151b17;
}

.terminal-bar span{
  width: .65rem;
  height: .65rem;
  border-radius: 50%;
  border: 1px solid #52745a;
}

.terminal-bar p{
  position: absolute;
  left: 50%;
  margin: 0;
  transform: translateX(-50%);
  color: #829e87;
  font-size: .78rem;
  white-space: nowrap;
}

.terminal-body{
  height: calc(100% - 2.5rem);
  padding: 1rem;
  overflow-y: auto;
  scrollbar-color: #416a49 #0a0d0b;
}

.terminal-output p{
  margin: 0 0 .35rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.terminal-output .terminal-spacer{
  margin-top: 1.25rem;
}

.terminal-return{
  color: #829e87;
}

.terminal-return:hover{
  color: #f2fff4;
}

.terminal-command,
.terminal-history{
  color: #f2fff4;
}

.terminal-error{
  color: #f5a8a8;
}

.terminal-prompt{
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .65rem;
  margin-top: .35rem;
}

.terminal-prompt input{
  min-width: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  padding: 0;
  background: transparent;
  color: #f2fff4;
  font: inherit;
  caret-color: #c8f7cf;
}

.sr-only{
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.diagnostic-page{
  display: grid;
  place-items: center;
  padding: 1.25rem;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(69, 191, 91, .11), transparent 36rem),
    #080b09;
}

.diagnostic-screen{
  position: relative;
  width: min(100%, 46rem);
  border: 1px solid #416a49;
  padding: clamp(1.5rem, 6vw, 3.75rem);
  overflow: hidden;
  background:
    repeating-linear-gradient(0deg, rgba(200, 247, 207, .025) 0, rgba(200, 247, 207, .025) 1px, transparent 1px, transparent 4px),
    #0a0d0b;
  box-shadow:
    0 0 0 1px rgba(200, 247, 207, .025) inset,
    0 1.1rem 4rem rgba(0, 0, 0, .5),
    0 0 5rem rgba(65, 106, 73, .12);
}

.diagnostic-screen::after{
  content: "";
  position: absolute;
  z-index: 2;
  top: -35%;
  left: 0;
  width: 100%;
  height: 28%;
  pointer-events: none;
  background: linear-gradient(transparent, rgba(200, 247, 207, .045), transparent);
  animation: diagnostic-scan 5s linear infinite 2.4s;
}

.diagnostic-topline{
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: #829e87;
  font-size: .72rem;
  letter-spacing: .08em;
}

.diagnostic-topline p{
  margin: 0;
}

.diagnostic-signal{
  color: #c8f7cf;
  white-space: nowrap;
}

.diagnostic-signal span{
  display: inline-block;
  width: .55rem;
  height: .55rem;
  margin-right: .45rem;
  border-radius: 50%;
  background: #7dff91;
  box-shadow: 0 0 .8rem #7dff91;
  animation: diagnostic-pulse 1.8s ease-in-out infinite;
}

.diagnostic-heading{
  margin: clamp(2rem, 6vw, 3.5rem) 0 1.25rem;
  color: #f2fff4;
  font: 700 clamp(2.6rem, 10vw, 5.4rem)/.84 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  letter-spacing: -.08em;
  text-shadow: 0 0 1.6rem rgba(125, 255, 145, .16);
}

.diagnostic-heading span{
  display: block;
}

.diagnostic-heading span:last-child{
  color: #7dff91;
}

.recovery-progress{
  height: 2px;
  margin-bottom: 1.8rem;
  overflow: hidden;
  background: #203426;
}

.recovery-progress span{
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: left;
  background: #7dff91;
  box-shadow: 0 0 .8rem rgba(125, 255, 145, .75);
  animation: recovery-fill 1.1s cubic-bezier(.2, .8, .2, 1) both;
}

.diagnostic-checks{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .6rem 1.5rem;
  padding: 0;
  margin: 0;
  list-style: none;
  color: #829e87;
  font-size: .78rem;
}

.diagnostic-checks li{
  opacity: 0;
  transform: translateY(.35rem);
  animation: diagnostic-arrive .35s ease forwards;
}

.diagnostic-checks li:nth-child(1){ animation-delay: .35s; }
.diagnostic-checks li:nth-child(2){ animation-delay: .55s; }
.diagnostic-checks li:nth-child(3){ animation-delay: .75s; }
.diagnostic-checks li:nth-child(4){ animation-delay: .95s; }

.diagnostic-checks span{
  margin-right: .45rem;
  color: #7dff91;
}

.recovered-message{
  margin-top: clamp(2rem, 6vw, 3rem);
  padding: 1.15rem 1.25rem 1.25rem;
  border: 1px solid #2e4934;
  background: rgba(20, 30, 23, .78);
  opacity: 0;
  transform: translateY(.5rem);
  animation: diagnostic-arrive .5s ease 1.35s forwards;
}

.recovered-label{
  margin: 0 0 .75rem;
  color: #829e87;
  font-size: .67rem;
  letter-spacing: .14em;
}

.diagnostic-message{
  margin: 0;
  color: #f2fff4;
  font-size: clamp(.9rem, 3.3vw, 1.2rem);
  line-height: 1.35;
  letter-spacing: .045em;
}

.diagnostic-reveal{
  margin: .15rem 0 0;
  color: #7dff91;
  font-size: clamp(1.35rem, 5vw, 2.1rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.03em;
}

.diagnostic-footer{
  margin: 1.25rem 0 0;
  color: #58725e;
  font-size: .67rem;
  letter-spacing: .1em;
  text-align: right;
  opacity: 0;
  animation: diagnostic-arrive .5s ease 1.75s forwards;
}

.diagnostic-footer p{
  margin: 0;
}

.diagnostic-return{
  display: inline-block;
  margin-top: .35rem;
  color: #829e87;
  letter-spacing: .04em;
  text-underline-offset: 3px;
}

.diagnostic-return:hover{
  color: #c8f7cf;
}

@keyframes recovery-fill{
  from{ transform: scaleX(0); }
  to{ transform: scaleX(1); }
}

@keyframes diagnostic-arrive{
  to{
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes diagnostic-pulse{
  0%, 100%{ opacity: .55; transform: scale(.85); }
  50%{ opacity: 1; transform: scale(1); }
}

@keyframes diagnostic-scan{
  to{ top: 110%; }
}

@media (max-width: 420px){
  h1{ font-size: 1.9rem; }

  .download span{
    display: block;
    margin: .2rem 0 0;
  }

  .post-list a{
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .post-list .title{
    white-space: normal;
  }

  .post-list .dots{
    display: none;
  }

  .can-frame{
    margin-top: 2.5rem;
  }

  .can-frame dl div{
    grid-template-columns: 3.75rem minmax(0, 1fr);
    gap: .4rem;
  }

  .terminal-page{
    padding: 0;
  }

  .recovery-terminal{
    width: 100%;
    height: 100vh;
    min-height: 0;
    border: 0;
  }

  .terminal-bar p{
    position: static;
    margin-left: .5rem;
    transform: none;
  }

  .diagnostic-page{
    padding: .75rem;
  }

  .diagnostic-topline{
    display: block;
  }

  .diagnostic-signal{
    margin-top: .35rem !important;
  }

  .diagnostic-checks{
    grid-template-columns: 1fr;
  }

  .diagnostic-heading{
    font-size: clamp(2.5rem, 17vw, 4rem);
  }
}

@media (prefers-reduced-motion: reduce){
  .recovery-progress span,
  .diagnostic-checks li,
  .recovered-message,
  .diagnostic-footer,
  .diagnostic-signal span,
  .diagnostic-screen::after{
    animation: none;
  }

  .diagnostic-checks li,
  .recovered-message,
  .diagnostic-footer{
    opacity: 1;
    transform: none;
  }
}
